diff --git a/plugin/js/Util.js b/plugin/js/Util.js index e971d0ca..f2ee61c8 100644 --- a/plugin/js/Util.js +++ b/plugin/js/Util.js @@ -128,7 +128,7 @@ var util = (function () { // discard empty divs created when moving elements var removeEmptyDivElements = function(element) { - util.removeElements(util.getElements(element, "div", e => util.isStringWhiteSpace(e.innerHTML))); + util.removeElements(util.getElements(element, "div", e => util.isElementWhiteSpace(e))); } var removeTrailingWhiteSpace = function(element) { diff --git a/unitTest/UtestUtil.js b/unitTest/UtestUtil.js index 766644a7..e90c03f1 100644 --- a/unitTest/UtestUtil.js +++ b/unitTest/UtestUtil.js @@ -11,13 +11,14 @@ test("removeEmptyDivElements", function (assert) { "

H1

" + "
" + "
\n\n\n
" + + "
" + "" + "", "text/html"); - let content = dom.body.cloneNode(true); + let content = dom.body; util.removeEmptyDivElements(content); - assert.equal(content.innerHTML, "

H1

"); + assert.equal(content.innerHTML, "

H1

"); }); test("removeScriptableElements", function (assert) {