summaryrefslogtreecommitdiff
path: root/ext/bg/js/handlebars.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-27 22:53:45 -0400
committerGitHub <noreply@github.com>2020-03-27 22:53:45 -0400
commita0c4ce779d35cab39c62ca42ad3fe58a82faa1bb (patch)
treecd5cdae9d1a7aa48c11668a30758c72e4decedc7 /ext/bg/js/handlebars.js
parent08d38d8db2c97ff9f016a6de640f645b609088d1 (diff)
parent780d23b749325da0a95aa9cc7898df19f2ac1b31 (diff)
Merge pull request #413 from toasted-nutbread/japanese-utility
Convert Japanese utilities to a module-like style
Diffstat (limited to 'ext/bg/js/handlebars.js')
-rw-r--r--ext/bg/js/handlebars.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/bg/js/handlebars.js b/ext/bg/js/handlebars.js
index e3ce6bd0..5fda5baa 100644
--- a/ext/bg/js/handlebars.js
+++ b/ext/bg/js/handlebars.js
@@ -18,8 +18,7 @@
/* global
* Handlebars
- * jpDistributeFurigana
- * jpIsCodePointKanji
+ * jp
*/
function handlebarsEscape(text) {
@@ -33,7 +32,7 @@ function handlebarsDumpObject(options) {
function handlebarsFurigana(options) {
const definition = options.fn(this);
- const segs = jpDistributeFurigana(definition.expression, definition.reading);
+ const segs = jp.distributeFurigana(definition.expression, definition.reading);
let result = '';
for (const seg of segs) {
@@ -49,7 +48,7 @@ function handlebarsFurigana(options) {
function handlebarsFuriganaPlain(options) {
const definition = options.fn(this);
- const segs = jpDistributeFurigana(definition.expression, definition.reading);
+ const segs = jp.distributeFurigana(definition.expression, definition.reading);
let result = '';
for (const seg of segs) {
@@ -66,7 +65,7 @@ function handlebarsFuriganaPlain(options) {
function handlebarsKanjiLinks(options) {
let result = '';
for (const c of options.fn(this)) {
- if (jpIsCodePointKanji(c.codePointAt(0))) {
+ if (jp.isCodePointKanji(c.codePointAt(0))) {
result += `<a href="#" class="kanji-link">${c}</a>`;
} else {
result += c;