You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm using the url filter for images in this way:
<imgsrc="{{ image.src | url }}">
But sometimes, the images are external urls. To make them work in http and https contexts, I remove the protocol, so the urls are like this: //placehold.it/300x100. Seems like the filter does not detect this and generate the invalid url /placehold.it/300x100.
Is your feature request related to a problem? Please describe.
I'm using the
url
filter for images in this way:But sometimes, the images are external urls. To make them work in http and https contexts, I remove the protocol, so the urls are like this:
//placehold.it/300x100
. Seems like the filter does not detect this and generate the invalid url/placehold.it/300x100
.Describe the solution you'd like
I can see that the filter can detect http and https protocols (https://github.com/11ty/eleventy/blob/master/src/Filters/Url.js#L8) so I propose adding another condition:
url.indexOf("//") === 0
.The text was updated successfully, but these errors were encountered: