From 2200b9c8ffd44cb474aa804333721ce16fd09776 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Fri, 10 Jun 2022 11:29:00 +0200 Subject: [PATCH] TikiWiki: support underlined text --- src/Text/Pandoc/Readers/TikiWiki.hs | 9 ++------- test/tikiwiki-reader.native | 7 +++++++ test/tikiwiki-reader.tikiwiki | 6 ++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Text/Pandoc/Readers/TikiWiki.hs b/src/Text/Pandoc/Readers/TikiWiki.hs index 65e0f5d45..2275646b9 100644 --- a/src/Text/Pandoc/Readers/TikiWiki.hs +++ b/src/Text/Pandoc/Readers/TikiWiki.hs @@ -523,14 +523,9 @@ colored = try $ do string "~~" return $ B.str $ " NOT SUPPORTED: ~~ (colored) BEGIN: ~~" <> inner <> "~~ :END " --- UNSUPPORTED, as there doesn't seem to be any facility in calibre --- for this +-- ===underlined=== underlined :: PandocMonad m => TikiWikiParser m B.Inlines -underlined = try $ do - string "===" - inner <- fmap T.pack $ many1 $ noneOf "=\n" - string "===" - return $ B.str $ " NOT SUPPORTED: ==== (underlined) BEGIN: ===" <> inner <> "=== :END " +underlined = try $ B.underline <$> enclosed (string "===") nestedInlines -- UNSUPPORTED, as there doesn't seem to be any facility in calibre -- for this diff --git a/test/tikiwiki-reader.native b/test/tikiwiki-reader.native index 3a3f1038f..db3f97fa1 100644 --- a/test/tikiwiki-reader.native +++ b/test/tikiwiki-reader.native @@ -99,6 +99,13 @@ Pandoc , Str "emph" ] ] + , Header + 1 + ( "other-inlines" , [] , [] ) + [ Str "other" , Space , Str "inlines" ] + , Para + [ Underline [ Str "underlined" , Space , Str "text" ] ] + , Para [ Strikeout [ Str "strikeout" ] ] , Header 1 ( "horizontal-rule" , [] , [] ) diff --git a/test/tikiwiki-reader.tikiwiki b/test/tikiwiki-reader.tikiwiki index d1971feb1..d2a5c6ed3 100644 --- a/test/tikiwiki-reader.tikiwiki +++ b/test/tikiwiki-reader.tikiwiki @@ -28,6 +28,12 @@ __strong with ''emph''__ ''__strong inside__ emph'' +! other inlines + +===underlined text=== + +--strikeout-- + ! horizontal rule top