git.iko.soy/typeable/pandoc
on master help sign in
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.

commit55d2ce751a8fefc3e07aa5d703ca77dd2df2c8c7 authorJesse Rosenthal <jrosenthal@jhu.edu> dateSat 21 Feb 2015, 08:41 (12 years ago) parent3e81c3a
1 file changed+6−1
src/Text/Pandoc/Readers/Docx.hs+6−1
src/Text/Pandoc/Readers/Docx.hs+6−1
@@ -277,7 +277,12 @@ runToInlines :: Run -> DocxContext Inlines
277277runToInlines (Run rs runElems)
278278 | Just (s, _) <- rStyle rs
279279 , s `elem` codeStyles =
280− return $ code $ concatMap runElemToString runElems
280+ let rPr = resolveDependentRunStyle rs
281+ in
282+ 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
281286 | otherwise = do
282287 let ils = concatReduce (map runElemToInlines runElems)
283288 return $ (runStyleToTransform $ resolveDependentRunStyle rs) ils