Muse reader: do not terminate emphasis on "*" not followed by space

This commit is contained in:
Alexander Krotov 2019-10-15 00:56:28 +03:00
parent d8d784ab54
commit 13e0ac1104
2 changed files with 5 additions and 2 deletions

View file

@ -807,8 +807,7 @@ emphasisBetween p = try $ trimInlinesF . mconcat
<$ atStart
<* p
<* notFollowedBy space
<*> many1Till inline (try $ noSpaceBefore *> p)
<* notFollowedBy alphaNum
<*> many1Till inline (try $ noSpaceBefore *> p <* notFollowedBy alphaNum)
-- | Parse an inline tag, such as @\<em>@ and @\<strong>@.
inlineTag :: PandocMonad m

View file

@ -133,6 +133,10 @@ tests =
"**foo *bar* baz**" =?>
para (strong (text "foo " <> emph (text "bar") <> text " baz"))
, "Asterisk between words does not terminate emphasis" =:
"*foo*bar*" =?>
para (emph $ "foo*bar")
, test emacsMuse "Underline"
("_Underline_" =?> para (underlineSpan "Underline"))