aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Docx.hs
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.hs
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.hs')
-rw-r--r--src/Text/Pandoc/Readers/Docx.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs
index c74380cb8..4f44d18e7 100644
--- a/src/Text/Pandoc/Readers/Docx.hs
+++ b/src/Text/Pandoc/Readers/Docx.hs
@@ -252,13 +252,17 @@ resolveDependentRunStyle rPr
, isStrike = case isStrike rPr of
Just bool -> Just bool
Nothing -> isStrike rPr'
+ , isRTL = case isRTL rPr of
+ Just bool -> Just bool
+ Nothing -> isRTL rPr'
, rVertAlign = case rVertAlign rPr of
Just valign -> Just valign
Nothing -> rVertAlign rPr'
, rUnderline = case rUnderline rPr of
Just ulstyle -> Just ulstyle
Nothing -> rUnderline rPr'
- , rStyle = rStyle rPr }
+ , rStyle = rStyle rPr
+ }
| otherwise = return rPr
runStyleToTransform :: PandocMonad m => RunStyle -> DocxContext m (Inlines -> Inlines)
@@ -286,6 +290,12 @@ runStyleToTransform rPr
| Just True <- isStrike rPr = do
transform <- runStyleToTransform rPr{isStrike = Nothing}
return $ strikeout . transform
+ | Just True <- isRTL rPr = do
+ transform <- runStyleToTransform rPr{isRTL = Nothing}
+ return $ spanWith ("",[],[("dir","rtl")]) . transform
+ | Just False <- isRTL rPr = do
+ transform <- runStyleToTransform rPr{isRTL = Nothing}
+ return $ spanWith ("",[],[("dir","ltr")]) . transform
| Just SupScrpt <- rVertAlign rPr = do
transform <- runStyleToTransform rPr{rVertAlign = Nothing}
return $ superscript . transform