From e8638b168b407c5b46efb58feb1b3c5ae213e458 Mon Sep 17 00:00:00 2001 From: ryneeverett Date: Sun, 27 Oct 2013 01:00:08 -0400 Subject: tables and attr_list compatibility --- markdown/extensions/attr_list.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py index fabc925..8b65f56 100644 --- a/markdown/extensions/attr_list.py +++ b/markdown/extensions/attr_list.py @@ -121,6 +121,8 @@ class AttrListTreeprocessor(Treeprocessor): elif elem.text: # no children. Get from text. m = RE.search(elem.text) + if not m and elem.tag == 'td': + m = re.search(self.BASE_RE, elem.text) if m: self.assign_attrs(elem, m.group(1)) elem.text = elem.text[:m.start()] -- cgit v1.2.3 From 3e63253c8b95f01b803a8c945a8666d4df4cb27a Mon Sep 17 00:00:00 2001 From: ryneeverett Date: Sat, 11 Jan 2014 13:55:18 -0500 Subject: tables_and_attr_list test --- tests/extensions/extra/tables_and_attr_list.html | 18 ++++++++++++++++++ tests/extensions/extra/tables_and_attr_list.txt | 4 ++++ tests/extensions/extra/test.cfg | 3 +++ 3 files changed, 25 insertions(+) create mode 100644 tests/extensions/extra/tables_and_attr_list.html create mode 100644 tests/extensions/extra/tables_and_attr_list.txt diff --git a/tests/extensions/extra/tables_and_attr_list.html b/tests/extensions/extra/tables_and_attr_list.html new file mode 100644 index 0000000..7d2451b --- /dev/null +++ b/tests/extensions/extra/tables_and_attr_list.html @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + +
First HeaderSecond Header
Content CellContent Cell
Content CellContent Cell
diff --git a/tests/extensions/extra/tables_and_attr_list.txt b/tests/extensions/extra/tables_and_attr_list.txt new file mode 100644 index 0000000..517eeeb --- /dev/null +++ b/tests/extensions/extra/tables_and_attr_list.txt @@ -0,0 +1,4 @@ +First Header | Second Header +------------------------------------------------------ | ------------- +Content Cell{: class="foo bar" title="Some title!" } | Content Cell +Content Cell | Content Cell{: class="foo bar" title="Some title!" } diff --git a/tests/extensions/extra/test.cfg b/tests/extensions/extra/test.cfg index 74893f0..52d48f0 100644 --- a/tests/extensions/extra/test.cfg +++ b/tests/extensions/extra/test.cfg @@ -15,3 +15,6 @@ extensions=footnotes [tables] extensions=tables + +[tables_and_attr_list] +extensions=tables,attr_list -- cgit v1.2.3