From 2e9beaecae75ec01899afa846f775ba7b3105ff8 Mon Sep 17 00:00:00 2001 From: Isaac Muse Date: Tue, 2 Jan 2018 11:10:19 -0700 Subject: Make sure regex patterns are raw strings (#614) 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. Fixes #611. --- markdown/util.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'markdown/util.py') 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 -- cgit v1.2.3