From: Peter Vazsonyi Date: Fri, 18 Jun 2010 23:10:36 +0000 (+0200) Subject: F: inline svg in firefox _and_ chrome/epiphany X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=ff374ce11a958822e5a9494592d3aa129becc6c3;p=mirrors%2FDokuWiki-Plugin-SVGEdit.git F: inline svg in firefox _and_ chrome/epiphany --- diff --git a/syntax.php b/syntax.php index 2d9e69e..cc19454 100755 --- a/syntax.php +++ b/syntax.php @@ -52,23 +52,26 @@ class syntax_plugin_svgedit extends DokuWiki_Syntax_Plugin { if ($format!='xhtml') return; global $ID; +// $renderer->doc .= ""; + $is_webkit= preg_match('/webkit/', strtolower($_SERVER['HTTP_USER_AGENT']) ); // dirty, but fast /n3k/ + if ($is_webkit) { $svgtag='svg-image@'.$ID.''."
"; + $renderer->doc .= ''.$svgtag.$svgenc.'" alt="svg-image@'.$ID.'" />'."
"; return true; } if($data[0]==='{{sv') { $data[1] = trim(substr($data[1], 6, -2)); $svgenc = exportlink($data[1],'svg'); - $renderer->doc .= 'image:'.htmlspecialchars($data[1]).'
'; - //$renderer->doc .= 'image:'.htmlspecialchars($data[1]).'
'; //scrollbars on webkit :-( + $renderer->doc .= ''.$svgtag.$svgenc.'" alt="image:'.htmlspecialchars($data[1]).'" type="image/svg+xml"/>
'; $renderer->doc .= html_wikilink($data[1],'svg@'.$data[1]); return true; } if($data[0]==='{{SV') { $data[1] = trim(substr($data[1], 6, -2)); $svgenc = 'data:image/svg+xml;base64,'.base64_encode(rawWiki($data[1])).'" type="image/svg+xml'; - $renderer->doc .= 'image:'.htmlspecialchars($data[1]).'
'; + $renderer->doc .= ''.$svgtag.$svgenc.'" alt="image:'.htmlspecialchars($data[1]).'" />
'; $renderer->doc .= html_wikilink($data[1],'SVG@'.$data[1]); return true; }