[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:
Nicolas Lempereur
2015-11-16 16:02:45 +01:00
parent 3dd79b3d65
commit b820faed66
@@ -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
*