aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/RST.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers/RST.hs')
-rw-r--r--src/Text/Pandoc/Writers/RST.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs
index 67603728b..43bf382b7 100644
--- a/src/Text/Pandoc/Writers/RST.hs
+++ b/src/Text/Pandoc/Writers/RST.hs
@@ -415,6 +415,7 @@ transformInlines = insertBS .
hasContents :: Inline -> Bool
hasContents (Str "") = False
hasContents (Emph []) = False
+ hasContents (Underline []) = False
hasContents (Strong []) = False
hasContents (Strikeout []) = False
hasContents (Superscript []) = False
@@ -474,6 +475,7 @@ transformInlines = insertBS .
okBeforeComplex _ = False
isComplex :: Inline -> Bool
isComplex (Emph _) = True
+ isComplex (Underline _) = True
isComplex (Strong _) = True
isComplex (SmallCaps _) = True
isComplex (Strikeout _) = True
@@ -538,6 +540,7 @@ mapNested f i = setInlineChildren i (f (dropInlineParent i))
dropInlineParent :: Inline -> [Inline]
dropInlineParent (Link _ i _) = i
dropInlineParent (Emph i) = i
+dropInlineParent (Underline i) = i
dropInlineParent (Strong i) = i
dropInlineParent (Strikeout i) = i
dropInlineParent (Superscript i) = i
@@ -552,6 +555,7 @@ dropInlineParent i = [i] -- not a parent, like Str or Space
setInlineChildren :: Inline -> [Inline] -> Inline
setInlineChildren (Link a _ t) i = Link a i t
setInlineChildren (Emph _) i = Emph i
+setInlineChildren (Underline _) i = Underline i
setInlineChildren (Strong _) i = Strong i
setInlineChildren (Strikeout _) i = Strikeout i
setInlineChildren (Superscript _) i = Superscript i
@@ -582,6 +586,9 @@ inlineToRST (Span (_,_,kvs) ils) = do
inlineToRST (Emph lst) = do
contents <- writeInlines lst
return $ "*" <> contents <> "*"
+-- Underline is not supported, fall back to Emph
+inlineToRST (Underline lst) =
+ inlineToRST (Emph lst)
inlineToRST (Strong lst) = do
contents <- writeInlines lst
return $ "**" <> contents <> "**"