summaryrefslogtreecommitdiff
path: root/ext/mixed/js/text-scanner.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed/js/text-scanner.js')
-rw-r--r--ext/mixed/js/text-scanner.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/mixed/js/text-scanner.js b/ext/mixed/js/text-scanner.js
index f0903370..daea6a6c 100644
--- a/ext/mixed/js/text-scanner.js
+++ b/ext/mixed/js/text-scanner.js
@@ -198,8 +198,10 @@ class TextScanner extends EventDispatcher {
clonedTextSource.setEndOffset(length, layoutAwareScan);
- if (this._excludeSelector !== null) {
- this._constrainTextSource(clonedTextSource, this._includeSelector, this._excludeSelector, layoutAwareScan);
+ const includeSelector = this._includeSelector;
+ const excludeSelector = this._excludeSelector;
+ if (includeSelector !== null || excludeSelector !== null) {
+ this._constrainTextSource(clonedTextSource, includeSelector, excludeSelector, layoutAwareScan);
}
return clonedTextSource.text();