@@ -620,27 +620,23 @@ writeOpenXML opts (Pandoc meta blocks) = do
620blocksToOpenXML :: WriterOptions -> [Block] -> WS [Element]
620blocksToOpenXML :: WriterOptions -> [Block] -> WS [Element]
621blocksToOpenXML opts bls = concat `fmap` mapM (blockToOpenXML opts) bls
621blocksToOpenXML opts bls = concat `fmap` mapM (blockToOpenXML opts) bls
623−pStyle :: String -> StyleMaps -> Element
624−pStyle sty m = mknode "w:pStyle" [("w:val",sty')] ()
626− sty' = getStyleId sty $ sParaStyleMap m
628pCustomStyle :: String -> Element
623pCustomStyle :: String -> Element
629pCustomStyle sty = mknode "w:pStyle" [("w:val",sty)] ()
624pCustomStyle sty = mknode "w:pStyle" [("w:val",sty)] ()
631pStyleM :: String -> WS XML.Element
626pStyleM :: String -> WS XML.Element
627+pStyleM styleName = do
632−pStyleM = (`fmap` gets stStyleMaps) . pStyle
628+ styleMaps <- gets stStyleMaps
633−
629+ let sty' = getStyleId styleName $ sParaStyleMap styleMaps
634−rStyle :: String -> StyleMaps -> Element
630+ return $ mknode "w:pStyle" [("w:val",sty')] ()
635−rStyle sty m = mknode "w:rStyle" [("w:val",sty')] ()
637− sty' = getStyleId sty $ sCharStyleMap m
639rCustomStyle :: String -> Element
632rCustomStyle :: String -> Element
640rCustomStyle sty = mknode "w:rStyle" [("w:val",sty)] ()
633rCustomStyle sty = mknode "w:rStyle" [("w:val",sty)] ()
642rStyleM :: String -> WS XML.Element
635rStyleM :: String -> WS XML.Element
636+rStyleM styleName = do
643−rStyleM = (`fmap` gets stStyleMaps) . rStyle
637+ styleMaps <- gets stStyleMaps
638+ let sty' = getStyleId styleName $ sCharStyleMap styleMaps
639+ return $ mknode "w:rStyle" [("w:val",sty')] ()
645getUniqueId :: MonadIO m => m String
641getUniqueId :: MonadIO m => m String
646-- the + 20 is to ensure that there are no clashes with the rIds
642-- the + 20 is to ensure that there are no clashes with the rIds
@@ -689,10 +685,10 @@ blockToOpenXML opts (Para lst) = do
689 paraProps <- getParaProps $ case lst of
685 paraProps <- getParaProps $ case lst of
690 [Math DisplayMath _] -> True
686 [Math DisplayMath _] -> True
691 _ -> False
687 _ -> False
692− sm <- gets stStyleMaps
688+ bodyTextStyle <- pStyleM "Body Text"
693 let paraProps' = case paraProps of
689 let paraProps' = case paraProps of
694 [] | isFirstPara -> [mknode "w:pPr" [] [pCustomStyle "FirstParagraph"]]
690 [] | isFirstPara -> [mknode "w:pPr" [] [pCustomStyle "FirstParagraph"]]
695− [] -> [mknode "w:pPr" [] [pStyle "Body Text" sm]]
691+ [] -> [mknode "w:pPr" [] [bodyTextStyle]]
697 modify $ \s -> s { stFirstPara = False }
693 modify $ \s -> s { stFirstPara = False }
698 contents <- inlinesToOpenXML opts lst
694 contents <- inlinesToOpenXML opts lst