diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-18 10:33:37 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-18 10:33:37 -0800 |
commit | 8eab759a9c72e98b8e47d7c4b19d6aeb3e24cdcb (patch) | |
tree | 4920140f776294e25fefb7a6a2cddba49e045bd5 /pandoc.hs | |
parent | 4aea26e8e1179a2feb1672256b1b9317d2c3baf8 (diff) | |
download | pandoc-8eab759a9c72e98b8e47d7c4b19d6aeb3e24cdcb.tar.gz |
RTF writer: Added writeRTFWithEmbeddedImages.
* RTF writer: Export writeRTFWithEmbeddedImages instead of
rtfEmbedImage.
* Text.Pandoc: Use writeRTFWithEmbeddedImages for RTF.
* Moved code for embedding images in RTF out of pandoc.hs.
Diffstat (limited to 'pandoc.hs')
-rw-r--r-- | pandoc.hs | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -1062,10 +1062,6 @@ main = do let doc0 = foldr ($) doc transforms - doc1 <- if "rtf" `isPrefixOf` writerName' - then bottomUpM rtfEmbedImage doc0 - else return doc0 - let writeBinary :: B.ByteString -> IO () writeBinary = B.writeFile (UTF8.encodePath outputFile) @@ -1075,15 +1071,15 @@ main = do case getWriter writerName' of Left e -> err 9 e - Right (IOStringWriter f) -> f writerOptions doc1 >>= writerFn outputFile - Right (IOByteStringWriter f) -> f writerOptions doc1 >>= writeBinary + Right (IOStringWriter f) -> f writerOptions doc0 >>= writerFn outputFile + Right (IOByteStringWriter f) -> f writerOptions doc0 >>= writeBinary Right (PureStringWriter f) | pdfOutput -> do - res <- tex2pdf latexEngine $ f writerOptions doc1 + res <- tex2pdf latexEngine $ f writerOptions doc0 case res of Right pdf -> writeBinary pdf Left err' -> err 43 $ UTF8.toStringLazy err' - | otherwise -> selfcontain (f writerOptions doc1 ++ + | otherwise -> selfcontain (f writerOptions doc0 ++ ['\n' | not standalone']) >>= writerFn outputFile . handleEntities where htmlFormat = writerName' `elem` |