From 7888f49342d205973004c8d3e642b0d5d2f92e1a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 14 Dec 2017 12:03:14 -0800 Subject: 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. --- src/Text/Pandoc/Readers/Markdown.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Text') 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. -- cgit v1.2.3