aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Muse.hs
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2019-10-15 16:36:05 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2019-10-15 16:36:05 +0300
commita1977dd2d67e6ccbafaf7ac25f941bdd399469fa (patch)
treee6fcf7e7b056d78218a0052bef1bd741a574f9ef /src/Text/Pandoc/Readers/Muse.hs
parenta0aeb135b39687c1a1c6adb4aa6b01dcc9c6e867 (diff)
downloadpandoc-a1977dd2d67e6ccbafaf7ac25f941bdd399469fa.tar.gz
Muse reader: do not allow closing asterisks to be followed by "*"
Diffstat (limited to 'src/Text/Pandoc/Readers/Muse.hs')
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 8a0456981..b8cbe2f26 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -736,6 +736,7 @@ inline' = whitespace
<|> br
<|> anchor
<|> footnote
+ <|> strongEmph
<|> strong
<|> strongTag
<|> emph
@@ -818,13 +819,17 @@ inlineTag tag = try $ mconcat
<$ openTag tag
<*> manyTill inline (closeTag tag)
+-- | Parse strong emphasis inline markup, indicated by @***@.
+strongEmph :: PandocMonad m => MuseParser m (F Inlines)
+strongEmph = fmap (B.strong . B.emph) <$> emphasisBetween (string "***" <* notFollowedBy (char '*'))
+
-- | Parse strong inline markup, indicated by @**@.
strong :: PandocMonad m => MuseParser m (F Inlines)
-strong = fmap B.strong <$> emphasisBetween (string "**")
+strong = fmap B.strong <$> emphasisBetween (string "**" <* notFollowedBy (char '*'))
-- | Parse emphasis inline markup, indicated by @*@.
emph :: PandocMonad m => MuseParser m (F Inlines)
-emph = fmap B.emph <$> emphasisBetween (char '*')
+emph = fmap B.emph <$> emphasisBetween (char '*' <* notFollowedBy (char '*'))
-- | Parse underline inline markup, indicated by @_@.
-- Supported only in Emacs Muse mode, not Text::Amuse.