Document the reason for the possibleParents map
This commit is contained in:
parent
9ece9a9297
commit
d21ba5ee6a
1 changed files with 5 additions and 0 deletions
|
|
@ -67,6 +67,11 @@ module.exports = function($window) {
|
|||
var possibleParents = {caption: "table", thead: "table", tbody: "table", tfoot: "table", tr: "tbody", th: "tr", td: "tr", colgroup: "table", col: "colgroup"}
|
||||
function createHTML(parent, vnode, ns, nextSibling) {
|
||||
var match = vnode.children.match(/^\s*?<(\w+)/im) || []
|
||||
// not using the proper parent makes the child element(s) vanish.
|
||||
// var div = document.createElement("div")
|
||||
// div.innerHTML = "<td>i</td><td>j</td>"
|
||||
// console.log(div.innerHTML)
|
||||
// --> "ij", no <td> in sight.
|
||||
var temp = $doc.createElement(possibleParents[match[1]] || "div")
|
||||
if (ns === "http://www.w3.org/2000/svg") {
|
||||
temp.innerHTML = "<svg xmlns=\"http://www.w3.org/2000/svg\">" + vnode.children + "</svg>"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue