aboutsummaryrefslogtreecommitdiff
path: root/Text
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-08-11 06:38:16 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-08-11 06:38:16 +0000
commit68ffc7eb6db81d1a816c9d7b38cca6523ab3114c (patch)
tree5c35c9aca0e3327a2f64673b259e7544ed2bc8ed /Text
parent2a1406a9337cbdc0c741d1e09a946144fbebc50b (diff)
downloadpandoc-68ffc7eb6db81d1a816c9d7b38cca6523ab3114c.tar.gz
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
Diffstat (limited to 'Text')
-rw-r--r--Text/Pandoc/ODT.hs8
1 files changed, 4 insertions, 4 deletions
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."