diff options
author | Jesse Rosenthal <jrosenthal@jhu.edu> | 2015-02-21 09:18:53 -0500 |
---|---|---|
committer | Jesse Rosenthal <jrosenthal@jhu.edu> | 2015-02-21 09:18:53 -0500 |
commit | a7c67c897ecebe339078b212a93a35a54a6fc143 (patch) | |
tree | 4c8263913707835ad86df66461586ef94848fbaf /src/Text/Pandoc | |
parent | 9654514e8a8f18eed4a9a5a3ef2b14d3be4e3187 (diff) | |
download | pandoc-a7c67c897ecebe339078b212a93a35a54a6fc143.tar.gz |
Docx reader: Minor cleanup.
The previous commits had some code repetition. This just makes it a bit
easier to read.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/Docx.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs index 1a95b753d..d61cc8b1b 100644 --- a/src/Text/Pandoc/Readers/Docx.hs +++ b/src/Text/Pandoc/Readers/Docx.hs @@ -278,11 +278,12 @@ runToInlines (Run rs runElems) | Just (s, _) <- rStyle rs , s `elem` codeStyles = let rPr = resolveDependentRunStyle rs + codeString = code $ concatMap runElemToString runElems in return $ case rVertAlign rPr of - Just SupScrpt -> superscript $ code $ concatMap runElemToString runElems - Just SubScrpt -> subscript $ code $ concatMap runElemToString runElems - _ -> code $ concatMap runElemToString runElems + Just SupScrpt -> superscript codeString + Just SubScrpt -> subscript codeString + _ -> codeString | otherwise = do let ils = concatReduce (map runElemToInlines runElems) return $ (runStyleToTransform $ resolveDependentRunStyle rs) ils |