[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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user