From 48c88d566d19683a7d5b63f88c8b4487234e3712 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 20 Mar 2017 21:51:29 +0100 Subject: Add `space_in_atx_header` extension. This is enabled by default in pandoc and GitHub markdown but not the other flavors. This requirse a space between the opening #'s and the header text in ATX headers (as CommonMark does but many other implementations do not). This is desirable to avoid falsely capturing things ilke #hashtag or #5 Closes #3512. --- src/Text/Pandoc/Readers/Markdown.hs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 169872391..0cc10c1d4 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -534,6 +534,7 @@ atxHeader = try $ do level <- atxChar >>= many1 . char >>= return . length notFollowedBy $ guardEnabled Ext_fancy_lists >> (char '.' <|> char ')') -- this would be a list + guardDisabled Ext_space_in_atx_header <|> notFollowedBy nonspaceChar skipSpaces (text, raw) <- withRaw $ trimInlinesF . mconcat <$> many (notFollowedBy atxClosing >> inline) -- cgit v1.2.3