From bbb4c333fbeb90ae173008be715a7267b0d2515e Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Wed, 7 Jun 2017 00:11:16 -0400 Subject: [PATCH] create wysiwyg elements in correct namespace --- editor.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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] -- 1.7.10.4