Skip to content

Commit

Permalink
Make preview of svg work.
Browse files Browse the repository at this point in the history
Add missing space and reference to `xmlns:xlink` in svg root node.
  • Loading branch information
Dave Smith committed Oct 21, 2020
1 parent b79ddca commit ba012b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/createSVG.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function htmlspecialchars(str) {
}

function renderPath(el, pathstring) {
return '<path class="nofill"' +
return '<path class="nofill" ' +
(el.id ?
('id="' + htmlspecialchars(el.id) + '" ') : '') +
'stroke-width="' + (el.size | 0) + '" ' +
Expand Down Expand Up @@ -130,6 +130,7 @@ async function toSVG(obj, writeable) {
}, [margin, margin]);
writeable.write(
'<svg xmlns="http://www.w3.org/2000/svg" version="1.1" ' +
'xmlns:xlink="http://www.w3.org/1999/xlink" ' +
'width="' + dim[0] + '" height="' + dim[1] + '">' +
'<defs><style type="text/css"><![CDATA[' +
'text {font-family:"Arial"}' +
Expand Down

0 comments on commit ba012b9

Please sign in to comment.