Skip to content

Commit

Permalink
Attribute lists are not permitted to contain newlines. Fixes Python-M…
Browse files Browse the repository at this point in the history
  • Loading branch information
waylan committed Jun 13, 2016
1 parent f3f7687 commit a96fee0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion markdown/extensions/attr_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion tests/extensions/attr_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,6 @@ <h1>Bad attributes</h1>
<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>
<p><em>More weirdness</em></p>
<p>Attr_lists do not contain <em>newlines</em>{ foo=bar
key=value }</p>
2 changes: 2 additions & 0 deletions tests/extensions/attr_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,5 @@ No *key or value*{ = }

*More weirdness*{ === }

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

0 comments on commit a96fee0

Please sign in to comment.