aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2019-10-15 01:55:32 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2019-10-15 01:55:32 +0300
commitd5c13dd4383e4809c4a6e935398a4bfa6e1b04e5 (patch)
tree80f33803ce2191705d06a7e2cbddb6b84e053d18 /src
parent13e0ac1104cc77f15e85fea83f54b6d6ae65271d (diff)
downloadpandoc-d5c13dd4383e4809c4a6e935398a4bfa6e1b04e5.tar.gz
Muse reader: do not split series of asterisks into symbols and emphasis
Fixes #5821
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 104fa914f..8a0456981 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -755,6 +755,7 @@ inline' = whitespace
<|> mathTag
<|> inlineLiteralTag
<|> str
+ <|> asterisks
<|> symbol
<?> "inline"
@@ -909,6 +910,12 @@ inlineLiteralTag = try $ fmap pure $ B.rawInline
str :: PandocMonad m => MuseParser m (F Inlines)
str = return . B.str <$> many1 alphaNum <* updateLastStrPos
+-- | Consume asterisks that were not used as emphasis opening.
+-- This prevents series of asterisks from being split into
+-- literal asterisk and emphasis opening.
+asterisks :: PandocMonad m => MuseParser m (F Inlines)
+asterisks = pure . B.str <$> many1 (char '*')
+
symbol :: PandocMonad m => MuseParser m (F Inlines)
symbol = pure . B.str . pure <$> nonspaceChar