EditCheck: Exclude nodes that aren't at the document root (i.e. image captions, table cells)

Bug: T340086
Change-Id: I8f5343f908efb3d39f20be97d132b146115910f9
This commit is contained in:
Ed Sanders 2023-07-01 14:14:19 +01:00
parent 68983da916
commit fc41331470

View file

@ -38,6 +38,11 @@ mw.editcheck.doesAddedContentNeedReference = function ( documentModel ) {
return false;
}
}
// 3. Exclude any ranges that aren't at the document root (i.e. image captions, table cells)
var branchNode = documentModel.getBranchNodeFromOffset( range.start );
if ( branchNode.getParent() !== documentModel.attachedRoot ) {
return false;
}
return true;
}
return false;