diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-06-26 17:05:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-26 17:05:55 -0400 |
commit | f9167c8fddbb757d314e1545c9dc788415a1fbf7 (patch) | |
tree | e1f1ba1e02a96baac4ae469341e41eb60e1b8ce9 /ext/js/data/anki-note-builder.js | |
parent | f497cb2a07b890d7d4873b5f90c6238d4cb8cb64 (diff) |
Template rendering updates (#1762)
* Remove unused function
* Update template rendering return value
Diffstat (limited to 'ext/js/data/anki-note-builder.js')
-rw-r--r-- | ext/js/data/anki-note-builder.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/js/data/anki-note-builder.js b/ext/js/data/anki-note-builder.js index 85a68265..c36ad889 100644 --- a/ext/js/data/anki-note-builder.js +++ b/ext/js/data/anki-note-builder.js @@ -115,7 +115,8 @@ class AnkiNoteBuilder { async _formatField(field, commonData, template, errors=null) { return await this._stringReplaceAsync(field, this._markerPattern, async (g0, marker) => { try { - return await this._renderTemplateBatched(template, commonData, marker); + const {result} = await this._renderTemplateBatched(template, commonData, marker); + return result; } catch (e) { if (Array.isArray(errors)) { const error = new Error(`Template render error for {${marker}}`); @@ -142,10 +143,6 @@ class AnkiNoteBuilder { return (await Promise.all(parts)).join(''); } - async _renderTemplate(template, marker, commonData) { - return await this._templateRenderer.render(template, {marker, commonData}, 'ankiNote'); - } - _getBatchedTemplateGroup(template) { for (const item of this._batchedRequests) { if (item.template === template) { |