git.iko.soy/typeable/pandoc
on master help sign in
ConTeXt writer: change `\` to `/` in Windows image paths.

We do this in the LaTeX writer, and it avoids problems. Note that `/` works as a LaTeX path separator on Windows. Closes #4918.

commit5b1fdeaf41d6ee4b6b82cbeb4e7f7508182b3566 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 20 Sep 2018, 09:35 (8 years ago) parent136bf90
1 file changed+6−1
src/Text/Pandoc/Writers/ConTeXt.hs+6−1
src/Text/Pandoc/Writers/ConTeXt.hs+6−1
@@ -453,7 +453,12 @@ inlineToConTeXt (Image attr@(_,cls,_) _ (src, _)) = do
453453 clas = if null cls
454454 then empty
455455 else brackets $ text $ toLabel $ head cls
456− src' = if isURI src
456+ -- Use / for path separators on Windows; see #4918
457+ fixPathSeparators = map $ \c -> case c of
458+ '\\' -> '/'
459+ c -> c
460+ src' = fixPathSeparators $
461+ if isURI src
457462 then src
458463 else unEscapeString src
459464 return $ braces $ "\\externalfigure" <> brackets (text src') <> dims <> clas