From: Jason Woofenden Date: Wed, 7 Jun 2017 04:11:16 +0000 (-0400) Subject: create wysiwyg elements in correct namespace X-Git-Url: https://jasonwoof.com/gitweb/?p=peach-html5-editor.git;a=commitdiff_plain;h=bbb4c333fbeb90ae173008be715a7267b0d2515e create wysiwyg elements in correct namespace --- 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]