aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs4
-rw-r--r--test/Tests/Readers/Muse.hs4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 9c6c24f08..3f93fcc12 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -43,7 +43,7 @@ import Prelude
import Control.Monad
import Control.Monad.Except (throwError)
import Data.Bifunctor
-import Data.Char (isLetter, isDigit)
+import Data.Char (isLetter, isDigit, isAlphaNum)
import Data.Default
import Data.List (intercalate)
import Data.List.Split (splitOn)
@@ -913,7 +913,7 @@ code = try $ do
guard $ not $ null contents
guard $ head contents `notElem` " \t\n"
guard $ last contents `notElem` " \t\n"
- notFollowedBy $ satisfy isLetter
+ notFollowedBy $ satisfy isAlphaNum
return $ return $ B.code contents
-- | Parse @\<code>@ tag.
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index e88cfa5f1..80540b697 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -150,6 +150,10 @@ tests =
"Foo =bar=, baz" =?>
para (text "Foo " <> code "bar" <> text ", baz")
+ , "Not code if followed by digit" =:
+ "Foo =bar=0 baz" =?>
+ para (text "Foo =bar=0 baz")
+
, "One character code" =: "=c=" =?> para (code "c")
, "Three = characters is not a code" =: "===" =?> para "==="