# Ignore absolute/protocol-relative and data-uri URLs.
if re.match(r'^[a-z]+:', url):
return matched
}}}
I've included an example snippet that uses a protocol-relative url but is
not filtered:
{{{#!css
@import
url("//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Raleway:400,800,900");
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29022>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
The code changed in 08ed3cc6d160d0d864ff687db9a62959a86e7372 so the
comment is outdated but as far as I see, a URL starting with `//` would
likely be filtered out in the next block: `if url.startswith('/') and not
url.startswith(settings.STATIC_URL):`. Anyway, there's still a test
assertion for `//foobar` remaining unchanged and I don't see a change to
the URL you provided if I add that to the test. Can you find the
difference between that test and your situation that reproduces the
problem?
--
Ticket URL: <https://code.djangoproject.com/ticket/29022#comment:1>
Comment (by Will Gulian):
Replying to [comment:1 Tim Graham]:
> The code changed in 08ed3cc6d160d0d864ff687db9a62959a86e7372 so the
comment is outdated but as far as I see, a URL starting with `//` would
likely be filtered out in the next block: `if url.startswith('/') and not
url.startswith(settings.STATIC_URL):`. Anyway, there's still a test
assertion for `//foobar` remaining unchanged and I don't see a change to
the URL you provided if I add that to the test. Can you find the
difference between that test and your situation that reproduces the
problem?
Sorry I should have looked at that function more closely. It's not being
caught in my case because my `STATIC_URL` is `/` so the line that should
exit doesn't because the protocol-relative url actually starts with my
`STATIC_URL`.
--
Ticket URL: <https://code.djangoproject.com/ticket/29022#comment:2>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/29022#comment:3>