ziodave opened a new issue #111:
URL: https://github.com/apache/incubator-annotator/issues/111


   It looks that this change [1] is raising an exception that 
`range.startContainer is undefined`:
   
   
![image](https://user-images.githubusercontent.com/11438/123346537-d908c100-d558-11eb-8fd8-0f0af859799e.png)
   
   Because `range` is not a `Range` but an `Element`.
   
   This is the call stack:
   
   
![image](https://user-images.githubusercontent.com/11438/123346584-f2117200-d558-11eb-80df-51d9f05594b4.png)
   
   This is my test code:
   
   ```
   async function highlightMatcher(matcher: any) {
     const matches = matcher(
       // @ts-ignore
       document.body
     );
     for await (const match of matches) {
       highlightRange(match);
     }
   }
   
   highlightMatcher(
     createCssSelectorMatcher({
       value: "#my-div",
       type: "CssSelector",
     })
   );
   ```
   
   [1] 
https://github.com/apache/incubator-annotator/commit/7f9461da824297947196a34ac5c3af7e52e2caf7#diff-1a23dff7a2e2636f389f030fcf64a2a1f6b4f8c278a0c2b231a910906b4454a3R67


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to