Skip to content

Commit

Permalink
Fix parsing of indented unordered lists to match GFM
Browse files Browse the repository at this point in the history
Fixes issue dillonkearns#107
  • Loading branch information
Viir committed Sep 22, 2021
1 parent 1b0b3dc commit 1ab7a00
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/Markdown/UnorderedList.elm
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@ parser previousWasBody =
unorderedListMarkerParser : Parser UnorderedListMarker
unorderedListMarkerParser =
oneOf
[ succeed Minus
|. Extra.upTo 3 Whitespace.space
|. Advanced.symbol (Advanced.Token "-" (Parser.ExpectingSymbol "-"))
, succeed Plus
|. Advanced.symbol (Advanced.Token "+" (Parser.ExpectingSymbol "+"))
, succeed Asterisk
|. Advanced.symbol (Advanced.Token "*" (Parser.ExpectingSymbol "*"))
[ backtrackable
(succeed Minus
|. Extra.upTo 3 Whitespace.space
|. Advanced.symbol (Advanced.Token "-" (Parser.ExpectingSymbol "-"))
)
, backtrackable
(succeed Plus
|. Extra.upTo 3 Whitespace.space
|. Advanced.symbol (Advanced.Token "+" (Parser.ExpectingSymbol "+"))
)
, backtrackable
(succeed Asterisk
|. Extra.upTo 3 Whitespace.space
|. Advanced.symbol (Advanced.Token "*" (Parser.ExpectingSymbol "*"))
)
]


Expand Down

0 comments on commit 1ab7a00

Please sign in to comment.