summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Markdown.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-12-14 12:03:14 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-14 12:03:14 -0800
commit7888f49342d205973004c8d3e642b0d5d2f92e1a (patch)
treea5d5647ff69ec4fe0c7d10996366af33b3a8dfbd /src/Text/Pandoc/Readers/Markdown.hs
parent17b667ec260547201e422de7da56816d97d73c3b (diff)
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/Text/Pandoc/Readers/Markdown.hs')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs2
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.