Skip to content

Fix tasklist parsing bugs#161

Merged
jgm merged 3 commits intojgm:masterfrom
notriddle:tasklist
Feb 14, 2025
Merged

Fix tasklist parsing bugs#161
jgm merged 3 commits intojgm:masterfrom
notriddle:tasklist

Conversation

@notriddle
Copy link
Copy Markdown
Contributor

@notriddle notriddle commented Feb 11, 2025

Some of these are the same fixes as pulldown-cmark/pulldown-cmark#1017 (except the indentation bug in commonmark-hs, and the lone marker bug in pulldown-cmark)

This is a bit non-obvious, but it makes some sense with the way
indentation works. Text on the same line as the task marker can't
start a block. It has to be paragraph text.
Comment on lines +142 to +146
addNodeToStack $
Node (defBlockData paraSpec){
blockStartPos = [pos']
, blockLines = [toks] }
[]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if there are no tokens after the marker, or only spaces? Do we get an empty Para? Should that be avoided?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be an empty para here. This code is part of a case statement that checks for that.

@jgm jgm merged commit 21de920 into jgm:master Feb 14, 2025
9 checks passed
@jgm
Copy link
Copy Markdown
Owner

jgm commented Feb 14, 2025

Thanks!

@notriddle notriddle deleted the tasklist branch February 14, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants