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

The previous commits had some code repetition. This just makes it a bit easier to read.

commita7c67c897ecebe339078b212a93a35a54a6fc143 authorJesse Rosenthal <jrosenthal@jhu.edu> dateSat 21 Feb 2015, 09:18 (12 years ago) parent9654514
1 file changed+4−3
src/Text/Pandoc/Readers/Docx.hs+4−3
src/Text/Pandoc/Readers/Docx.hs+4−3
@@ -278,11 +278,12 @@ runToInlines (Run rs runElems)
278278 | Just (s, _) <- rStyle rs
279279 , s `elem` codeStyles =
280280 let rPr = resolveDependentRunStyle rs
281+ codeString = code $ concatMap runElemToString runElems
281282 in
282283 return $ case rVertAlign rPr of
283− Just SupScrpt -> superscript $ code $ concatMap runElemToString runElems
284− Just SubScrpt -> subscript $ code $ concatMap runElemToString runElems
285− _ -> code $ concatMap runElemToString runElems
284+ Just SupScrpt -> superscript codeString
285+ Just SubScrpt -> subscript codeString
286+ _ -> codeString
286287 | otherwise = do
287288 let ils = concatReduce (map runElemToInlines runElems)
288289 return $ (runStyleToTransform $ resolveDependentRunStyle rs) ils