This is an automated email from the ASF dual-hosted git repository.

gerben pushed a commit to branch tweak-highlighter
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git

commit a8fe93e147ddd484cd972fdaa6d3f4085788e300
Author: Gerben <[email protected]>
AuthorDate: Thu Jul 23 14:12:29 2020 +0200

    Support highlighting empty ranges
    
    Can be useful to mark a specific point in a text. And if ignoring
    collapsed ranges is desirable, the user can just check whether
    range.collapsed is true.
---
 packages/dom/src/highlight-range.ts | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/packages/dom/src/highlight-range.ts 
b/packages/dom/src/highlight-range.ts
index 043d739..90b3efa 100644
--- a/packages/dom/src/highlight-range.ts
+++ b/packages/dom/src/highlight-range.ts
@@ -55,9 +55,6 @@ export function highlightRange(
 
 // Return an array of the text nodes in the range. Split the start and end 
nodes if required.
 function textNodesInRange(range: Range): Text[] {
-  // If the range is empty, avoid creating and returning an empty text node.
-  if (range.collapsed) return [];
-
   // If the start or end node is a text node and only partly in the range, 
split it.
   if (
     isTextNode(range.startContainer) &&

Reply via email to