X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=editor.js;h=9a3a2f5b59a36448a69a01ec54ab3354a2f5f3c5;hb=b9846ac6af1bcfa12e7a586df54789a571aa9ecc;hp=72e850670bc2b307ba81629cd02634ce1710556d;hpb=4ec99c39c0180df2d6380cb11c86b6e5f13292cf;p=peach-html5-editor.git diff --git a/editor.js b/editor.js index 72e8506..9a3a2f5 100644 --- a/editor.js +++ b/editor.js @@ -432,8 +432,13 @@ function instantiate_tree (tree, parent) { remove.unshift(i) // add to beginning so they are removed last first continue } - // TODO create in correct namespace - c.el = parent.ownerDocument.createElement(c.name) + if (c.namespace === 'svg') { + c.el = parent.ownerDocument.createElementNS('http://www.w3.org/2000/svg', c.name) + } else if (c.namespace === 'mathml') { + c.el = parent.ownerDocument.createElementNS('http://www.w3.org/1998/Math/MathML', c.name) + } else { + c.el = parent.ownerDocument.createElement(c.name) + } ref1 = c.attrs for (k in ref1) { v = ref1[k]