mirror of https://gitlab.com/tildes/tildes.git
Browse Source
Yet another issue with Bleach 3.0's linkification: when used via the filter as part of sanitization (which is necessary right now due to *another* issue where it escapes valid HTML tags), it doesn't properly linkify urls that contain an ampersand. As a (temporary?) workaround, this stops using Bleach's linkification entirely and switches to cmark-gfm's "autolink" extension. These aren't perfectly equivalent, and the switch results in two other issues that I consider more minor than links including ampersands not working: - autolink will initially create links for ftp:// urls and email addresses. The final sanitization will remove these links due to the protocol whitelist, but it will leave behind a bare <a> tag. So the text will *appear* linked but not actually link to anything. If I decide to stick with autolink, it should be pretty straightforward to fix this by stripping all bare <a> tags from the final HTML. - autolink doesn't create links for bare domains. For example, writing "example.com" won't result in a link, it's necessary to write "www.example.com" or include a protocol like "http://example.com".merge-requests/53/head
Deimos
6 years ago
3 changed files with 6 additions and 62 deletions
Loading…
Reference in new issue