From 7d7ff165ced305bc269b24aa0ce8664272d86fa6 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Tue, 5 May 2020 00:13:43 +0300 Subject: Extract textSource text inside TextScanner (#500) * extract text inside TextScanner * clone textSource before text extraction --- ext/bg/js/search-query-parser.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ext/bg/js/search-query-parser.js') diff --git a/ext/bg/js/search-query-parser.js b/ext/bg/js/search-query-parser.js index 137234e8..935f01f2 100644 --- a/ext/bg/js/search-query-parser.js +++ b/ext/bg/js/search-query-parser.js @@ -51,8 +51,7 @@ class QueryParser extends TextScanner { async onSearchSource(textSource, cause) { if (textSource === null) { return null; } - this.setTextSourceScanLength(textSource, this.options.scanning.length); - const searchText = textSource.text(); + const searchText = this.getTextSourceContent(textSource, this.options.scanning.length); if (searchText.length === 0) { return; } const {definitions, length} = await apiTermsFind(searchText, {}, this.getOptionsContext()); -- cgit v1.2.3