Skip to content

Improve performance for large documents with many annotations #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions packages/dom/src/text-node-chunker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ export class EmptyScopeError extends TypeError {
}
}

export class OutOfScopeError extends TypeError {
constructor(message?: string) {
super(
message ||
'Cannot convert node to chunk, as it falls outside of chunker’s scope.',
);
}
}

export class TextNodeChunker implements Chunker<PartialTextNode> {
private scope: Range;
private iter: NodeIterator;
Expand All @@ -61,8 +52,6 @@ export class TextNodeChunker implements Chunker<PartialTextNode> {
}

nodeToChunk(node: Text): PartialTextNode {
if (!this.scope.intersectsNode(node)) throw new OutOfScopeError();

const startOffset =
node === this.scope.startContainer ? this.scope.startOffset : 0;
const endOffset =
Expand Down