summaryrefslogtreecommitdiff
path: root/ext/bg/js/options.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-15 17:32:31 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-06 18:20:04 -0400
commit4011a091b69475e7096d80103b4dad9aa1b8d80b (patch)
tree2dcf382cd6161114e53c6bbf5c3b9545d007f8c6 /ext/bg/js/options.js
parent059db280bba858a3cab3a542aef13f19737aaf6e (diff)
Add support for {document-title}
Diffstat (limited to 'ext/bg/js/options.js')
-rw-r--r--ext/bg/js/options.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 5c68c403..abb054d4 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -91,6 +91,15 @@ const profileOptionsVersionUpdates = [
if (utilStringHashCode(options.anki.fieldTemplates) === 1444379824) {
options.anki.fieldTemplates = null;
}
+ },
+ (options) => {
+ // Version 13 changes:
+ // Default anki field tempaltes updated to include {document-title}.
+ let fieldTemplates = options.anki.fieldTemplates;
+ if (typeof fieldTemplates === 'string') {
+ fieldTemplates += '\n\n{{#*inline "document-title"}}\n {{~context.document.title~}}\n{{/inline}}';
+ options.anki.fieldTemplates = fieldTemplates;
+ }
}
];