diff options
-rw-r--r-- | markdown/inlinepatterns.py | 6 | ||||
-rw-r--r-- | markdown/postprocessors.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/markdown/inlinepatterns.py b/markdown/inlinepatterns.py index 218b416..f9d0610 100644 --- a/markdown/inlinepatterns.py +++ b/markdown/inlinepatterns.py @@ -140,7 +140,7 @@ REFERENCE_RE = NOIMG + BRK + r'\s?\[([^\]]*)\]' SHORT_REF_RE = NOIMG + r'\[([^\]]+)\]' # ![alt text][2] -IMAGE_REFERENCE_RE = r'\!' + BRK + '\s?\[([^\]]*)\]' +IMAGE_REFERENCE_RE = r'\!' + BRK + r'\s?\[([^\]]*)\]' # stand-alone * or _ NOT_STRONG_RE = r'((^| )(\*|_)( |$))' @@ -170,7 +170,7 @@ def dequote(string): return string -ATTR_RE = re.compile("\{@([^\}]*)=([^\}]*)}") # {@id=123} +ATTR_RE = re.compile(r"\{@([^\}]*)=([^\}]*)}") # {@id=123} def handleAttributes(text, parent): @@ -351,7 +351,7 @@ class HtmlPattern(Pattern): try: return self.markdown.serializer(value) except: - return '\%s' % value + return r'\%s' % value return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text) diff --git a/markdown/postprocessors.py b/markdown/postprocessors.py index 8b311b2..7b9aa0b 100644 --- a/markdown/postprocessors.py +++ b/markdown/postprocessors.py @@ -102,7 +102,7 @@ class AndSubstitutePostprocessor(Postprocessor): class UnescapePostprocessor(Postprocessor): """ Restore escaped chars """ - RE = re.compile('%s(\d+)%s' % (util.STX, util.ETX)) + RE = re.compile(r'%s(\d+)%s' % (util.STX, util.ETX)) def unescape(self, m): return util.int2str(int(m.group(1))) |