aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--markdown/extensions/attr_list.py4
-rw-r--r--tests/extensions/attr_list.html11
-rw-r--r--tests/extensions/attr_list.txt11
-rw-r--r--tests/extensions/test.cfg2
4 files changed, 24 insertions, 4 deletions
diff --git a/markdown/extensions/attr_list.py b/markdown/extensions/attr_list.py
index 3d7fc46..2175691 100644
--- a/markdown/extensions/attr_list.py
+++ b/markdown/extensions/attr_list.py
@@ -80,8 +80,8 @@ class AttrListTreeprocessor(Treeprocessor):
if isBlockLevel(elem.tag):
# Block level: check for attrs on last line of text
RE = self.BLOCK_RE
- if isheader(elem):
- # header: check for attrs at end of line
+ if isheader(elem) or elem.tag == 'dt':
+ # header or def-term: check for attrs at end of line
RE = self.HEADER_RE
if len(elem) and elem.tag == 'li':
# special case list items. children may include a ul or ol.
diff --git a/tests/extensions/attr_list.html b/tests/extensions/attr_list.html
index ad965fd..b76f73b 100644
--- a/tests/extensions/attr_list.html
+++ b/tests/extensions/attr_list.html
@@ -48,4 +48,13 @@ And a <strong class="nest">nested <a class="linky2" href="http://example.com" ti
</ol>
</li>
<li>Item5</li>
-</ol> \ No newline at end of file
+</ol>
+<h1 class="block">Definition <em>lists</em></h1>
+<dl>
+<dt class="term">DT1</dt>
+<dt class="term">DT2</dt>
+<dd class="def">Some dd</dd>
+<dd><em class="inline">dd</em></dd>
+<dt><em class="inline">DT3</em></dt>
+<dd>Some dd</dd>
+</dl> \ No newline at end of file
diff --git a/tests/extensions/attr_list.txt b/tests/extensions/attr_list.txt
index a841b87..da108e6 100644
--- a/tests/extensions/attr_list.txt
+++ b/tests/extensions/attr_list.txt
@@ -65,3 +65,14 @@ Also a codespan: `{: .someclass}`{: .foo}.
1. Item4-1
5. Item5
+# Definition *lists* {.block}
+
+DT1 {.term}
+DT2 {.term}
+: Some dd
+ {.def}
+: *dd*{.inline}
+
+*DT3*{.inline}
+: Some dd
+
diff --git a/tests/extensions/test.cfg b/tests/extensions/test.cfg
index 7f082cf..42145c1 100644
--- a/tests/extensions/test.cfg
+++ b/tests/extensions/test.cfg
@@ -1,5 +1,5 @@
[attr_list]
-extensions=attr_list
+extensions=attr_list,def_list
[codehilite]
extensions=codehilite