[FIX] web_editor: italic odd behavior because typo

An italic node would be taken as a basic node containing text and thus
would be merged unexpectedly.

For example with the following content : "<i>hello</i> world" removing a
letter of 'world' would merge the text node with hello making it italic.

opw-703722
This commit is contained in:
Nicolas Lempereur
2017-01-11 10:38:29 +01:00
parent cd4ff9341e
commit 2c66f7bc7f
@@ -134,7 +134,7 @@ dom.hasProgrammaticStyle = function (node) {
};
dom.mergeFilter = function (prev, cur, parent) {
// merge text nodes
if (prev && (dom.isText(prev) || ("H1 H2 H3 H4 H5 H6 LI P".indexOf(prev.tagName) !== -1 && prev !== cur.parentNode)) && dom.isText(cur)) {
if (prev && (dom.isText(prev) || (['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'LI', 'P'].indexOf(prev.tagName) !== -1 && prev !== cur.parentNode)) && dom.isText(cur)) {
return true;
}
if (prev && prev.tagName === "P" && dom.isText(cur)) {