@@ -32,7 +32,7 @@ import Text.Pandoc.Definition
32import Text.Pandoc.Logging (Verbosity (..))
32import Text.Pandoc.Logging (Verbosity (..))
33import Text.Pandoc.Options
33import Text.Pandoc.Options
34import Text.Pandoc.Parsing hiding (enclosed, nested)
34import Text.Pandoc.Parsing hiding (enclosed, nested)
35−import Text.Pandoc.Shared (crFilter)
35+import Text.Pandoc.Shared (crFilter, safeRead)
36import Text.Pandoc.XML (fromEntities)
36import Text.Pandoc.XML (fromEntities)
37import Text.Printf (printf)
37import Text.Printf (printf)
@@ -500,9 +500,12 @@ emph = try $ fmap B.emph (enclosed (string "''") nestedInlines)
500escapedChar :: PandocMonad m => TikiWikiParser m B.Inlines
500escapedChar :: PandocMonad m => TikiWikiParser m B.Inlines
501escapedChar = try $ do
501escapedChar = try $ do
502 string "~"
502 string "~"
503− inner <- many1 $ oneOf "0123456789"
503+ mNumber <- safeRead <$> many1 digit
504 string "~"
504 string "~"
505− return $B.str [toEnum (read inner :: Int) :: Char]
505+ return $ B.str $
507+ Just number -> [toEnum (number :: Int) :: Char]
507-- UNSUPPORTED, as there doesn't seem to be any facility in calibre
510-- UNSUPPORTED, as there doesn't seem to be any facility in calibre
508-- for this
511-- for this