Markdown reader: Use take1WhileP for str.

This yields a small but measurable performance improvement.
This commit is contained in:
John MacFarlane 2019-11-14 07:58:50 -08:00
parent db6e9de091
commit cc5afbb834

View file

@ -1728,7 +1728,9 @@ nonEndline = satisfy (/='\n')
str :: PandocMonad m => MarkdownParser m (F Inlines)
str = do
result <- many1Char (alphaNum <|> try (char '.' <* notFollowedBy (char '.')))
result <- mconcat <$> many1
( take1WhileP isAlphaNum
<|> "." <$ try (char '.' <* notFollowedBy (char '.')) )
updateLastStrPos
(do guardEnabled Ext_smart
abbrevs <- getOption readerAbbreviations