From 4fc04c6477914e26d8164b65238435c891f00108 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Mon, 13 Jun 2016 18:19:31 +0300 Subject: =?UTF-8?q?Fix=20another=20issue=20with=20attribute=20lists=20(wit?= =?UTF-8?q?h=20multiple=20=E2=80=98=3D=E2=80=99=20signs)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- markdown/extensions/attr_list.py | 6 +++--- tests/extensions/attr_list.html | 1 + tests/extensions/attr_list.txt | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py index de39944..ccc5b2f 100644 --- a/markdown/extensions/attr_list.py +++ b/markdown/extensions/attr_list.py @@ -32,17 +32,17 @@ except AttributeError: # pragma: no cover 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 93a862f..29e400d 100644 --- a/tests/extensions/attr_list.html +++ b/tests/extensions/attr_list.html @@ -64,5 +64,6 @@ And a nested 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 603b611..98f1cc7 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 } -- cgit v1.2.3