git.iko.soy/typeable/pandoc
on master help sign in
Fixed ICML image syntax for local files.

`file:filename` rather than `file://./filename`. I think this is right; it matches what we had before with people actually using the ICML writer, and seems to match examples in the spec. I don't have a copy of InDesign I can test on, though. @DigitalPublishingToolkit and @mb21, can you have a look?

commita924a3f43d25b34ddd46da2100732ee077779785 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 13 Dec 2015, 20:15 (11 years ago) parent90b8024
2 files changed+3−3
src/Text/Pandoc/Writers/ICML.hs+1−1 tests/writer.icml+2−2
src/Text/Pandoc/Writers/ICML.hs+1−1
@@ -533,7 +533,7 @@ imageICML opts style attr _ (src, _) = do
533533 hw = showFl $ ow / 2
534534 hh = showFl $ oh / 2
535535 scale = showFl (imgWidth / ow) ++ " 0 0 " ++ showFl (imgHeight / oh)
536− src' = if isURI src then src else "file://." ++ pathSeparator : src
536+ src' = if isURI src then src else "file:" ++ src
537537 (stlStr, attrs) = styleToStrAttr style
538538 props = inTags True "Properties" [] $ inTags True "PathGeometry" []
539539 $ inTags True "GeometryPathType" [("PathOpen","false")]
tests/writer.icml+2−2
@@ -2563,7 +2563,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{</Content>
25632563 $ID/Embedded
25642564 </Profile>
25652565 </Properties>
2566− <Link Self="ueb" LinkResourceURI="file://./lalune.jpg" />
2566+ <Link Self="ueb" LinkResourceURI="file:lalune.jpg" />
25672567 </Image>
25682568 </Rectangle>
25692569 </CharacterStyleRange><Br />
@@ -2592,7 +2592,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{</Content>
25922592 $ID/Embedded
25932593 </Profile>
25942594 </Properties>
2595− <Link Self="ueb" LinkResourceURI="file://./movie.jpg" />
2595+ <Link Self="ueb" LinkResourceURI="file:movie.jpg" />
25962596 </Image>
25972597 </Rectangle>
25982598 </CharacterStyleRange>