diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-09-12 22:14:58 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-09-12 22:14:58 -0700 |
commit | 540d0e239c9b7dc5bee8a3e53bcf6ec0767ee80b (patch) | |
tree | 559fe79c76faa13610d745036e3e0864a7f40857 /ext/bg/js/util.js | |
parent | 4241b4f8595813b966371a02f5b2f35d7997b1e2 (diff) |
Cleanup
Diffstat (limited to 'ext/bg/js/util.js')
-rw-r--r-- | ext/bg/js/util.js | 13 |
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(); |