diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py index de3994426..ccc5b2fd7 100644 --- a/markdown/extensions/attr_list.py +++ b/markdown/extensions/attr_list.py @@ -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): diff --git a/tests/extensions/attr_list.html b/tests/extensions/attr_list.html index 93a862f1a..29e400d56 100644 --- a/tests/extensions/attr_list.html +++ b/tests/extensions/attr_list.html @@ -64,5 +64,6 @@
No key or value
Weirdness
More weirdness
+This should not cause a crash
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 603b611ec..98f1cc7be 100644 --- a/tests/extensions/attr_list.txt +++ b/tests/extensions/attr_list.txt @@ -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 }