git.iko.soy/typeable/pandoc
on master help sign in
Docx reader: code cleanup.

Make the code in `runStyleToTransform` a bit more consistent.

commit6de2c0710f2586e4925690583df07d50ce167725 authorJesse Rosenthal <jrosenthal@jhu.edu> dateFri 23 Feb 2018, 14:51 (9 years ago) parent3e10caa
1 file changed+9−10
src/Text/Pandoc/Readers/Docx.hs+9−10
src/Text/Pandoc/Readers/Docx.hs+9−10
@@ -286,36 +286,35 @@ runStyleToTransform :: PandocMonad m => RunStyle -> DocxContext m (Inlines -> In
286286runStyleToTransform rPr
287287 | Just (s, _) <- rStyle rPr
288288 , s `elem` spansToKeep = do
289− let rPr' = rPr{rStyle = Nothing}
290− transform <- runStyleToTransform rPr'
289+ transform <- runStyleToTransform rPr{rStyle = Nothing}
291290 return $ spanWith ("", [s], []) . transform
292291 | Just (s, _) <- rStyle rPr = do
293292 opts <- asks docxOptions
294293 let extraInfo = if isEnabled Ext_styles opts
295294 then spanWith ("", [], [("custom-style", s)])
296295 else id
297− transform <- runStyleToTransform rPr {rStyle = Nothing}
296+ transform <- runStyleToTransform rPr{rStyle = Nothing}
298297 return $ extraInfo . transform
299298 | Just True <- isItalic rPr = do
300− transform <- runStyleToTransform rPr {isItalic = Nothing}
299+ transform <- runStyleToTransform rPr{isItalic = Nothing}
301300 return $ emph . transform
302301 | Just True <- isBold rPr = do
303− transform <- runStyleToTransform rPr {isBold = Nothing}
302+ transform <- runStyleToTransform rPr{isBold = Nothing}
304303 return $ strong . transform
305304 | Just True <- isSmallCaps rPr = do
306− transform <- runStyleToTransform rPr {isSmallCaps = Nothing}
305+ transform <- runStyleToTransform rPr{isSmallCaps = Nothing}
307306 return $ smallcaps . transform
308307 | Just True <- isStrike rPr = do
309− transform <- runStyleToTransform rPr {isStrike = Nothing}
308+ transform <- runStyleToTransform rPr{isStrike = Nothing}
310309 return $ strikeout . transform
311310 | Just SupScrpt <- rVertAlign rPr = do
312− transform <- runStyleToTransform rPr {rVertAlign = Nothing}
311+ transform <- runStyleToTransform rPr{rVertAlign = Nothing}
313312 return $ superscript . transform
314313 | Just SubScrpt <- rVertAlign rPr = do
315− transform <- runStyleToTransform rPr {rVertAlign = Nothing}
314+ transform <- runStyleToTransform rPr{rVertAlign = Nothing}
316315 return $ subscript . transform
317316 | Just "single" <- rUnderline rPr = do
318− transform <- runStyleToTransform rPr {rUnderline = Nothing}
317+ transform <- runStyleToTransform rPr{rUnderline = Nothing}
319318 return $ underlineSpan . transform
320319 | otherwise = return id
321320