From c3c5d58688a411c6ed450b89494c59037197df55 Mon Sep 17 00:00:00 2001 From: Kuuuube <61125188+Kuuuube@users.noreply.github.com> Date: Sat, 4 May 2024 11:22:30 -0400 Subject: Fix definition.cloze and text-based getMedia in handlebars being escaped (#857) * Fix definition.cloze in handlebars not being unescaped * Fix {clipboard-text} * Fix {selection-text} * Update update note --- ext/js/data/options-util.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ext/js/data') diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index 5319cfe4..d6c667aa 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -538,7 +538,8 @@ export class OptionsUtil { this._updateVersion29, this._updateVersion30, this._updateVersion31, - this._updateVersion32 + this._updateVersion32, + this._updateVersion33 ]; /* eslint-enable @typescript-eslint/unbound-method */ if (typeof targetVersion === 'number' && targetVersion < result.length) { @@ -1258,6 +1259,13 @@ export class OptionsUtil { } } + /** + * - Updated handlebars to fix escaping when using `definition.cloze` or text-based `getMedia`. + * @type {import('options-util').UpdateFunction} + */ + async _updateVersion33(options) { + await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v33.handlebars'); + } /** * @param {string} url -- cgit v1.2.3