How do I use a leading slash with the url() function? The url() function won't work with a leading slash as it's path parameter. 

For example, this: {{ url('jobs') }}
Outputs: http://example.com/jobs

But this: {{ url('/jobs') }}
Just outputs: /jobs

This is easy enough to remember for developers, but if you're passing a variable from a user input field like {{ url(entry.myField) }}, users can accidentally break a link if they add a leading slash.

How can I make the url() function more resilient when relying on an unknown variable?
Use the trim filter to automatically remove leading and trailing slashes like so:

{{ url( entry.myField | trim('/') )  }}