From d2714730440e77de6eb87840b868162b7b4ee19f Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sun, 6 Jan 2008 19:46:31 +0000 Subject: Fixed markdown reader to handle "*hi **there***" as a strong nested in an emph. (A '*' is only recognized as the end of the emphasis if it's not the beginning of a strong emphasis.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@1172 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Readers/Markdown.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Text/Pandoc') diff --git a/Text/Pandoc/Readers/Markdown.hs b/Text/Pandoc/Readers/Markdown.hs index 4460d78b6..f4714248e 100644 --- a/Text/Pandoc/Readers/Markdown.hs +++ b/Text/Pandoc/Readers/Markdown.hs @@ -719,8 +719,9 @@ math = try $ do char '$' return $ Math $ joinWithSep " " words -emph = ((enclosed (char '*') (char '*') inline) <|> - (enclosed (char '_') (char '_' >> notFollowedBy alphaNum) inline)) >>= +emph = ((enclosed (char '*') (notFollowedBy' strong >> char '*') inline) <|> + (enclosed (char '_') (notFollowedBy' strong >> char '_' >> + notFollowedBy alphaNum) inline)) >>= return . Emph . normalizeSpaces strong = ((enclosed (string "**") (try $ string "**") inline) <|> -- cgit v1.2.3