From 94c30c83e69e050c0237988a77cd41342ebeebfe Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 17 Apr 2016 20:24:22 -0700 Subject: [PATCH] Cleanup --- ext/bg/js/templates.js | 7 +++++++ ext/bg/js/yomichan.js | 2 +- util/tmpl/kanji-link.html | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 util/tmpl/kanji-link.html diff --git a/ext/bg/js/templates.js b/ext/bg/js/templates.js index 75445786..cacd8808 100644 --- a/ext/bg/js/templates.js +++ b/ext/bg/js/templates.js @@ -27,6 +27,13 @@ templates['kanji.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(co + alias4(((helper = (helper = helpers.glossary || (depth0 != null ? depth0.glossary : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"glossary","hash":{},"data":data}) : helper))) + "\n\n"; },"useData":true}); +templates['kanji-link.html'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var helper; + + return "" + + container.escapeExpression(((helper = (helper = helpers.kanji || (depth0 != null ? depth0.kanji : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : {},{"name":"kanji","hash":{},"data":data}) : helper))) + + "\n"; +},"useData":true}); templates['term.html'] = template({"1":function(container,depth0,helpers,partials,data) { var stack1, helper, options, alias1=depth0 != null ? depth0 : {}, alias2=helpers.helperMissing, alias3="function", buffer = "
"; diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js index 11d71ae1..6611e7ac 100644 --- a/ext/bg/js/yomichan.js +++ b/ext/bg/js/yomichan.js @@ -24,7 +24,7 @@ class Yomichan { let result = ''; for (const c of options.fn(this)) { if (Translator.isKanji(c)) { - result += `${c}`; + result += Handlebars.templates['kanji-link.html']({kanji: c}); } else { result += c; } diff --git a/util/tmpl/kanji-link.html b/util/tmpl/kanji-link.html new file mode 100644 index 00000000..21533282 --- /dev/null +++ b/util/tmpl/kanji-link.html @@ -0,0 +1 @@ +{{kanji}}