From ad9770fe86d0f7d9e8ccfe09eada1e7a60ef3d25 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 4 Jun 2019 09:49:22 -0700 Subject: Docx reader: Add support for w:rtl (ltr annotation). Closes #5545. --- src/Text/Pandoc/Readers/Docx/Parse.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc/Readers/Docx') diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index a28e90b5a..f725660b9 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -289,9 +289,11 @@ data RunStyle = RunStyle { isBold :: Maybe Bool , isItalic :: Maybe Bool , isSmallCaps :: Maybe Bool , isStrike :: Maybe Bool + , isRTL :: Maybe Bool , rVertAlign :: Maybe VertAlign , rUnderline :: Maybe String - , rStyle :: Maybe CharStyle} + , rStyle :: Maybe CharStyle + } deriving Show data ParStyleData = ParStyleData { headingLev :: Maybe (String, Int) @@ -305,9 +307,11 @@ defaultRunStyle = RunStyle { isBold = Nothing , isItalic = Nothing , isSmallCaps = Nothing , isStrike = Nothing + , isRTL = Nothing , rVertAlign = Nothing , rUnderline = Nothing - , rStyle = Nothing} + , rStyle = Nothing + } type Target = String type Anchor = String @@ -1106,6 +1110,7 @@ elemToRunStyle ns element parentStyle checkOnOff ns rPr (elemName ns "w" "iCs") , isSmallCaps = checkOnOff ns rPr (elemName ns "w" "smallCaps") , isStrike = checkOnOff ns rPr (elemName ns "w" "strike") + , isRTL = checkOnOff ns rPr (elemName ns "w" "rtl") , rVertAlign = findChildByName ns "w" "vertAlign" rPr >>= findAttrByName ns "w" "val" >>= @@ -1117,7 +1122,7 @@ elemToRunStyle ns element parentStyle findChildByName ns "w" "u" rPr >>= findAttrByName ns "w" "val" , rStyle = parentStyle - } + } elemToRunStyle _ _ _ = defaultRunStyle getHeaderLevel :: NameSpaces -> Element -> Maybe (String,Int) -- cgit v1.2.3