summaryrefslogtreecommitdiff
path: root/ext/bg/js/yomichan.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/yomichan.js')
-rw-r--r--ext/bg/js/yomichan.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js
index a66c1244..11d71ae1 100644
--- a/ext/bg/js/yomichan.js
+++ b/ext/bg/js/yomichan.js
@@ -20,6 +20,18 @@
class Yomichan {
constructor() {
Handlebars.partials = Handlebars.templates;
+ Handlebars.registerHelper('kanjiLinks', function(options) {
+ let result = '';
+ for (const c of options.fn(this)) {
+ if (Translator.isKanji(c)) {
+ result += `<a href="#">${c}</a>`;
+ } else {
+ result += c;
+ }
+ }
+
+ return result;
+ });
this.translator = new Translator();
this.updateState('disabled');