From a9bedcc69dae9790ad910285d5c75c2e4314d033 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 10 Jan 2011 15:42:52 -0700 Subject: [PATCH] change Scribble HTML to use `object' tag for SVG --- collects/scribble/html-render.rkt | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/collects/scribble/html-render.rkt b/collects/scribble/html-render.rkt index bf0dde4760..64ca8c1d15 100644 --- a/collects/scribble/html-render.rkt +++ b/collects/scribble/html-render.rkt @@ -1004,14 +1004,21 @@ [height ,(to-num (read-bytes 4 in))])] [else null])))])]) - `((,(if svg? 'iframe 'img) - ([src ,(let ([p (install-file src)]) - (if (path? p) - (url->string (path->url (path->complete-path p))) - p))] - [alt ,(content->string (element-content e))] - ,@sz - ,@(attribs)))))] + (let ([srcref (let ([p (install-file src)]) + (if (path? p) + (url->string (path->url (path->complete-path p))) + p))]) + `((,(if svg? 'object 'img) + ([,(if svg? 'data 'src) ,srcref] + [alt ,(content->string (element-content e))] + ,@(if svg? + `([type "image/svg+xml"]) + null) + ,@sz + ,@(attribs)) + ,@(if svg? + `((param ([name "src"] [value ,srcref]))) + null)))))] [(and (or (element? e) (multiarg-element? e)) (ormap (lambda (v) (and (script-property? v) v)) (let ([s (if (element? e)