[FIX] web_editor: don't think HTML comment are visible
Summernote sometimes doesn't take into account HTML comment could be embedded in the edited content, this can lead to issue since this situation can happen in Odoo. This commit patch the "isVisiblePoint" summernote's function to take care of this issue. opw-656332
This commit is contained in:
@@ -676,6 +676,13 @@ dom.isFont = function (node) {
|
||||
dom.isVisibleText = function (textNode) {
|
||||
return !!textNode.textContent.match(/\S|\u00A0/);
|
||||
};
|
||||
|
||||
/* avoid thinking HTML comment are visible */
|
||||
var old_isVisiblePoint = dom.isVisiblePoint;
|
||||
dom.isVisiblePoint = function (point) {
|
||||
return point.node.nodeType !== 8 && old_isVisiblePoint.apply(this, arguments);
|
||||
};
|
||||
|
||||
/**
|
||||
* order the style of the node to compare 2 nodes and remove attribute if empty
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user