Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
peach-html5-editor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c5e1c67
)
create wysiwyg elements in correct namespace
author
Jason Woofenden
<jason@jasonwoof.com>
Wed, 7 Jun 2017 04:11:16 +0000
(
00:11
-0400)
committer
Jason Woofenden
<jason@jasonwoof.com>
Wed, 7 Jun 2017 04:11:16 +0000
(
00:11
-0400)
editor.js
patch
|
blob
|
history
diff --git
a/editor.js
b/editor.js
index
72e8506
..
9a3a2f5
100644
(file)
--- 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
}
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]
ref1 = c.attrs
for (k in ref1) {
v = ref1[k]