aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Docx
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-06-04 09:49:22 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-06-04 09:49:22 -0700
commitad9770fe86d0f7d9e8ccfe09eada1e7a60ef3d25 (patch)
tree54fc739ae15fc0554f3dce62ae079fb0e362aaeb /src/Text/Pandoc/Readers/Docx
parentb5af8eed3877ff0c99e14b12220562db406c1eba (diff)
downloadpandoc-ad9770fe86d0f7d9e8ccfe09eada1e7a60ef3d25.tar.gz
Docx reader: Add support for w:rtl (ltr annotation).
Closes #5545.
Diffstat (limited to 'src/Text/Pandoc/Readers/Docx')
-rw-r--r--src/Text/Pandoc/Readers/Docx/Parse.hs11
1 files changed, 8 insertions, 3 deletions
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)