summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2022-06-10 11:29:00 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2022-06-10 11:29:00 +0200
commit2200b9c8ffd44cb474aa804333721ce16fd09776 (patch)
tree0cc62450c1a6968bca1b68b58a34b96e9ba84c3c
parent7e6ccda6d99c4bc11e1847a669f2fd8c76816a66 (diff)
TikiWiki: support underlined text
-rw-r--r--src/Text/Pandoc/Readers/TikiWiki.hs9
-rw-r--r--test/tikiwiki-reader.native7
-rw-r--r--test/tikiwiki-reader.tikiwiki6
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
@@ -101,6 +101,13 @@ Pandoc
]
, Header
1
+ ( "other-inlines" , [] , [] )
+ [ Str "other" , Space , Str "inlines" ]
+ , Para
+ [ Underline [ Str "underlined" , Space , Str "text" ] ]
+ , Para [ Strikeout [ Str "strikeout" ] ]
+ , Header
+ 1
( "horizontal-rule" , [] , [] )
[ Str "horizontal" , Space , Str "rule" ]
, Para [ Str "top" ]
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