diff --git a/commonmark-extensions/src/Commonmark/Extensions/TaskList.hs b/commonmark-extensions/src/Commonmark/Extensions/TaskList.hs index c011cee..4680b8f 100644 --- a/commonmark-extensions/src/Commonmark/Extensions/TaskList.hs +++ b/commonmark-extensions/src/Commonmark/Extensions/TaskList.hs @@ -133,6 +133,17 @@ taskListItemBlockSpec = BlockSpec listItemType lidata -> addNodeToStack linode _ -> addNodeToStack listnode >> addNodeToStack linode + blankAfterMarker <- optionMaybe blankLine + pos' <- getPosition + case blankAfterMarker of + Just _ -> return () + Nothing -> do + toks <- many (satisfyTok (not . hasType LineEnd)) + addNodeToStack $ + Node (defBlockData paraSpec){ + blockStartPos = [pos'] + , blockLines = [toks] } + [] return BlockStartMatch , blockCanContain = const True , blockContainsLines = False @@ -184,11 +195,11 @@ itemStart = do pos <- getPosition ty <- bulletListMarker aftercol <- sourceColumn <$> getPosition - checked <- parseCheckbox lookAhead whitespace numspaces <- try (gobbleUpToSpaces 4 <* notFollowedBy whitespace) <|> gobbleSpaces 1 - <|> 1 <$ lookAhead lineEnd + checked <- parseCheckbox + lookAhead whitespace return $! (pos, ListItemData{ listItemType = ty , listItemChecked = checked diff --git a/commonmark-extensions/test/task_lists.md b/commonmark-extensions/test/task_lists.md index d3b5195..b541c9b 100644 --- a/commonmark-extensions/test/task_lists.md +++ b/commonmark-extensions/test/task_lists.md @@ -28,3 +28,66 @@ As in GitHub-flavored Markdown. ```````````````````````````````` + +```````````````````````````````` example +- [x]unreal +. +
not indented enough
+```````````````````````````````` + + +```````````````````````````````` example +- [x] * some text +- [ ] > some text +- [x] + * some text +- [ ] + > some text +. ++some text
+
* some text
some text
+some text
+