From 565ca32d9ab029a954aa00f0372b4a0213da732b Mon Sep 17 00:00:00 2001 From: impinball Date: Wed, 16 Dec 2015 11:54:34 -0500 Subject: [PATCH] Fix issue with a placeholder --- mithril.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mithril.js b/mithril.js index 9f34467c..0401aad0 100644 --- a/mithril.js +++ b/mithril.js @@ -1245,13 +1245,12 @@ } })() - var placeholder = $document.createElement("span") - function injectHTML(parent, index, data) { var nextSibling = parent.childNodes[index] if (nextSibling) { if (nextSibling.nodeType !== 1) { + var placeholder = $document.createElement("span") parent.insertBefore(placeholder, nextSibling || null) placeholder.insertAdjacentHTML("beforebegin", data) parent.removeChild(placeholder)