Skip to content

Commit

Permalink
Fix another issue with attribute lists (with multiple ‘=’ signs)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitya57 committed Jun 13, 2016
1 parent a96fee0 commit 4fc04c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions markdown/extensions/attr_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@


def _handle_double_quote(s, t):
k, v = t.split('=')
k, v = t.split('=', 1)
return k, v.strip('"')


def _handle_single_quote(s, t):
k, v = t.split('=')
k, v = t.split('=', 1)
return k, v.strip("'")


def _handle_key_value(s, t):
return t.split('=')
return t.split('=', 1)


def _handle_word(s, t):
Expand Down
1 change: 1 addition & 0 deletions tests/extensions/attr_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ <h1>Bad attributes</h1>
<p>No <em>key or value</em></p>
<p><em>Weirdness</em></p>
<p><em>More weirdness</em></p>
<p>This should not cause a <em foo="a=b">crash</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,5 +88,7 @@ No *key or value*{ = }

*More weirdness*{ === }

This should not cause a *crash*{ foo=a=b }

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

0 comments on commit 4fc04c6

Please sign in to comment.