aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/util.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-01-09 19:42:54 -0800
committerAlex Yatskov <alex@foosoft.net>2017-01-09 19:42:54 -0800
commit40838790d5697a418035f753711a54f2f19547e3 (patch)
treebd5378c4d0dd57c58119204c7b4bc58799fa3239 /ext/bg/js/util.js
parentf1c826e2d349c550121125346290717a81325ed1 (diff)
WIP
Diffstat (limited to 'ext/bg/js/util.js')
-rw-r--r--ext/bg/js/util.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index f9932a61..504deeda 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -21,7 +21,7 @@ function kanjiLinks(options) {
let result = '';
for (const c of options.fn(this)) {
if (isKanji(c)) {
- result += Handlebars.templates['kanji-link.html']({kanji: c}).trim();
+ result += `<a href="#" class="kanji-link">${c}</a>`;
} else {
result += c;
}
@@ -30,6 +30,10 @@ function kanjiLinks(options) {
return result;
}
+function multiLine(options) {
+ return options.fn(this).split('\n').join('<br>');
+}
+
function isKanji(c) {
const code = c.charCodeAt(0);
return code >= 0x4e00 && code < 0x9fb0 || code >= 0x3400 && code < 0x4dc0;