aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/handlebars.js2
-rw-r--r--ext/bg/js/search.js2
-rw-r--r--ext/bg/js/translator.js3
3 files changed, 3 insertions, 4 deletions
diff --git a/ext/bg/js/handlebars.js b/ext/bg/js/handlebars.js
index 6d1581be..62f89ee4 100644
--- a/ext/bg/js/handlebars.js
+++ b/ext/bg/js/handlebars.js
@@ -61,7 +61,7 @@ function handlebarsFuriganaPlain(options) {
function handlebarsKanjiLinks(options) {
let result = '';
for (const c of options.fn(this)) {
- if (jpIsKanji(c)) {
+ if (jpIsCharCodeKanji(c.charCodeAt(0))) {
result += `<a href="#" class="kanji-link">${c}</a>`;
} else {
result += c;
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js
index ea68915c..f5c641a8 100644
--- a/ext/bg/js/search.js
+++ b/ext/bg/js/search.js
@@ -265,7 +265,7 @@ class DisplaySearch extends Display {
text !== this.clipboardPreviousText
) {
this.clipboardPreviousText = text;
- if (jpIsAnyCharacterJapanese(text)) {
+ if (jpIsStringPartiallyJapanese(text)) {
this.setQuery(this.isWanakanaEnabled() ? window.wanakana.toKana(text) : text);
window.history.pushState(null, '', `${window.location.pathname}?query=${encodeURIComponent(text)}`);
this.onSearchQueryUpdated(this.query.value, true);
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index 2fb36194..cda1099f 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -590,8 +590,7 @@ class Translator {
if (!options.scanning.alphanumeric) {
const ii = text.length;
for (let i = 0; i < ii; ++i) {
- const c = text[i];
- if (!jpIsCharacterJapanese(c)) {
+ if (!jpIsCharCodeJapanese(text.charCodeAt(i))) {
text = text.substring(0, i);
break;
}