From d21ba5ee6a8921e48cb89cbbc4f05547d039d6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Yves=20G=C3=A9rardy?= Date: Tue, 6 Mar 2018 02:12:02 +0100 Subject: [PATCH] Document the reason for the possibleParents map --- render/render.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/render/render.js b/render/render.js index 98e0f4d1..7a674c3c 100644 --- a/render/render.js +++ b/render/render.js @@ -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 = "ij" + // console.log(div.innerHTML) + // --> "ij", no in sight. var temp = $doc.createElement(possibleParents[match[1]] || "div") if (ns === "http://www.w3.org/2000/svg") { temp.innerHTML = "" + vnode.children + ""