summaryrefslogtreecommitdiff
path: root/ext/bg/js/handlebars.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/handlebars.js')
-rw-r--r--ext/bg/js/handlebars.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/bg/js/handlebars.js b/ext/bg/js/handlebars.js
index 66d5fa2b..08304d43 100644
--- a/ext/bg/js/handlebars.js
+++ b/ext/bg/js/handlebars.js
@@ -71,6 +71,16 @@ function handlebarsKanjiLinks(options) {
return result;
}
+function handlebarsExpressions(options) {
+ const definition = options.fn(this);
+ return definition.expression;
+}
+
+function handlebarsReadings(options) {
+ const definition = options.fn(this);
+ return definition.reading;
+}
+
function handlebarsMultiLine(options) {
return options.fn(this).split('\n').join('<br>');
}
@@ -83,6 +93,8 @@ function handlebarsRegisterHelpers() {
Handlebars.registerHelper('furiganaPlain', handlebarsFuriganaPlain);
Handlebars.registerHelper('kanjiLinks', handlebarsKanjiLinks);
Handlebars.registerHelper('multiLine', handlebarsMultiLine);
+ Handlebars.registerHelper('expressions', handlebarsExpressions);
+ Handlebars.registerHelper('readings', handlebarsReadings);
}
}