aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/anki-note-builder.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-04 17:57:05 -0400
committerGitHub <noreply@github.com>2020-09-04 17:57:05 -0400
commit21fc0a80f2382f383ae5df221b17313e72b809db (patch)
tree6ac00942df30bc12a1cf132fa203934cba5e7967 /ext/bg/js/anki-note-builder.js
parent3efd4a1a94ddac6b0c9e0d3cf6fa7eb5621bf8a2 (diff)
Defer assignment of marker (#762)
Diffstat (limited to 'ext/bg/js/anki-note-builder.js')
-rw-r--r--ext/bg/js/anki-note-builder.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/bg/js/anki-note-builder.js b/ext/bg/js/anki-note-builder.js
index 2405543e..041e6dcd 100644
--- a/ext/bg/js/anki-note-builder.js
+++ b/ext/bg/js/anki-note-builder.js
@@ -81,9 +81,8 @@ class AnkiNoteBuilder {
async formatField(field, data, templates, errors=null) {
const pattern = /\{([\w-]+)\}/g;
return await AnkiNoteBuilder.stringReplaceAsync(field, pattern, async (g0, marker) => {
- data.marker = marker;
try {
- return await this._renderTemplate(templates, data);
+ return await this._renderTemplate(templates, data, marker);
} catch (e) {
if (errors) { errors.push(e); }
return `{${marker}-render-error}`;