diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-10-07 12:37:08 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-10-07 12:37:08 -0700 |
commit | 145710c4c3951b095206c59256ac0294b23ca76d (patch) | |
tree | 579188d8cdd9e7515c9ecba069ecd1e3ef84c9f1 | |
parent | b806bff5b44abff96a1400f23448f986d238bff1 (diff) | |
download | pandoc-145710c4c3951b095206c59256ac0294b23ca76d.tar.gz |
RST reader: don't allow single-dash separator in headerless table.
Closes #4382.
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 4 | ||||
-rw-r--r-- | test/command/4382.md | 10 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 1c9a06601..1938ca171 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -1269,7 +1269,9 @@ simpleTableHeader headless = try $ do rawContent <- if headless then return "" else simpleTableSep '=' >> anyLine - dashes <- simpleDashedLines '=' <|> simpleDashedLines '-' + dashes <- if headless + then simpleDashedLines '=' + else simpleDashedLines '=' <|> simpleDashedLines '-' newline let lines' = map snd dashes let indices = scanl (+) 0 lines' diff --git a/test/command/4382.md b/test/command/4382.md new file mode 100644 index 000000000..4a840489f --- /dev/null +++ b/test/command/4382.md @@ -0,0 +1,10 @@ +``` +% pandoc -f rst -t native +- + +===== +^D +[BulletList + [[]] +,HorizontalRule] +``` |