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

Unified Diff: cms/converters.py

Issue 5172705124941824: Issue 2452 - Avoid replacing "\n" with newline in fixed strings (Closed)
Patch Set: Created May 6, 2015, 4 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 | 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 34ded27a78058824d5e34abef7c6f2975350411d..80195fa302aff08ccd67f6969ab668372d99992c 100644
--- a/cms/converters.py
+++ b/cms/converters.py
@@ -143,7 +143,7 @@ class Converter:
# Insert fixed strings
for i in range(len(fixed_strings)):
Sebastian Noack 2015/05/06 16:24:30 While on it, mind making this loop a little more P
Sebastian Noack 2015/05/06 16:25:24 Even better: for i, fixed_string in enumerate(f
kzar 2015/05/06 16:30:41 Done.
- result = re.sub(r"\{%d\}" % (i + 1), fixed_strings[i], result, 1)
+ result = result.replace("{%d}" % (i + 1), fixed_strings[i], 1)
# Insert attributes
result = escape(result)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld