diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-03-15 17:32:31 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-04-06 18:20:04 -0400 |
commit | 4011a091b69475e7096d80103b4dad9aa1b8d80b (patch) | |
tree | 2dcf382cd6161114e53c6bbf5c3b9545d007f8c6 /ext/bg/js/settings/anki-templates.js | |
parent | 059db280bba858a3cab3a542aef13f19737aaf6e (diff) |
Add support for {document-title}
Diffstat (limited to 'ext/bg/js/settings/anki-templates.js')
-rw-r--r-- | ext/bg/js/settings/anki-templates.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/bg/js/settings/anki-templates.js b/ext/bg/js/settings/anki-templates.js index 88bca024..e3852eb4 100644 --- a/ext/bg/js/settings/anki-templates.js +++ b/ext/bg/js/settings/anki-templates.js @@ -99,7 +99,11 @@ async function ankiTemplatesValidate(infoNode, field, mode, showSuccessResult, i const definition = await ankiTemplatesValidateGetDefinition(text, optionsContext); if (definition !== null) { const options = await apiOptionsGet(optionsContext); - const context = {}; + const context = { + document: { + title: document.title + } + }; let templates = options.anki.fieldTemplates; if (typeof templates !== 'string') { templates = await apiGetDefaultAnkiFieldTemplates(); } const ankiNoteBuilder = new AnkiNoteBuilder({renderTemplate: apiTemplateRender}); |