diff options
author | Ophir Lifshitz <hangfromthefloor@gmail.com> | 2015-07-23 02:29:37 -0400 |
---|---|---|
committer | Ophir Lifshitz <hangfromthefloor@gmail.com> | 2015-07-23 02:29:37 -0400 |
commit | 42c139d302a682339faaab011ffa8ebca2d93a2a (patch) | |
tree | 37f11c96506140af6c17409dd04acc3826c96539 /src/Text | |
parent | fa2c008ae5edf36b5345d56e859d0b5cf7a14e69 (diff) | |
download | pandoc-42c139d302a682339faaab011ffa8ebca2d93a2a.tar.gz |
Markdown Reader: Skip spaces in headers
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index b8f5dab60..ab33023bb 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -521,6 +521,7 @@ atxClosing :: MarkdownParser Attr atxClosing = try $ do attr' <- option nullAttr (guardEnabled Ext_mmd_header_identifiers >> mmdHeaderIdentifier) + skipSpaces skipMany (char '#') skipSpaces attr <- option attr' @@ -547,6 +548,7 @@ setextHeader = try $ do -- This lookahead prevents us from wasting time parsing Inlines -- unless necessary -- it gives a significant performance boost. lookAhead $ anyLine >> many1 (oneOf setextHChars) >> blankline + skipSpaces (text, raw) <- withRaw $ trimInlinesF . mconcat <$> many1 (notFollowedBy setextHeaderEnd >> inline) attr <- setextHeaderEnd |