Skip to content

Commit

Permalink
Fix SyntaxWarnings in highlight.py
Browse files Browse the repository at this point in the history
Without raw strings, we'd get SyntaxWarnings due to invalid escape
sequences.
  • Loading branch information
hannesbraun committed Sep 20, 2024
1 parent 6a63c29 commit 45f83ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/solutions/templatetags/highlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def colorize_table(value,arg=None):
except ClassNotFound:
return mark_safe("<pre>%s</pre>" % escape(value))

rx_diff_pm = re.compile('^(?P<first_line>\d*</pre></div></td><td class="code"><div class="highlight"><pre>)?(?P<line>(<span class=".*?">)?(?P<plusminus>\+|-).*?)(?P<endtag></pre>)?$')
rx_diff_questionmark = re.compile('(?P<line>(<span class="\w*">)?\?.*$)')
rx_tag = re.compile('^(<[^<]*>)+')
rx_char = re.compile('^(&\w+;|.)')
rx_diff_pm = re.compile(r'^(?P<first_line>\d*</pre></div></td><td class="code"><div class="highlight"><pre>)?(?P<line>(<span class=".*?">)?(?P<plusminus>\+|-).*?)(?P<endtag></pre>)?$')
rx_diff_questionmark = re.compile(r'(?P<line>(<span class="\w*">)?\?.*$)')
rx_tag = re.compile(r'^(<[^<]*>)+')
rx_char = re.compile(r'^(&\w+;|.)')
@register.filter
def highlight_diff(value):
"enclose highlighted lines beginning with an +-? in a span"
Expand Down

0 comments on commit 45f83ca

Please sign in to comment.