commonmark-extensions 0.2.7 → 0.2.7.1
raw patch · 4 files changed
+23/−5 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- changelog.md +6/−0
- commonmark-extensions.cabal +1/−1
- src/Commonmark/Extensions/TaskList.hs +6/−4
- test/task_lists.md +10/−0
changelog.md view
@@ -1,5 +1,11 @@ # Changelog for commonmark-extensions +## 0.2.7.1++ * Task list extension: andle empty task list items correctly (#174,+ Chirag Dhamange). Prevent subsequent sibling task list items+ from being parsed as nested children.+ ## 0.2.7 * Math extension: bail out on pathological nestings.
commonmark-extensions.cabal view
@@ -1,5 +1,5 @@ name: commonmark-extensions-version: 0.2.7+version: 0.2.7.1 synopsis: Pure Haskell commonmark parser. description: This library provides some useful extensions to core commonmark
src/Commonmark/Extensions/TaskList.hs view
@@ -133,7 +133,8 @@ listItemType lidata -> addNodeToStack linode _ -> addNodeToStack listnode >> addNodeToStack linode- blankAfterMarker <- optionMaybe blankLine+ blankAfterMarker <- optionMaybe $+ try (blankLine <* lookAhead blankLine) <|> lookAhead blankLine pos' <- getPosition case blankAfterMarker of Just _ -> return ()@@ -153,10 +154,11 @@ (ListItemData (BulletList '*') False 0 False False) -- a marker followed by two blanks is just an empty item:- guard $ null (blockBlanks ndata) ||- not (null children) pos <- getPosition- gobbleSpaces (listItemIndent lidata) <|> 0 <$ lookAhead blankLine+ case blockBlanks ndata of+ _:_ | null children -> lookAhead blankLine+ _ -> () <$ gobbleSpaces (listItemIndent lidata)+ <|> lookAhead blankLine return $! (pos, node) , blockConstructor = fmap mconcat . renderChildren , blockFinalize = \(Node cdata children) parent -> do
test/task_lists.md view
@@ -91,3 +91,13 @@ </li> </ul> ````````````````````````````````++```````````````````````````````` example+- [ ]+- [ ] b+.+<ul class="task-list">+<li><input type="checkbox" disabled="" /></li>+<li><input type="checkbox" disabled="" />b</li>+</ul>+````````````````````````````````