git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader: Don't parse native div as table caption.

Closes #4119.

commitfac3953abf26d5b55fac9bdd6c74c0074660ab7a authorJohn MacFarlane <jgm@berkeley.edu> dateMon 4 Dec 2017, 15:04 (9 years ago) parentae60e01
2 files changed+19−1
src/Text/Pandoc/Readers/Markdown.hs+1−1 test/command/4119.md+18
src/Text/Pandoc/Readers/Markdown.hs+1−1
@@ -1267,7 +1267,7 @@ tableCaption :: PandocMonad m => MarkdownParser m (F Inlines)
12671267tableCaption = try $ do
12681268 guardEnabled Ext_table_captions
12691269 skipNonindentSpaces
1270− string ":" <|> string "Table:"
1270+ (string ":" <* notFollowedBy (string "::")) <|> string "Table:"
12711271 trimInlinesF <$> inlines1 <* blanklines
12721272
12731273-- Parse a simple table with '---' header and one line per row.
test/command/4119.mdnew file+18
@@ -0,0 +1,18 @@
1+```
2+pandoc -t native
3+| col1 | col2 |
4+| ---- | ---- |
5+| 1 | 2 |
6+
7+::: {.notes} :::
8+not a caption!
9+::::::::::::::::
10+^D
11+[Table [] [AlignDefault,AlignDefault] [0.0,0.0]
12+ [[Plain [Str "col1"]]
13+ ,[Plain [Str "col2"]]]
14+ [[[Plain [Str "1"]]
15+ ,[Plain [Str "2"]]]]
16+,Div ("",["notes"],[])
17+ [Para [Str "not",Space,Str "a",Space,Str "caption!"]]]
18+```