diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-01-20 14:43:33 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-01-20 14:44:08 -0800 |
commit | ac08a887cf83ce3d08b56447a1dbfc8aec4cd1a3 (patch) | |
tree | 9fbc7f778199a9f37b1252cd6f280bc90a96a73a | |
parent | e69ca9a070c84caeb8056dd28f03c2586718ca33 (diff) | |
download | pandoc-ac08a887cf83ce3d08b56447a1dbfc8aec4cd1a3.tar.gz |
Markdown reader: Fix parsing bug with nested fenced divs.
Closes #4281.
Previously we allowed "nonindent spaces" before the
opening and closing `:::`, but this interfered with
list parsing, so now we require the fences to be
flush with the margin of the containing block.
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 2 | ||||
-rw-r--r-- | test/command/4281.md | 18 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 92e9098bd..14cf73de4 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1971,7 +1971,6 @@ divHtml = try $ do divFenced :: PandocMonad m => MarkdownParser m (F Blocks) divFenced = try $ do guardEnabled Ext_fenced_divs - nonindentSpaces string ":::" skipMany (char ':') skipMany spaceChar @@ -1986,7 +1985,6 @@ divFenced = try $ do divFenceEnd :: PandocMonad m => MarkdownParser m () divFenceEnd = try $ do - nonindentSpaces string ":::" skipMany (char ':') blanklines diff --git a/test/command/4281.md b/test/command/4281.md new file mode 100644 index 000000000..9806e8178 --- /dev/null +++ b/test/command/4281.md @@ -0,0 +1,18 @@ +``` +% pandoc -t native +:::: {.a} +- ::: {.b} + text + ::: + ::: {.c} + text + ::: +:::: +^D +[Div ("",["a"],[]) + [BulletList + [[Div ("",["b"],[]) + [Para [Str "text"]] + ,Div ("",["c"],[]) + [Para [Str "text"]]]]]] +``` |