summaryrefslogtreecommitdiff
path: root/markdown/extensions
diff options
context:
space:
mode:
authorIsaac Muse <faceless.shop@gmail.com>2020-07-27 06:52:58 -0600
committerGitHub <noreply@github.com>2020-07-27 08:52:58 -0400
commit370e17b3923d7d8f4709652bc24b695271a0210d (patch)
tree0a6f1527bb65377cdf7c6e75b56da3faf15ab942 /markdown/extensions
parent611cf6d98297f8cb79c06d2c785c885b88a12cf0 (diff)
downloadpython-markdown-370e17b3923d7d8f4709652bc24b695271a0210d.tar.gz
Fix complex scenarios with definition, ordered, and unordered lists (#1007)
Fixes #918.
Diffstat (limited to 'markdown/extensions')
-rw-r--r--markdown/extensions/def_list.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/markdown/extensions/def_list.py b/markdown/extensions/def_list.py
index 5a6541a..0e8e452 100644
--- a/markdown/extensions/def_list.py
+++ b/markdown/extensions/def_list.py
@@ -87,11 +87,13 @@ class DefListProcessor(BlockProcessor):
class DefListIndentProcessor(ListIndentProcessor):
""" Process indented children of definition list items. """
- ITEM_TYPES = ['dd']
- LIST_TYPES = ['dl']
+ # Defintion lists need to be aware of all list types
+ ITEM_TYPES = ['dd', 'li']
+ LIST_TYPES = ['dl', 'ol', 'ul']
def create_item(self, parent, block):
- """ Create a new dd and parse the block with it as the parent. """
+ """ Create a new dd or li (depending on parent) and parse the block with it as the parent. """
+
dd = etree.SubElement(parent, 'dd')
self.parser.parseBlocks(dd, [block])