Commit 37382021 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Do a proper replacement of whitespace before URL

In case a URL starts at the start of the line, don't insert an additional space.

Reported by @mruwek.
parent a66b9305
...@@ -83,7 +83,7 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter): ...@@ -83,7 +83,7 @@ class PrettyPrinterColorFilter(PrettyPrinterFilter):
# add link_color to any valid URL specified outside of the tag. # add link_color to any valid URL specified outside of the tag.
p_todo_str = re.sub(r'(^|\s)(\w+:){1}(//\S+)', p_todo_str = re.sub(r'(^|\s)(\w+:){1}(//\S+)',
' ' + link_color + r'\2\3' + color, r'\1' + link_color + r'\2\3' + color,
p_todo_str) p_todo_str)
p_todo_str += NEUTRAL_COLOR p_todo_str += NEUTRAL_COLOR
......
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