diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 8 | ||||
-rw-r--r-- | test/Tests/Readers/Muse.hs | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index f10a2172f..0688b479c 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -57,7 +57,7 @@ import Text.Pandoc.Logging import Text.Pandoc.Options import Text.Pandoc.Parsing import Text.Pandoc.Readers.HTML (htmlTag) -import Text.Pandoc.Shared (crFilter) +import Text.Pandoc.Shared (crFilter, underlineSpan) -- | Read Muse from an input string and return a Pandoc document. readMuse :: PandocMonad m @@ -577,6 +577,7 @@ inlineList = [ endline , strongTag , emph , emphTag + , underlined , superscriptTag , subscriptTag , strikeoutTag @@ -666,6 +667,11 @@ strong = fmap B.strong <$> emphasisBetween (string "**") emph :: PandocMonad m => MuseParser m (F Inlines) emph = fmap B.emph <$> emphasisBetween (char '*') +underlined :: PandocMonad m => MuseParser m (F Inlines) +underlined = do + guardDisabled Ext_amuse -- Supported only by Emacs Muse + fmap underlineSpan <$> emphasisBetween (char '_') + emphTag :: PandocMonad m => MuseParser m (F Inlines) emphTag = inlineTag B.emph "em" diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index c0da48586..3a3d7d864 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -10,6 +10,7 @@ import Tests.Helpers import Text.Pandoc import Text.Pandoc.Arbitrary () import Text.Pandoc.Builder +import Text.Pandoc.Shared (underlineSpan) -- import Text.Pandoc.Walk (walk) amuse :: Text -> Pandoc @@ -83,6 +84,9 @@ tests = "***strength***" =?> para (strong . emph $ "strength") + , test emacsMuse "Underline" + ("_Underline_" =?> para (underlineSpan "Underline")) + , "Superscript tag" =: "<sup>Superscript</sup>" =?> para (superscript "Superscript") , "Subscript tag" =: "<sub>Subscript</sub>" =?> para (subscript "Subscript") |