summaryrefslogtreecommitdiff
path: root/ext/mixed/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-08 15:13:22 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-08 16:01:29 -0500
commitbb334acab65ae194d749ac2da5bd1ba6b02413ec (patch)
treed99415d12c50d28c2f06bb9eeae72bfdca42bbcc /ext/mixed/js
parent8ca44d722c6db79f6f3a1892558c7c24f98abd5e (diff)
Use substring instead of slice
Diffstat (limited to 'ext/mixed/js')
-rw-r--r--ext/mixed/js/japanese.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/mixed/js/japanese.js b/ext/mixed/js/japanese.js
index 8b841b2e..ea1c0065 100644
--- a/ext/mixed/js/japanese.js
+++ b/ext/mixed/js/japanese.js
@@ -160,16 +160,17 @@ function jpDistributeFuriganaInflected(expression, reading, source) {
}
const offset = source.length - stemLength;
- const stemExpression = source.slice(0, source.length - offset);
- const stemReading = reading.slice(
- 0, offset === 0 ? reading.length : reading.length - expression.length + stemLength
+ const stemExpression = source.substring(0, source.length - offset);
+ const stemReading = reading.substring(
+ 0,
+ offset === 0 ? reading.length : reading.length - expression.length + stemLength
);
for (const segment of jpDistributeFurigana(stemExpression, stemReading)) {
output.push(segment);
}
if (stemLength !== source.length) {
- output.push({text: source.slice(stemLength)});
+ output.push({text: source.substring(stemLength)});
}
return output;