aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/OpenDocument.hs
diff options
context:
space:
mode:
authorVaibhav Sagar <vaibhavsagar@gmail.com>2020-04-28 22:53:06 +0800
committerGitHub <noreply@github.com>2020-04-28 07:53:06 -0700
commit9c2b659eeb196145f62d8eae0072c279a7c2d751 (patch)
treef3c97feb0f1d063e2a7c65904c9fbe1591104a05 /src/Text/Pandoc/Writers/OpenDocument.hs
parent8d09a92d979126a53ec72ec73294ad04f811e9a7 (diff)
downloadpandoc-9c2b659eeb196145f62d8eae0072c279a7c2d751.tar.gz
Support new Underline element in readers and writers (#6277)
Deprecate `underlineSpan` in Shared in favor of `Text.Pandoc.Builder.underline`.
Diffstat (limited to 'src/Text/Pandoc/Writers/OpenDocument.hs')
-rw-r--r--src/Text/Pandoc/Writers/OpenDocument.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs
index 9c802118a..b868e168b 100644
--- a/src/Text/Pandoc/Writers/OpenDocument.hs
+++ b/src/Text/Pandoc/Writers/OpenDocument.hs
@@ -512,6 +512,7 @@ inlineToOpenDocument o ils
LineBreak -> return $ selfClosingTag "text:line-break" []
Str s -> return $ handleSpaces $ escapeStringForXML s
Emph l -> withTextStyle Italic $ inlinesToOpenDocument o l
+ Underline l -> withTextStyle Under $ inlinesToOpenDocument o l
Strong l -> withTextStyle Bold $ inlinesToOpenDocument o l
Strikeout l -> withTextStyle Strike $ inlinesToOpenDocument o l
Superscript l -> withTextStyle Sup $ inlinesToOpenDocument o l
@@ -692,6 +693,7 @@ paraTableStyles t s (a:xs)
data TextStyle = Italic
| Bold
+ | Under
| Strike
| Sub
| Sup
@@ -710,6 +712,9 @@ textStyleAttr m s
| Bold <- s = Map.insert "fo:font-weight" "bold" .
Map.insert "style:font-weight-asian" "bold" .
Map.insert "style:font-weight-complex" "bold" $ m
+ | Under <- s = Map.insert "style:text-underline-style" "solid" .
+ Map.insert "style:text-underline-width" "auto" .
+ Map.insert "style:text-underline-color" "font-color" $ m
| Strike <- s = Map.insert "style:text-line-through-style" "solid" m
| Sub <- s = Map.insert "style:text-position" "sub 58%" m
| Sup <- s = Map.insert "style:text-position" "super 58%" m