Do not close <object> tag using shorthand
[mirrors/DokuWiki-Plugin-SVGEdit.git] / syntax.php
index b536cabfff29c3178dc6f4cff7b7b96169195751..d45b3be4d2ae1b15006b008b86bc84dd4e0fabf3 100755 (executable)
@@ -57,12 +57,11 @@ class syntax_plugin_svgedit extends DokuWiki_Syntax_Plugin {
 
                                //use object tag for stupid browsers (like firefox) - ugly (relies on browser identification)
                                $is_webkit= preg_match('/webkit/', strtolower($_SERVER['HTTP_USER_AGENT']));
-                               if ($is_webkit)
-                                       $svgtag='img src';
-                               else
-                                       $svgtag='object '.$svg_parameters.' data';
+                               if ($is_webkit) $svgtag='img src';
+                               else $svgtag='object '.$svg_parameters.' data';
+                               $svgtag_close = array_shift(preg_split('/ /', $svgtag, 2));
 
-                               return '<a href="'.$svglink.'" type="image/svg+xml" /><'.$svgtag.'="'.$svglink.'" alt="'.$title.'" title="'.$title.'" type="image/svg+xml" /></a>'."<br />";
+                               return '<a href="'.$svglink.'" type="image/svg+xml" /><'.$svgtag.'="'.$svglink.'" alt="'.$title.'" title="'.$title.'" type="image/svg+xml">'."</$svgtag_close></a><br />";
                }
 
     function render($format, &$renderer, $data) {
@@ -70,6 +69,7 @@ class syntax_plugin_svgedit extends DokuWiki_Syntax_Plugin {
                                global $ID;
 
                                $svg_wiki_page = trim(substr($data[1], 6, -2)); //name of wiki page containing SVG image
+                               resolve_pageid(getNS($ID),$svg_wiki_page,$exists); //resolve relative IDs
 
                                //detect image size for stupid browsers (like firefox) - ugly (fails if svg does not contain information about it's size)
                                $svg_dimensions = '';
This page took 0.104478 seconds and 4 git commands to generate.