diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-12-14 12:03:14 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-12-14 12:03:14 -0800 |
commit | 7888f49342d205973004c8d3e642b0d5d2f92e1a (patch) | |
tree | a5d5647ff69ec4fe0c7d10996366af33b3a8dfbd /src | |
parent | 17b667ec260547201e422de7da56816d97d73c3b (diff) | |
download | pandoc-7888f49342d205973004c8d3e642b0d5d2f92e1a.tar.gz |
Markdown reader: be pickier about table captions.
A caption starts with a `:` which can't be followed
by punctuation. Otherwise we can falsely interpret
the start of a fenced div, or even a table header line
like `:--:|:--:`, as a caption.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 3b6dcbcb9..9ffdbf00d 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1274,7 +1274,7 @@ tableCaption :: PandocMonad m => MarkdownParser m (F Inlines) tableCaption = try $ do guardEnabled Ext_table_captions skipNonindentSpaces - (string ":" <* notFollowedBy (string "::")) <|> string "Table:" + (string ":" <* notFollowedBy (satisfy isPunctuation)) <|> string "Table:" trimInlinesF <$> inlines1 <* blanklines -- Parse a simple table with '---' header and one line per row. |