@@ -620,27 +620,23 @@ writeOpenXML opts (Pandoc meta blocks) = do
620620blocksToOpenXML :: WriterOptions -> [Block] -> WS [Element]
621621blocksToOpenXML opts bls = concat `fmap` mapM (blockToOpenXML opts) bls
622622
623−pStyle :: String -> StyleMaps -> Element
624−pStyle sty m = mknode "w:pStyle" [("w:val",sty')] ()
625− where
626− sty' = getStyleId sty $ sParaStyleMap m
627−
628623pCustomStyle :: String -> Element
629624pCustomStyle sty = mknode "w:pStyle" [("w:val",sty)] ()
630625
631626pStyleM :: String -> WS XML.Element
632−pStyleM = (`fmap` gets stStyleMaps) . pStyle
633−
634−rStyle :: String -> StyleMaps -> Element
635−rStyle sty m = mknode "w:rStyle" [("w:val",sty')] ()
636− where
637− sty' = getStyleId sty $ sCharStyleMap m
627+pStyleM styleName = do
628+ styleMaps <- gets stStyleMaps
629+ let sty' = getStyleId styleName $ sParaStyleMap styleMaps
630+ return $ mknode "w:pStyle" [("w:val",sty')] ()
638631
639632rCustomStyle :: String -> Element
640633rCustomStyle sty = mknode "w:rStyle" [("w:val",sty)] ()
641634
642635rStyleM :: String -> WS XML.Element
643−rStyleM = (`fmap` gets stStyleMaps) . rStyle
636+rStyleM styleName = do
637+ styleMaps <- gets stStyleMaps
638+ let sty' = getStyleId styleName $ sCharStyleMap styleMaps
639+ return $ mknode "w:rStyle" [("w:val",sty')] ()
644640
645641getUniqueId :: MonadIO m => m String
646642-- the + 20 is to ensure that there are no clashes with the rIds
@@ -689,10 +685,10 @@ blockToOpenXML opts (Para lst) = do
689685 paraProps <- getParaProps $ case lst of
690686 [Math DisplayMath _] -> True
691687 _ -> False
692− sm <- gets stStyleMaps
688+ bodyTextStyle <- pStyleM "Body Text"
693689 let paraProps' = case paraProps of
694690 [] | isFirstPara -> [mknode "w:pPr" [] [pCustomStyle "FirstParagraph"]]
695− [] -> [mknode "w:pPr" [] [pStyle "Body Text" sm]]
691+ [] -> [mknode "w:pPr" [] [bodyTextStyle]]
696692 ps -> ps
697693 modify $ \s -> s { stFirstPara = False }
698694 contents <- inlinesToOpenXML opts lst