diff options
| author | John MacFarlane <[email protected]> | 2024-09-21 19:35:12 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2024-09-21 19:35:12 -0700 |
| commit | 46ebe25b69d59a670d3b3e2ff61d93c80bfad7f3 (patch) | |
| tree | f92b7f693bb60415007b99bce6594c0d5b4bcfea | |
| parent | 98e77e02f6436e4b74a164762d0f3149ae7ecefa (diff) | |
Dokuwiki reader: be more forgiving about misaligned lists...
like dokuwiki itself. Closes #8863.
| -rw-r--r-- | src/Text/Pandoc/Readers/DokuWiki.hs | 4 | ||||
| -rw-r--r-- | test/command/8863.md | 11 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/DokuWiki.hs b/src/Text/Pandoc/Readers/DokuWiki.hs index c7b7f9143..78c29c482 100644 --- a/src/Text/Pandoc/Readers/DokuWiki.hs +++ b/src/Text/Pandoc/Readers/DokuWiki.hs @@ -444,7 +444,9 @@ parseList prefix marker = many1 ((<>) <$> item <*> fmap mconcat (many continuation)) where continuation = try $ list (" " <> prefix) - item = try $ textStr prefix *> char marker *> char ' ' *> + item = try $ textStr prefix *> + optional (char ' ') *> -- see #8863 + char marker *> char ' ' *> (mconcat <$> many1 itemContents <* eol) itemContents = (B.plain . mconcat <$> many1 inline') <|> blockCode diff --git a/test/command/8863.md b/test/command/8863.md new file mode 100644 index 000000000..03691e3c8 --- /dev/null +++ b/test/command/8863.md @@ -0,0 +1,11 @@ +``` +% pandoc -f dokuwiki -t native + * item 1 + * item 1.1 +^D +[ BulletList + [ [ Plain [ Str "item" , Space , Str "1" ] ] + , [ Plain [ Str "item" , Space , Str "1.1" ] ] + ] +] +``` |
