From f3cfeba3efc1a94b02040e5b206123f58d08313a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 20 Apr 2022 13:34:41 -0700 Subject: [PATCH] Don't parse inline notes with blank lines inside. Previously we parsed them but discarded part of the content. Closes #8028. --- src/Text/Pandoc/Readers/Markdown.hs | 3 ++- test/command/8028.md | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/command/8028.md diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 63a69774b..227d6e791 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -209,6 +209,7 @@ inlinesInBalancedBrackets = (() <$ (escapedChar <|> code <|> math <|> + endline <|> rawHtmlInline <|> rawLaTeXInline') >> go openBrackets) <|> @@ -217,7 +218,7 @@ inlinesInBalancedBrackets = <|> (char '[' >> go (openBrackets + 1)) <|> - (anyChar >> go openBrackets) + (satisfy (/= '\n') >> go openBrackets) -- -- document structure diff --git a/test/command/8028.md b/test/command/8028.md new file mode 100644 index 000000000..325e93b64 --- /dev/null +++ b/test/command/8028.md @@ -0,0 +1,10 @@ +``` +% pandoc +foo^[a note + +with multiple paragraphs] +^D +

foo^[a note

+

with multiple paragraphs]

+ +```