Skip to content

Commit 472d4df

Browse files
committed
Respect given image dimensions
1 parent e9315e0 commit 472d4df

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

syntax.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@ public function render($format, Doku_Renderer $renderer, $data)
5555
{
5656
if ($format !== 'xhtml') return false;
5757

58-
$renderer->doc .=
59-
'<object data="'
60-
. ml($data['src'])
61-
. '&cache=nocache'
62-
.'" type="image/svg+xml" class="diagrams-svg media'
63-
. $data['align']
64-
.'" ></object>';
58+
$width = $data['width'] ? 'width="' . $data['width'] . '"' : '';
59+
$height = $data['height'] ? 'height="' . $data['height'] . '"' : '';
60+
61+
$tag = '<object data="%s&cache=nocache" type="image/svg+xml" class="diagrams-svg media%s" %s %s></object>';
62+
$renderer->doc .= sprintf($tag, ml($data['src']), $data['align'], $width, $height);
6563

6664
return true;
6765
}

0 commit comments

Comments
 (0)