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

Unified Diff: cms/converters.py

Issue 4695455875203072: Noissue - Fix newline bug in tag attributes (Closed)
Patch Set: Created May 7, 2015, 11:17 a.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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/converters.py
diff --git a/cms/converters.py b/cms/converters.py
index 3e57e8a8bf9af552ffb64da3c51e65dce1ba5249..d923abca5dd5f82bc6326e462785181cf538a44e 100644
--- a/cms/converters.py
+++ b/cms/converters.py
@@ -166,7 +166,12 @@ class Converter:
attrs = map(stringify_attribute, attrs)
result = re.sub(
r"%s([^<>]*?)%s" % (re_escape("<%s>" % tag), re_escape("</%s>" % tag)),
- r'<%s%s>\1</%s>' % (tag, " " + " ".join(attrs) if attrs else "", tag),
+ lambda match: r'<%s%s>%s</%s>' % (
Sebastian Noack 2015/05/07 11:24:12 I suppose we use a callback now, to prevent backsl
kzar 2015/05/07 11:25:16 Yep, you got it
+ tag,
+ " " + " ".join(attrs) if attrs else "",
+ match.group(1),
+ tag
+ ),
result, 1, flags=re.S
)
result = re.sub(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld