diff --git a/commonmark/src/Commonmark/Blocks.hs b/commonmark/src/Commonmark/Blocks.hs index 2d2ce22..f3a8ee1 100644 --- a/commonmark/src/Commonmark/Blocks.hs +++ b/commonmark/src/Commonmark/Blocks.hs @@ -70,6 +70,7 @@ import qualified Data.Text as T import qualified Data.Text.Read as TR import Data.Tree import Text.Parsec +import Data.List (sort) mkBlockParser :: (Monad m, IsBlock il bl) @@ -865,7 +866,7 @@ listItemSpec parseListMarker = BlockSpec let lidata = fromDyn (blockData cdata) (ListItemData (BulletList '*') 0 False False) - let allblanks = concat $ blockBlanks cdata : + let allblanks = reverse . sort . concat $ blockBlanks cdata : map (blockBlanks . rootLabel) (filter ((== "List") . blockType . blockSpec . rootLabel) children) diff --git a/commonmark/test/regression.md b/commonmark/test/regression.md index bda54ff..53ee8c0 100644 --- a/commonmark/test/regression.md +++ b/commonmark/test/regression.md @@ -270,3 +270,40 @@ Issue #130

my-link

```````````````````````````````` + + +Issue #133 +```````````````````````````````` example + * * xx + + * yy + + zz +. + +```````````````````````````````` + +```````````````````````````````` example + * * xx + * yy + + zz +. + +````````````````````````````````