You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@annotator.apache.org by ge...@apache.org on 2021/07/09 15:35:18 UTC

[incubator-annotator] 02/02: Add warning about issue #112.

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

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

commit 647502382dd9d7e893c56ee0965a7179dfb3f7b4
Author: Gerben <ge...@treora.com>
AuthorDate: Fri Jul 9 17:32:39 2021 +0200

    Add warning about issue #112.
---
 packages/dom/src/text-quote/match.ts           | 4 ++++
 packages/selector/src/text/match-text-quote.ts | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/packages/dom/src/text-quote/match.ts b/packages/dom/src/text-quote/match.ts
index 2b29df6..87ef5d2 100644
--- a/packages/dom/src/text-quote/match.ts
+++ b/packages/dom/src/text-quote/match.ts
@@ -40,6 +40,10 @@ import { TextNodeChunker, EmptyScopeError } from '../text-node-chunker';
  * return an (async) generator that produces each match in the order they are
  * found in the text.
  *
+ * *XXX Modifying the DOM (e.g. to highlight the text) while the search is still
+ * running can mess up and result in an error or an infinite loop. See [issue
+ * #112](https://github.com/apache/incubator-annotator/issues/112).*
+ *
  * @example
  * ```
  * // Find the word ‘banana’.
diff --git a/packages/selector/src/text/match-text-quote.ts b/packages/selector/src/text/match-text-quote.ts
index 0531369..78dd96a 100644
--- a/packages/selector/src/text/match-text-quote.ts
+++ b/packages/selector/src/text/match-text-quote.ts
@@ -45,6 +45,9 @@ import type { Chunk, Chunker, ChunkRange } from './chunker';
  * return an (async) generator that produces each match in the order they are
  * found in the text.
  *
+ * *XXX Modifying the Chunks while the search is still running can mess up and
+ * result in an error or an infinite loop. See [issue #112](https://github.com/apache/incubator-annotator/issues/112).*
+ *
  * @example
  * ```
  * const selector = { type: 'TextQuoteSelector', exact: 'banana' };