diff options
author | James Maa <jmaa@berkeley.edu> | 2024-06-03 14:11:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-03 21:11:42 +0000 |
commit | e2fd3a7c5090747979662e21ebe0e575a2d4f9da (patch) | |
tree | 3ce1c8d17a837ddec74621e2c8bcfc80df6530c1 /ext/js/language | |
parent | 3a2a740b6517d18de726a44b75b34155fe8f1259 (diff) |
Add text length check to isTextLookupWorthy (#1026)
Diffstat (limited to 'ext/js/language')
-rw-r--r-- | ext/js/language/text-scanner.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js index 0270a025..aba44644 100644 --- a/ext/js/language/text-scanner.js +++ b/ext/js/language/text-scanner.js @@ -1619,7 +1619,7 @@ export class TextScanner extends EventDispatcher { */ async _isTextLookupWorthy(text) { try { - return this._language !== null && await this._api.isTextLookupWorthy(text, this._language); + return this._language !== null && text.length > 0 && await this._api.isTextLookupWorthy(text, this._language); } catch (e) { return false; } |