@@ -25,6 +25,7 @@ import Data.List (isPrefixOf, isInfixOf, stripPrefix)
2525import Data.Text as Text (breakOnAll, pack)
2626import Data.Monoid (mappend)
2727import Control.Monad.State
28+import Network.URI (isURI)
2829import qualified Data.Set as Set
2930
3031type Style = [String]
@@ -499,6 +500,7 @@ imageICML _ style _ (linkURI, _) =
499500 hh = show $ imgHeight `div` 2
500501 qw = show $ imgWidth `div` 4
501502 qh = show $ imgHeight `div` 4
503+ uriPrefix = if isURI linkURI then "" else "file:"
502504 (stlStr, attrs) = styleToStrAttr style
503505 props = inTags True "Properties" [] $ inTags True "PathGeometry" []
504506 $ inTags True "GeometryPathType" [("PathOpen","false")]
@@ -518,7 +520,7 @@ imageICML _ style _ (linkURI, _) =
518520 $ vcat [
519521 inTags True "Properties" [] $ inTags True "Profile" [("type","string")] $ text "$ID/Embedded"
520522 $$ selfClosingTag "GraphicBounds" [("Left","0"), ("Top","0"), ("Right", hw), ("Bottom", hh)]
521− , selfClosingTag "Link" [("Self", "ueb"), ("LinkResourceURI", linkURI)]
523+ , selfClosingTag "Link" [("Self", "ueb"), ("LinkResourceURI", uriPrefix++linkURI)]
522524 ]
523525 doc = inTags True "CharacterStyleRange" attrs
524526 $ inTags True "Rectangle" [("Self","uec"), ("ItemTransform", "1 0 0 1 "++qw++" -"++qh)]