aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2016-06-12 21:12:10 -0400
committerWaylan Limberg <waylan.limberg@icloud.com>2016-06-12 21:12:58 -0400
commita96fee0591de5f3b628503591d1cad9d23d26140 (patch)
tree4051895137aa99dd6a965f65f14a350e612c41da
parentf3f768770ea62ff567c229b342ca0dca79b9da3c (diff)
downloadmarkdown-a96fee0591de5f3b628503591d1cad9d23d26140.tar.gz
markdown-a96fee0591de5f3b628503591d1cad9d23d26140.tar.bz2
markdown-a96fee0591de5f3b628503591d1cad9d23d26140.zip
Attribute lists are not permitted to contain newlines. Fixes #482.
-rw-r--r--markdown/extensions/attr_list.py2
-rw-r--r--tests/extensions/attr_list.html4
-rw-r--r--tests/extensions/attr_list.txt2
3 files changed, 6 insertions, 2 deletions
diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py
index 683bdf8..de39944 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'\{\:?([^\}\n]*)\}'
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)
diff --git a/tests/extensions/attr_list.html b/tests/extensions/attr_list.html
index 2a36dbc..93a862f 100644
--- a/tests/extensions/attr_list.html
+++ b/tests/extensions/attr_list.html
@@ -63,4 +63,6 @@ And a <strong class="nest">nested <a class="linky2" href="http://example.com" ti
<p>Value without <em>key</em></p>
<p>No <em>key or value</em></p>
<p><em>Weirdness</em></p>
-<p><em>More weirdness</em></p> \ No newline at end of file
+<p><em>More weirdness</em></p>
+<p>Attr_lists do not contain <em>newlines</em>{ foo=bar
+key=value }</p> \ No newline at end of file
diff --git a/tests/extensions/attr_list.txt b/tests/extensions/attr_list.txt
index c2adbf4..603b611 100644
--- a/tests/extensions/attr_list.txt
+++ b/tests/extensions/attr_list.txt
@@ -88,3 +88,5 @@ No *key or value*{ = }
*More weirdness*{ === }
+Attr_lists do not contain *newlines*{ foo=bar
+key=value }