diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index c9643f1b0..66f4df341 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1517,12 +1517,17 @@ code :: PandocMonad m => MarkdownParser m (F Inlines) code = try $ do starts <- many1 (char '`') skipSpaces - result <- (trim . T.concat) <$> - manyTill (notFollowedBy (inList >> listStart) >> - (many1Char (noneOf "`\n") <|> many1Char (char '`') <|> - (char '\n' >> notFollowedBy' blankline >> return " "))) - (try (skipSpaces >> count (length starts) (char '`') >> - notFollowedBy (char '`'))) + result <- trim . T.concat + <$> manyTill + ( many1Char (noneOf "`\n") + <|> many1Char (char '`') + <|> (char '\n' + >> notFollowedBy (inList >> listStart) + >> notFollowedBy' blankline + >> return " ")) + (try $ skipSpaces + >> count (length starts) (char '`') + >> notFollowedBy (char '`')) rawattr <- (Left <$> try (guardEnabled Ext_raw_attribute >> rawAttribute)) <|> |