From 0216a2f5047dd78ecc3c26659281a8b629a83de0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 10 Sep 2021 09:50:05 -0700 Subject: Org reader: don't parse a list as first item in a list item. Closes #7557. --- src/Text/Pandoc/Readers/Org/Blocks.hs | 5 ++++- test/command/7557.md | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/command/7557.md diff --git a/src/Text/Pandoc/Readers/Org/Blocks.hs b/src/Text/Pandoc/Readers/Org/Blocks.hs index f18d2f9a7..2ec97d903 100644 --- a/src/Text/Pandoc/Readers/Org/Blocks.hs +++ b/src/Text/Pandoc/Readers/Org/Blocks.hs @@ -889,7 +889,10 @@ listItem parseIndentedMarker = try . withContext ListItemState $ do firstLine <- anyLineNewline blank <- option "" ("\n" <$ blankline) rest <- T.concat <$> many (listContinuation markerLength) - contents <- parseFromString blocks $ firstLine <> blank <> rest + contents <- parseFromString (do initial <- paraOrPlain <|> pure mempty + subsequent <- blocks + return $ initial <> subsequent) + (firstLine <> blank <> rest) return (maybe id (prependInlines . checkboxToInlines) box <$> contents) -- | Prepend inlines to blocks, adding them to the first paragraph or diff --git a/test/command/7557.md b/test/command/7557.md new file mode 100644 index 000000000..a62a3f14b --- /dev/null +++ b/test/command/7557.md @@ -0,0 +1,7 @@ +``` +% pandoc -f org -t native +- 11. and 12. 09. meeting +- ^D +[BulletList + [[Plain [Str "11.",Space,Str "and",Space,Str "12.",Space,Str "09.",Space,Str "meeting"]]]] +``` -- cgit v1.2.3