Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: cms/converters.py

Issue 29947567: Issue 5333 - Ensure links in metadata and in most tags can be made relative (Closed) Base URL: https://hg.adblockplus.org/cms/
Patch Set: Combine regex in converters.py Created Jan. 7, 2019, 10:23 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/expected_output/relative/de/rel_path » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/converters.py
===================================================================
--- a/cms/converters.py
+++ b/cms/converters.py
@@ -326,9 +326,7 @@
return ''.join((pre, jinja2.Markup.escape(url), post))
- text = re.sub(r'(<a\s[^<>]*\b(href)=\")([^<>\"]+)(\")',
- process_link, text)
- text = re.sub(r'(<img\s[^<>]*\b(src)=\")([^<>\"]+)(\")',
+ text = re.sub(r'(<[\w]+\s[^<>]*\b(href|src)=\")([^<>\"]+)(\")',
process_link, text)
return text
« no previous file with comments | « no previous file | tests/expected_output/relative/de/rel_path » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld