git.iko.soy/typeable/pandoc
on master help sign in
Merge branch 'master' of github.com:jgm/pandoc
commit454b8ebb966710edd9bcc2c61733515491026baf authorJohn MacFarlane <jgm@berkeley.edu> dateFri 17 Aug 2012, 18:55 (14 years ago) parentfa99793fd61666
1 file changed+6−5
src/Text/Pandoc/Writers/Docx.hs+6−5
src/Text/Pandoc/Writers/Docx.hs+6−5
@@ -543,7 +543,7 @@ inlineToOpenXML opts (SmallCaps lst) =
543543inlineToOpenXML opts (Strikeout lst) =
544544 withTextProp (mknode "w:strike" [] ())
545545 $ inlinesToOpenXML opts lst
546−inlineToOpenXML _ LineBreak = return [ mknode "w:br" [] () ]
546+inlineToOpenXML _ LineBreak = return [br]
547547inlineToOpenXML _ (RawInline f str)
548548 | f == "openxml" = return [ x | Elem x <- parseXML str ]
549549 | otherwise = return []
@@ -562,16 +562,14 @@ inlineToOpenXML opts (Math DisplayMath str) =
562562 Left _ -> do
563563 fallback <- inlinesToOpenXML opts (readTeXMath str)
564564 return $ [br] ++ fallback ++ [br]
565− where br = mknode "w:br" [] ()
566565inlineToOpenXML opts (Cite _ lst) = inlinesToOpenXML opts lst
567566inlineToOpenXML _ (Code attrs str) =
568567 withTextProp (rStyle "VerbatimChar")
569568 $ case highlight formatOpenXML attrs str of
570− Nothing -> intercalate [mknode "w:br" [] ()]
569+ Nothing -> intercalate [br]
571570 `fmap` (mapM formattedString $ lines str)
572571 Just h -> return h
573− where formatOpenXML _fmtOpts = intercalate [mknode "w:br" [] ()] .
574− map (map toHlTok)
572+ where formatOpenXML _fmtOpts = intercalate [br] . map (map toHlTok)
575573 toHlTok (toktype,tok) = mknode "w:r" []
576574 [ mknode "w:rPr" []
577575 [ rStyle $ show toktype ]
@@ -669,3 +667,6 @@ inlineToOpenXML opts (Image alt (src, tit)) = do
669667 liftIO $ UTF8.hPutStrLn stderr $
670668 "Could not find image `" ++ src ++ "', skipping..."
671669 inlinesToOpenXML opts alt
670+
671+br :: Element
672+br = mknode "w:r" [] [mknode "w:cr" [] () ]