From 14921a78e68db5caac35cbf7b225d5176662a598 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 23 Aug 2020 22:20:53 +0200 Subject: [PATCH] Avoid, adding to components, empty parsed HTML strings --- src/dom_components/model/Components.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dom_components/model/Components.js b/src/dom_components/model/Components.js index de54866cd..d6b9689f1 100644 --- a/src/dom_components/model/Components.js +++ b/src/dom_components/model/Components.js @@ -121,7 +121,8 @@ export default Backbone.Collection.extend({ } else if (isArray(models)) { models.forEach((item, index) => { if (isString(item)) { - models[index] = this.parseString(item, opt); + const nodes = this.parseString(item, opt); + models[index] = isArray(nodes) && !nodes.length ? null : nodes; } }); }