Commit 201a2eb2 authored by Robert Knight's avatar Robert Knight

Fix typechecking errors in src/annotator/anchoring/text-position.js

parent 8a0d63a7
...@@ -28,19 +28,21 @@ export function toRange(root, start, end) { ...@@ -28,19 +28,21 @@ export function toRange(root, start, end) {
root, root,
NodeFilter.SHOW_TEXT, NodeFilter.SHOW_TEXT,
null, // filter null, // filter
// @ts-ignore - Ignored parameter required for IE 11
false // expandEntityReferences false // expandEntityReferences
); );
let startContainer; let startContainer;
let startOffset; let startOffset = 0;
let endContainer; let endContainer;
let endOffset; let endOffset = 0;
let textLength = 0; let textLength = 0;
let node; let node;
while ((node = nodeIter.nextNode()) && (!startContainer || !endContainer)) { while ((node = nodeIter.nextNode()) && (!startContainer || !endContainer)) {
const nodeText = node.nodeValue; const nodeText = /** @type {string} */ (node.nodeValue);
if ( if (
!startContainer && !startContainer &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment