diff options
-rw-r--r-- | markdown/extensions/attr_list.py | 6 | ||||
-rw-r--r-- | tests/extensions/attr_list.html | 3 | ||||
-rw-r--r-- | tests/extensions/attr_list.txt | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py index de39944..8735538 100644 --- a/markdown/extensions/attr_list.py +++ b/markdown/extensions/attr_list.py @@ -53,9 +53,9 @@ def _handle_word(s, t): return t, t _scanner = Scanner([ - (r'[^ ]+=".*?"', _handle_double_quote), - (r"[^ ]+='.*?'", _handle_single_quote), - (r'[^ ]+=[^ =]+', _handle_key_value), + (r'[^ =]+=".*?"', _handle_double_quote), + (r"[^ =]+='.*?'", _handle_single_quote), + (r'[^ =]+=[^ =]+', _handle_key_value), (r'[^ =]+', _handle_word), (r' ', None) ]) diff --git a/tests/extensions/attr_list.html b/tests/extensions/attr_list.html index 93a862f..6eafd3e 100644 --- a/tests/extensions/attr_list.html +++ b/tests/extensions/attr_list.html @@ -65,4 +65,5 @@ And a <strong class="nest">nested <a class="linky2" href="http://example.com" ti <p><em>Weirdness</em></p> <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 +key=value }</p> +<p>Extra <em foo="bar">equals signs</em></p>
\ No newline at end of file diff --git a/tests/extensions/attr_list.txt b/tests/extensions/attr_list.txt index 603b611..54ebcb6 100644 --- a/tests/extensions/attr_list.txt +++ b/tests/extensions/attr_list.txt @@ -90,3 +90,5 @@ No *key or value*{ = } Attr_lists do not contain *newlines*{ foo=bar key=value } + +Extra *equals signs*{ foo=bar=baz } |