diff options
author | facelessuser <faceless.shop@gmail.com> | 2017-12-20 17:54:23 -0700 |
---|---|---|
committer | facelessuser <faceless.shop@gmail.com> | 2017-12-20 17:54:23 -0700 |
commit | e6fd29f3b49be58c94d8627e3aaa5b97b009c053 (patch) | |
tree | afe7f7cfa9c56c156674a02623f93539abca8db0 /markdown/util.py | |
parent | 1edbb9dcb998966e43e02f5e345fe3d08c0307dc (diff) | |
download | python-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/util.py')
-rw-r--r-- | markdown/util.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/markdown/util.py b/markdown/util.py index b37e5ae..9e87019 100644 --- a/markdown/util.py +++ b/markdown/util.py @@ -27,12 +27,12 @@ Constants you might want to modify BLOCK_LEVEL_ELEMENTS = re.compile( - "^(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul" - "|script|noscript|form|fieldset|iframe|math" - "|hr|hr/|style|li|dt|dd|thead|tbody" - "|tr|th|td|section|footer|header|group|figure" - "|figcaption|aside|article|canvas|output" - "|progress|video|nav|main)$", + r"^(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul" + r"|script|noscript|form|fieldset|iframe|math" + r"|hr|hr/|style|li|dt|dd|thead|tbody" + r"|tr|th|td|section|footer|header|group|figure" + r"|figcaption|aside|article|canvas|output" + r"|progress|video|nav|main)$", re.IGNORECASE ) # Placeholders |