Commit 7fb19409 authored by Jacek Sowiński's avatar Jacek Sowiński

Substitute only if it makes sense

parent 64ac9adb
...@@ -193,6 +193,8 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter): ...@@ -193,6 +193,8 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter):
r'(?P<after>{{.+?}})?' r'(?P<after>{{.+?}})?'
r'(?P<whitespace>\s)*' r'(?P<whitespace>\s)*'
r'(?P<end>.*)').format(placeholder) r'(?P<end>.*)').format(placeholder)
match = re.match(pattern, p_todo_str)
if match:
if repl == '': if repl == '':
p_todo_str = re.sub(pattern, match.group('start') + match.group('end'), p_todo_str) p_todo_str = re.sub(pattern, match.group('start') + match.group('end'), p_todo_str)
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment