make sure ranges are created over text nodes only (fixes #80)
This commit is contained in:
parent
e90274519a
commit
0554aa0d27
@ -86,7 +86,7 @@ function docRangeFromPoint(point) {
|
||||
}
|
||||
|
||||
const range = document.caretRangeFromPoint(point.x, point.y);
|
||||
if (range) {
|
||||
if (range && range.startContainer.nodeType === 3 && range.endContainer.nodeType === 3) {
|
||||
return new TextSourceRange(range);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user