Commit f2779f19 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Replace bracketed variant of a placeholder.

This will make sure that %[T] in the format string gets replaced with
the replacing text.
parent 4cd1fbbc
...@@ -229,7 +229,7 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter): ...@@ -229,7 +229,7 @@ class PrettyPrinterFormatFilter(PrettyPrinterFilter):
return start + before + '%' + placeholder + after + whitespace + end return start + before + '%' + placeholder + after + whitespace + end
p_todo_str = re.sub(pattern, strip_braces, p_todo_str) p_todo_str = re.sub(pattern, strip_braces, p_todo_str)
p_todo_str = re.sub(r'%{}'.format(placeholder), repl, p_todo_str) p_todo_str = re.sub(r'%({ph}|\[{ph}\])'.format(ph=placeholder), repl, p_todo_str)
p_todo_str = p_todo_str.rstrip() p_todo_str = p_todo_str.rstrip()
if placeholder == 'S': if placeholder == 'S':
......
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