diff options
author | Jesse Rosenthal <jrosenthal@jhu.edu> | 2015-02-21 08:41:09 -0500 |
---|---|---|
committer | Jesse Rosenthal <jrosenthal@jhu.edu> | 2015-02-21 08:41:09 -0500 |
commit | 55d2ce751a8fefc3e07aa5d703ca77dd2df2c8c7 (patch) | |
tree | f09efa9e0446401ba970b359bdbf1d888daf0cf3 /src/Text/Pandoc | |
parent | 3e81c3a0a6b20be53cd7156c1dce6e49470352b9 (diff) | |
download | pandoc-55d2ce751a8fefc3e07aa5d703ca77dd2df2c8c7.tar.gz |
Docx reader: allow sub/superscript verbatims.
Verbatim usually shuts off all other run styles, but we don't want it to
shut off sub/superscript.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/Docx.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs index d4680cb7e..1a95b753d 100644 --- a/src/Text/Pandoc/Readers/Docx.hs +++ b/src/Text/Pandoc/Readers/Docx.hs @@ -277,7 +277,12 @@ runToInlines :: Run -> DocxContext Inlines runToInlines (Run rs runElems) | Just (s, _) <- rStyle rs , s `elem` codeStyles = - return $ code $ concatMap runElemToString runElems + let rPr = resolveDependentRunStyle rs + in + return $ case rVertAlign rPr of + Just SupScrpt -> superscript $ code $ concatMap runElemToString runElems + Just SubScrpt -> subscript $ code $ concatMap runElemToString runElems + _ -> code $ concatMap runElemToString runElems | otherwise = do let ils = concatReduce (map runElemToInlines runElems) return $ (runStyleToTransform $ resolveDependentRunStyle rs) ils |