git.iko.soy/typeable/pandoc
on master help sign in
ODT writer: Use '/', even on Windows, as path separator in xlink attribute
68ffc7efiddlosopher
Text/Pandoc/ODT.hs+4−4
@@ -129,11 +129,11 @@ handleContent tempODT sourceDirRelative content@(Elem el) = do
129 then do
129 then do
130 let pref = take 230 $ concat $ intersperse "_" $
130 let pref = take 230 $ concat $ intersperse "_" $
131 splitDirectories $ takeDirectory $ attrVal href
131 splitDirectories $ takeDirectory $ attrVal href
132− let newLoc = "Pictures" </> pref ++ "_" ++ (takeFileName $ attrVal href)
132+ let picName = pref ++ "_" ++ (takeFileName $ attrVal href)
133 let tempDir = takeDirectory tempODT
133 let tempDir = takeDirectory tempODT
134− createDirectoryIfMissing False $ tempDir </> takeDirectory newLoc
134+ createDirectoryIfMissing False $ tempDir </> "Pictures"
135− copyFile oldLoc $ tempDir </> newLoc
135+ copyFile oldLoc $ tempDir </> "Pictures" </> picName
136− let newAttrs = (href { attrVal = newLoc }) : rest
136+ let newAttrs = (href { attrVal = "Pictures/" ++ picName }) : rest
137 return $ Elem (el { elAttribs = newAttrs })
137 return $ Elem (el { elAttribs = newAttrs })
138 else do
138 else do
139 hPutStrLn stderr $ "Warning: Unable to find image at " ++ oldLoc ++ " - ignoring."
139 hPutStrLn stderr $ "Warning: Unable to find image at " ++ oldLoc ++ " - ignoring."