Skip to content

Commit a96fee0

Browse files
committed
Attribute lists are not permitted to contain newlines. Fixes #482.
1 parent f3f7687 commit a96fee0

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

markdown/extensions/attr_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def isheader(elem):
7272

7373
class AttrListTreeprocessor(Treeprocessor):
7474

75-
BASE_RE = r'\{\:?([^\}]*)\}'
75+
BASE_RE = r'\{\:?([^\}\n]*)\}'
7676
HEADER_RE = re.compile(r'[ ]+%s[ ]*$' % BASE_RE)
7777
BLOCK_RE = re.compile(r'\n[ ]*%s[ ]*$' % BASE_RE)
7878
INLINE_RE = re.compile(r'^%s' % BASE_RE)

tests/extensions/attr_list.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,6 @@ <h1>Bad attributes</h1>
6363
<p>Value without <em>key</em></p>
6464
<p>No <em>key or value</em></p>
6565
<p><em>Weirdness</em></p>
66-
<p><em>More weirdness</em></p>
66+
<p><em>More weirdness</em></p>
67+
<p>Attr_lists do not contain <em>newlines</em>{ foo=bar
68+
key=value }</p>

tests/extensions/attr_list.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,5 @@ No *key or value*{ = }
8888

8989
*More weirdness*{ === }
9090

91+
Attr_lists do not contain *newlines*{ foo=bar
92+
key=value }

0 commit comments

Comments
 (0)