summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2018-02-23 14:51:36 -0500
committerJesse Rosenthal <jrosenthal@jhu.edu>2018-02-23 14:51:36 -0500
commit6de2c0710f2586e4925690583df07d50ce167725 (patch)
treef5c40e01e0cf2f3c700e9374c23f33349f1d8ce4 /src/Text/Pandoc/Readers
parent3e10caad63b8886a8eff9d0372c7c68eb57f4610 (diff)
Docx reader: code cleanup.
Make the code in `runStyleToTransform` a bit more consistent.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Docx.hs19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs
index 724450c2c..e58b0a905 100644
--- a/src/Text/Pandoc/Readers/Docx.hs
+++ b/src/Text/Pandoc/Readers/Docx.hs
@@ -286,36 +286,35 @@ runStyleToTransform :: PandocMonad m => RunStyle -> DocxContext m (Inlines -> In
runStyleToTransform rPr
| Just (s, _) <- rStyle rPr
, s `elem` spansToKeep = do
- let rPr' = rPr{rStyle = Nothing}
- transform <- runStyleToTransform rPr'
+ transform <- runStyleToTransform rPr{rStyle = Nothing}
return $ spanWith ("", [s], []) . transform
| Just (s, _) <- rStyle rPr = do
opts <- asks docxOptions
let extraInfo = if isEnabled Ext_styles opts
then spanWith ("", [], [("custom-style", s)])
else id
- transform <- runStyleToTransform rPr {rStyle = Nothing}
+ transform <- runStyleToTransform rPr{rStyle = Nothing}
return $ extraInfo . transform
| Just True <- isItalic rPr = do
- transform <- runStyleToTransform rPr {isItalic = Nothing}
+ transform <- runStyleToTransform rPr{isItalic = Nothing}
return $ emph . transform
| Just True <- isBold rPr = do
- transform <- runStyleToTransform rPr {isBold = Nothing}
+ transform <- runStyleToTransform rPr{isBold = Nothing}
return $ strong . transform
| Just True <- isSmallCaps rPr = do
- transform <- runStyleToTransform rPr {isSmallCaps = Nothing}
+ transform <- runStyleToTransform rPr{isSmallCaps = Nothing}
return $ smallcaps . transform
| Just True <- isStrike rPr = do
- transform <- runStyleToTransform rPr {isStrike = Nothing}
+ transform <- runStyleToTransform rPr{isStrike = Nothing}
return $ strikeout . transform
| Just SupScrpt <- rVertAlign rPr = do
- transform <- runStyleToTransform rPr {rVertAlign = Nothing}
+ transform <- runStyleToTransform rPr{rVertAlign = Nothing}
return $ superscript . transform
| Just SubScrpt <- rVertAlign rPr = do
- transform <- runStyleToTransform rPr {rVertAlign = Nothing}
+ transform <- runStyleToTransform rPr{rVertAlign = Nothing}
return $ subscript . transform
| Just "single" <- rUnderline rPr = do
- transform <- runStyleToTransform rPr {rUnderline = Nothing}
+ transform <- runStyleToTransform rPr{rUnderline = Nothing}
return $ underlineSpan . transform
| otherwise = return id