From 68ffc7eb6db81d1a816c9d7b38cca6523ab3114c Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Mon, 11 Aug 2008 06:38:16 +0000 Subject: ODT writer: Use '/', even on Windows, as path separator in xlink attribute for images. Otherwise OpenOffice can't find the image files. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1403 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/ODT.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Text') diff --git a/Text/Pandoc/ODT.hs b/Text/Pandoc/ODT.hs index 5b900bf03..763625e24 100644 --- a/Text/Pandoc/ODT.hs +++ b/Text/Pandoc/ODT.hs @@ -129,11 +129,11 @@ handleContent tempODT sourceDirRelative content@(Elem el) = do then do let pref = take 230 $ concat $ intersperse "_" $ splitDirectories $ takeDirectory $ attrVal href - let newLoc = "Pictures" pref ++ "_" ++ (takeFileName $ attrVal href) + let picName = pref ++ "_" ++ (takeFileName $ attrVal href) let tempDir = takeDirectory tempODT - createDirectoryIfMissing False $ tempDir takeDirectory newLoc - copyFile oldLoc $ tempDir newLoc - let newAttrs = (href { attrVal = newLoc }) : rest + createDirectoryIfMissing False $ tempDir "Pictures" + copyFile oldLoc $ tempDir "Pictures" picName + let newAttrs = (href { attrVal = "Pictures/" ++ picName }) : rest return $ Elem (el { elAttribs = newAttrs }) else do hPutStrLn stderr $ "Warning: Unable to find image at " ++ oldLoc ++ " - ignoring." -- cgit v1.2.3