From a96fee0591de5f3b628503591d1cad9d23d26140 Mon Sep 17 00:00:00 2001
From: Waylan Limberg
Date: Sun, 12 Jun 2016 21:12:10 -0400
Subject: Attribute lists are not permitted to contain newlines. Fixes #482.
---
markdown/extensions/attr_list.py | 2 +-
tests/extensions/attr_list.html | 4 +++-
tests/extensions/attr_list.txt | 2 ++
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 nested Value without key
No key or value
Weirdness
-More weirdness
\ No newline at end of file
+More weirdness
+Attr_lists do not contain newlines{ foo=bar
+key=value }
\ 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 }
--
cgit v1.2.3