Skip to content

Commit e7a2741

Browse files
committed
apply review feedback
1 parent 43a5993 commit e7a2741

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

myst_parser/mdit_to_docutils/base.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,10 +534,19 @@ def render_list_item(self, token: SyntaxTreeNode) -> None:
534534
# lists mark them hidden, but we render them regardless).
535535
# Tasklist items by definition start with `[ ]`/`[x]` text
536536
# content, so a paragraph is always the first block child.
537-
assert isinstance(item_node.children[0], nodes.paragraph)
538-
item_node.children[0].insert(
539-
0, nodes.raw("", checkbox_html, format="html")
540-
)
537+
if item_node.children and isinstance(
538+
item_node.children[0], nodes.paragraph
539+
):
540+
item_node.children[0].insert(
541+
0, nodes.raw("", checkbox_html, format="html")
542+
)
543+
else:
544+
self.create_warning(
545+
"Tasklist item has no leading paragraph for checkbox",
546+
MystWarnings.RENDER_METHOD,
547+
line=token_line(token, 0),
548+
append_to=self.current_node,
549+
)
541550
else:
542551
self.render_children(token)
543552

myst_parser/parsers/mdit.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def create_md_parser(
5050
tasklists_editable=config.enable_checkboxes,
5151
)
5252
md.use(wordcount_plugin, per_minute=config.words_per_minute)
53-
md.options.update({"linkify": True, "myst_config": config})
5453
return md
5554

5655
md = (

0 commit comments

Comments
 (0)