@@ -641,7 +641,7 @@ uri = try $ do
641641 scheme <- uriScheme
642642 char ':'
643643 -- Avoid parsing e.g. "**Notes:**" as a raw URI:
644− notFollowedBy (oneOf "*_]")
644+ notFollowedBy $ satisfy (\c -> c == '*' || c == '_' || c == ']')
645645 -- We allow sentence punctuation except at the end, since
646646 -- we don't want the trailing '.' in 'http://google.com.' We want to allow
647647 -- http://en.wikipedia.org/wiki/State_of_emergency_(disambiguation)
@@ -693,7 +693,7 @@ mathInlineWith op cl = try $ do
693693 (("\\text" <>) <$> inBalancedBraces 0 ""))
694694 <|> (\c -> T.pack ['\\',c]) <$> anyChar))
695695 <|> do (blankline <* notFollowedBy' blankline) <|>
696− (oneOf " \t" <* skipMany (oneOf " \t"))
696+ (spaceChar <* skipMany spaceChar)
697697 notFollowedBy (char '$')
698698 return " "
699699 ) (try $ textStr cl)
@@ -723,7 +723,8 @@ mathInlineWith op cl = try $ do
723723mathDisplayWith :: Stream s m Char => Text -> Text -> ParserT s st m Text
724724mathDisplayWith op cl = try $ fmap T.pack $ do
725725 textStr op
726− many1Till (noneOf "\n" <|> (newline <* notFollowedBy' blankline)) (try $ textStr cl)
726+ many1Till (satisfy (/= '\n') <|> (newline <* notFollowedBy' blankline))
727+ (try $ textStr cl)
727728
728729mathDisplay :: (HasReaderOptions st, Stream s m Char)
729730 => ParserT s st m Text