summaryrefslogtreecommitdiff
path: root/ext/bg/js/anki-note-builder.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/anki-note-builder.js')
-rw-r--r--ext/bg/js/anki-note-builder.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/bg/js/anki-note-builder.js b/ext/bg/js/anki-note-builder.js
index f7555280..be39ff43 100644
--- a/ext/bg/js/anki-note-builder.js
+++ b/ext/bg/js/anki-note-builder.js
@@ -16,10 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-/*global apiTemplateRender*/
-
class AnkiNoteBuilder {
- constructor() {
+ constructor({renderTemplate}) {
+ this._renderTemplate = renderTemplate;
this._markers = new Set([
'audio',
'character',
@@ -100,7 +99,7 @@ class AnkiNoteBuilder {
}
data.marker = marker;
try {
- return await apiTemplateRender(templates, data);
+ return await this._renderTemplate(templates, data);
} catch (e) {
if (errors) { errors.push(e); }
return `{${marker}-render-error}`;