@@ -543,7 +543,7 @@ inlineToOpenXML opts (SmallCaps lst) =
543inlineToOpenXML opts (Strikeout lst) =
543inlineToOpenXML opts (Strikeout lst) =
544 withTextProp (mknode "w:strike" [] ())
544 withTextProp (mknode "w:strike" [] ())
545 $ inlinesToOpenXML opts lst
545 $ inlinesToOpenXML opts lst
546−inlineToOpenXML _ LineBreak = return [ mknode "w:br" [] () ]
546+inlineToOpenXML _ LineBreak = return [br]
547inlineToOpenXML _ (RawInline f str)
547inlineToOpenXML _ (RawInline f str)
548 | f == "openxml" = return [ x | Elem x <- parseXML str ]
548 | f == "openxml" = return [ x | Elem x <- parseXML str ]
549 | otherwise = return []
549 | otherwise = return []
@@ -562,16 +562,14 @@ inlineToOpenXML opts (Math DisplayMath str) =
562 Left _ -> do
562 Left _ -> do
563 fallback <- inlinesToOpenXML opts (readTeXMath str)
563 fallback <- inlinesToOpenXML opts (readTeXMath str)
564 return $ [br] ++ fallback ++ [br]
564 return $ [br] ++ fallback ++ [br]
565− where br = mknode "w:br" [] ()
566inlineToOpenXML opts (Cite _ lst) = inlinesToOpenXML opts lst
565inlineToOpenXML opts (Cite _ lst) = inlinesToOpenXML opts lst
567inlineToOpenXML _ (Code attrs str) =
566inlineToOpenXML _ (Code attrs str) =
568 withTextProp (rStyle "VerbatimChar")
567 withTextProp (rStyle "VerbatimChar")
569 $ case highlight formatOpenXML attrs str of
568 $ case highlight formatOpenXML attrs str of
570− Nothing -> intercalate [mknode "w:br" [] ()]
569+ Nothing -> intercalate [br]
571 `fmap` (mapM formattedString $ lines str)
570 `fmap` (mapM formattedString $ lines str)
572 Just h -> return h
571 Just h -> return h
573− where formatOpenXML _fmtOpts = intercalate [mknode "w:br" [] ()] .
572+ where formatOpenXML _fmtOpts = intercalate [br] . map (map toHlTok)
575 toHlTok (toktype,tok) = mknode "w:r" []
573 toHlTok (toktype,tok) = mknode "w:r" []
576 [ mknode "w:rPr" []
574 [ mknode "w:rPr" []
577 [ rStyle $ show toktype ]
575 [ rStyle $ show toktype ]
@@ -669,3 +667,6 @@ inlineToOpenXML opts (Image alt (src, tit)) = do
669 liftIO $ UTF8.hPutStrLn stderr $
667 liftIO $ UTF8.hPutStrLn stderr $
670 "Could not find image `" ++ src ++ "', skipping..."
668 "Could not find image `" ++ src ++ "', skipping..."
671 inlinesToOpenXML opts alt
669 inlinesToOpenXML opts alt
672+br = mknode "w:r" [] [mknode "w:cr" [] () ]