summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-12-04 15:04:47 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-04 15:04:47 -0800
commitfac3953abf26d5b55fac9bdd6c74c0074660ab7a (patch)
tree2f4a73d5aee45602dde36abba984afe93770851e
parentae60e0196c5c12d358002cf3251dfebf07c66da6 (diff)
Markdown reader: Don't parse native div as table caption.
Closes #4119.
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs2
-rw-r--r--test/command/4119.md18
2 files changed, 19 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index a94c85c32..2d7c12e99 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1267,7 +1267,7 @@ tableCaption :: PandocMonad m => MarkdownParser m (F Inlines)
tableCaption = try $ do
guardEnabled Ext_table_captions
skipNonindentSpaces
- string ":" <|> string "Table:"
+ (string ":" <* notFollowedBy (string "::")) <|> string "Table:"
trimInlinesF <$> inlines1 <* blanklines
-- Parse a simple table with '---' header and one line per row.
diff --git a/test/command/4119.md b/test/command/4119.md
new file mode 100644
index 000000000..70f008643
--- /dev/null
+++ b/test/command/4119.md
@@ -0,0 +1,18 @@
+```
+pandoc -t native
+| col1 | col2 |
+| ---- | ---- |
+| 1 | 2 |
+
+::: {.notes} :::
+not a caption!
+::::::::::::::::
+^D
+[Table [] [AlignDefault,AlignDefault] [0.0,0.0]
+ [[Plain [Str "col1"]]
+ ,[Plain [Str "col2"]]]
+ [[[Plain [Str "1"]]
+ ,[Plain [Str "2"]]]]
+,Div ("",["notes"],[])
+ [Para [Str "not",Space,Str "a",Space,Str "caption!"]]]
+```