aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authord9pouces <github@19pouces.net>2017-07-25 08:30:05 +0200
committerWaylan Limberg <waylan.limberg@icloud.com>2017-07-25 08:20:21 -0400
commita1c200899c942a8e37880c2b3c59e02770ade7ac (patch)
treeca66fc774e180f030c26d207902891bfe1559340
parentb7db1ec1d1e940dec46e24639bbd8c34d6d853d9 (diff)
downloadmarkdown-a1c200899c942a8e37880c2b3c59e02770ade7ac.tar.gz
markdown-a1c200899c942a8e37880c2b3c59e02770ade7ac.tar.bz2
markdown-a1c200899c942a8e37880c2b3c59e02770ade7ac.zip
fix DeprecationWarning: invalid escape sequence
-rw-r--r--markdown/inlinepatterns.py6
-rw-r--r--markdown/postprocessors.py2
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)))