From 609d4fe3347f87290a428e2ba1192acb991b2e38 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 13 Apr 2021 20:32:24 -0400 Subject: Replace furigana with reading (#1614) * Use "reading" instead of "furigana" for reading distribution * Update tests --- ext/js/templates/template-renderer.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'ext/js/templates') diff --git a/ext/js/templates/template-renderer.js b/ext/js/templates/template-renderer.js index ed9cc41c..9bb7a414 100644 --- a/ext/js/templates/template-renderer.js +++ b/ext/js/templates/template-renderer.js @@ -177,11 +177,11 @@ class TemplateRenderer { const segs = this._japaneseUtil.distributeFurigana(expression, reading); let result = ''; - for (const seg of segs) { - if (seg.furigana.length > 0) { - result += `${seg.text}${seg.furigana}`; + for (const {text, reading: reading2} of segs) { + if (reading2.length > 0) { + result += `${text}${reading2}`; } else { - result += seg.text; + result += text; } } @@ -193,12 +193,12 @@ class TemplateRenderer { const segs = this._japaneseUtil.distributeFurigana(expression, reading); let result = ''; - for (const seg of segs) { - if (seg.furigana.length > 0) { + for (const {text, reading: reading2} of segs) { + if (reading2.length > 0) { if (result.length > 0) { result += ' '; } - result += `${seg.text}[${seg.furigana}]`; + result += `${text}[${reading2}]`; } else { - result += seg.text; + result += text; } } -- cgit v1.2.3