From d2af4f6acccc443f47326adf3e09dcb34a09ce4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Jena?= Date: Sat, 28 May 2016 13:13:58 +0200 Subject: [PATCH] Fixed regex pattern for attr_list extension The given regex pattern is matching "{: ... }" and also "{ ... }" (without the colon). The documentation is not mentioning this possibility and I had problems in inline elements where I use "{ ... }". I think the pattern "{:" is wisely chosen to prevent such a false detection. --- markdown/extensions/attr_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py index 683bdf831..f42b99585 100644 --- a/markdown/extensions/attr_list.py +++ b/markdown/extensions/attr_list.py @@ -72,7 +72,7 @@ def isheader(elem): class AttrListTreeprocessor(Treeprocessor): - BASE_RE = r'\{\:?([^\}]*)\}' + BASE_RE = r'\{\:([^\}]*)\}' HEADER_RE = re.compile(r'[ ]+%s[ ]*$' % BASE_RE) BLOCK_RE = re.compile(r'\n[ ]*%s[ ]*$' % BASE_RE) INLINE_RE = re.compile(r'^%s' % BASE_RE)