@@ -252,33 +252,36 @@ parPartToString _ = ""
252blacklistedCharStyles :: [String]
252blacklistedCharStyles :: [String]
253blacklistedCharStyles = ["Hyperlink"]
253blacklistedCharStyles = ["Hyperlink"]
255−resolveDependentRunStyle :: RunStyle -> RunStyle
255+resolveDependentRunStyle :: PandocMonad m => RunStyle -> DocxContext m RunStyle
256resolveDependentRunStyle rPr
256resolveDependentRunStyle rPr
257 | Just (s, _) <- rStyle rPr, s `elem` blacklistedCharStyles =
257 | Just (s, _) <- rStyle rPr, s `elem` blacklistedCharStyles =
259− | Just (_, cs) <- rStyle rPr =
259+ | Just (_, cs) <- rStyle rPr = do
260+ opts <- asks docxOptions
261+ if isEnabled Ext_styles opts
260− let rPr' = resolveDependentRunStyle cs
263+ else do rPr' <- resolveDependentRunStyle cs
262− RunStyle { isBold = case isBold rPr of
265+ RunStyle { isBold = case isBold rPr of
263− Just bool -> Just bool
266+ Just bool -> Just bool
264− Nothing -> isBold rPr'
267+ Nothing -> isBold rPr'
265− , isItalic = case isItalic rPr of
268+ , isItalic = case isItalic rPr of
266− Just bool -> Just bool
269+ Just bool -> Just bool
267− Nothing -> isItalic rPr'
270+ Nothing -> isItalic rPr'
268− , isSmallCaps = case isSmallCaps rPr of
271+ , isSmallCaps = case isSmallCaps rPr of
269− Just bool -> Just bool
272+ Just bool -> Just bool
270− Nothing -> isSmallCaps rPr'
273+ Nothing -> isSmallCaps rPr'
271− , isStrike = case isStrike rPr of
274+ , isStrike = case isStrike rPr of
272− Just bool -> Just bool
275+ Just bool -> Just bool
273− Nothing -> isStrike rPr'
276+ Nothing -> isStrike rPr'
274− , rVertAlign = case rVertAlign rPr of
277+ , rVertAlign = case rVertAlign rPr of
275− Just valign -> Just valign
278+ Just valign -> Just valign
276− Nothing -> rVertAlign rPr'
279+ Nothing -> rVertAlign rPr'
277− , rUnderline = case rUnderline rPr of
280+ , rUnderline = case rUnderline rPr of
278− Just ulstyle -> Just ulstyle
281+ Just ulstyle -> Just ulstyle
279− Nothing -> rUnderline rPr'
282+ Nothing -> rUnderline rPr'
280− , rStyle = rStyle rPr }
283+ , rStyle = rStyle rPr }
281− | otherwise = rPr
284+ | otherwise = return rPr
283extraRunStyleInfo :: PandocMonad m => RunStyle -> DocxContext m (Inlines -> Inlines)
286extraRunStyleInfo :: PandocMonad m => RunStyle -> DocxContext m (Inlines -> Inlines)
284extraRunStyleInfo rPr
287extraRunStyleInfo rPr
@@ -337,18 +340,18 @@ runStyleToTransform rPr
337runToInlines :: PandocMonad m => Run -> DocxContext m Inlines
340runToInlines :: PandocMonad m => Run -> DocxContext m Inlines
338runToInlines (Run rs runElems)
341runToInlines (Run rs runElems)
339 | Just (s, _) <- rStyle rs
342 | Just (s, _) <- rStyle rs
340− , s `elem` codeStyles =
343+ , s `elem` codeStyles = do
341− let rPr = resolveDependentRunStyle rs
344+ rPr <- resolveDependentRunStyle rs
342− codeString = code $ concatMap runElemToString runElems
345+ let codeString = code $ concatMap runElemToString runElems
344− return $ case rVertAlign rPr of
346+ return $ case rVertAlign rPr of
345− Just SupScrpt -> superscript codeString
347+ Just SupScrpt -> superscript codeString
346− Just SubScrpt -> subscript codeString
348+ Just SubScrpt -> subscript codeString
347− _ -> codeString
349+ _ -> codeString
348 | otherwise = do
350 | otherwise = do
351+ rPr <- resolveDependentRunStyle rs
349− let ils = smushInlines (map runElemToInlines runElems)
352+ let ils = smushInlines (map runElemToInlines runElems)
350− transform <- runStyleToTransform $ resolveDependentRunStyle rs
353+ transform <- runStyleToTransform rPr
351− return $ transform ils
354+ return $ transform ils
352runToInlines (Footnote bps) = do
355runToInlines (Footnote bps) = do
353 blksList <- smushBlocks <$> mapM bodyPartToBlocks bps
356 blksList <- smushBlocks <$> mapM bodyPartToBlocks bps
354 return $ note blksList
357 return $ note blksList