aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/ConTeXt.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs
index 763f1a370..4947d7f79 100644
--- a/src/Text/Pandoc/Writers/ConTeXt.hs
+++ b/src/Text/Pandoc/Writers/ConTeXt.hs
@@ -453,7 +453,12 @@ inlineToConTeXt (Image attr@(_,cls,_) _ (src, _)) = do
clas = if null cls
then empty
else brackets $ text $ toLabel $ head cls
- src' = if isURI src
+ -- Use / for path separators on Windows; see #4918
+ fixPathSeparators = map $ \c -> case c of
+ '\\' -> '/'
+ c -> c
+ src' = fixPathSeparators $
+ if isURI src
then src
else unEscapeString src
return $ braces $ "\\externalfigure" <> brackets (text src') <> dims <> clas