summaryrefslogtreecommitdiff
path: root/markdown/inlinepatterns.py
diff options
context:
space:
mode:
authorfacelessuser <faceless.shop@gmail.com>2017-12-20 17:54:23 -0700
committerfacelessuser <faceless.shop@gmail.com>2017-12-20 17:54:23 -0700
commite6fd29f3b49be58c94d8627e3aaa5b97b009c053 (patch)
treeafe7f7cfa9c56c156674a02623f93539abca8db0 /markdown/inlinepatterns.py
parent1edbb9dcb998966e43e02f5e345fe3d08c0307dc (diff)
downloadpython-markdown-regex-fixes.tar.gz
Make sure regex patterns are raw stringsregex-fixes
Python 3.6 is starting to reject invalid escapes. Regular expression patterns should be raw strings to avoid having regex escapes being mistaken for invalid string escapes. Ref #611.
Diffstat (limited to 'markdown/inlinepatterns.py')
-rw-r--r--markdown/inlinepatterns.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/markdown/inlinepatterns.py b/markdown/inlinepatterns.py
index 2f00b3d..bfdffb3 100644
--- a/markdown/inlinepatterns.py
+++ b/markdown/inlinepatterns.py
@@ -201,7 +201,7 @@ class Pattern(object):
"""
self.pattern = pattern
- self.compiled_re = re.compile("^(.*?)%s(.*)$" % pattern,
+ self.compiled_re = re.compile(r"^(.*?)%s(.*)$" % pattern,
re.DOTALL | re.UNICODE)
# Api for Markdown to pass safe_mode into instance