summaryrefslogtreecommitdiff
path: root/ext/bg/js/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/util.js')
-rw-r--r--ext/bg/js/util.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index 97906eda..5583502d 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -17,6 +17,19 @@
*/
+function kanjiLinks(options) {
+ let result = '';
+ for (const c of options.fn(this)) {
+ if (isKanji(c)) {
+ result += Handlebars.templates['kanji-link.html']({kanji: c}).trim();
+ } else {
+ result += c;
+ }
+ }
+
+ return result;
+}
+
function loadJson(url) {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();