From 229f04ba358b3485fa7952088e03dad9e651bb23 Mon Sep 17 00:00:00 2001 From: Cashew <52880648+Scrub1492@users.noreply.github.com> Date: Wed, 20 Dec 2023 21:36:27 +0900 Subject: rename variables (#409) * rename variables * add comment to ambiguous variable * rename variables * add comments * rename functions --- ext/js/templates/sandbox/anki-template-renderer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/js/templates/sandbox/anki-template-renderer.js') diff --git a/ext/js/templates/sandbox/anki-template-renderer.js b/ext/js/templates/sandbox/anki-template-renderer.js index 857922bf..515e85da 100644 --- a/ext/js/templates/sandbox/anki-template-renderer.js +++ b/ext/js/templates/sandbox/anki-template-renderer.js @@ -171,10 +171,10 @@ export class AnkiTemplateRenderer { /** @type {import('template-renderer').HelperFunction} */ _furigana(args, context, options) { const {expression, reading} = this._getFuriganaExpressionAndReading(args, context, options); - const segs = this._japaneseUtil.distributeFurigana(expression, reading); + const segments = this._japaneseUtil.distributeFurigana(expression, reading); let result = ''; - for (const {text, reading: reading2} of segs) { + for (const {text, reading: reading2} of segments) { const safeText = this._escape(text); const safeReading = this._escape(reading2); if (safeReading.length > 0) { @@ -190,10 +190,10 @@ export class AnkiTemplateRenderer { /** @type {import('template-renderer').HelperFunction} */ _furiganaPlain(args, context, options) { const {expression, reading} = this._getFuriganaExpressionAndReading(args, context, options); - const segs = this._japaneseUtil.distributeFurigana(expression, reading); + const segments = this._japaneseUtil.distributeFurigana(expression, reading); let result = ''; - for (const {text, reading: reading2} of segs) { + for (const {text, reading: reading2} of segments) { if (reading2.length > 0) { if (result.length > 0) { result += ' '; } result += `${text}[${reading2}]`; -- cgit v1.2.3