aboutsummaryrefslogtreecommitdiff
path: root/test/options-util.test.js
diff options
context:
space:
mode:
authorKuuuube <61125188+Kuuuube@users.noreply.github.com>2024-05-04 11:22:30 -0400
committerGitHub <noreply@github.com>2024-05-04 15:22:30 +0000
commitc3c5d58688a411c6ed450b89494c59037197df55 (patch)
tree72e28604d770c9b8baea92318fddc885b91cb711 /test/options-util.test.js
parente1484c7cfe9953d81ad0825dde4bf22964bcfb45 (diff)
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
Diffstat (limited to 'test/options-util.test.js')
-rw-r--r--test/options-util.test.js65
1 files changed, 64 insertions, 1 deletions
diff --git a/test/options-util.test.js b/test/options-util.test.js
index 0966d0d3..f44dbb4f 100644
--- a/test/options-util.test.js
+++ b/test/options-util.test.js
@@ -605,7 +605,7 @@ function createOptionsUpdatedTestData1() {
}
],
profileCurrent: 0,
- version: 32,
+ version: 33,
global: {
database: {
prefixWildcardsSupported: false
@@ -1723,6 +1723,69 @@ describe('OptionsUtil', () => {
{{~/if~}}
{{/inline}}
`.trimStart()
+ },
+ {
+ oldVersion: 32,
+ newVersion: 33,
+ old: `
+{{#*inline "sentence"}}
+ {{~#if definition.cloze}}{{definition.cloze.sentence}}{{/if~}}
+{{/inline}}
+
+{{#*inline "cloze-prefix"}}
+ {{~#if definition.cloze}}{{definition.cloze.prefix}}{{/if~}}
+{{/inline}}
+
+{{#*inline "cloze-body"}}
+ {{~#if definition.cloze}}{{definition.cloze.body}}{{/if~}}
+{{/inline}}
+
+{{#*inline "cloze-body-kana"}}
+ {{~#if definition.cloze}}{{definition.cloze.bodyKana}}{{/if~}}
+{{/inline}}
+
+{{#*inline "cloze-suffix"}}
+ {{~#if definition.cloze}}{{definition.cloze.suffix}}{{/if~}}
+{{/inline}}
+
+{{#*inline "clipboard-text"}}
+ {{~#if (hasMedia "clipboardText")}}{{getMedia "clipboardText"}}{{/if~}}
+{{/inline}}
+
+{{#*inline "selection-text"}}
+ {{~#if (hasMedia "selectionText")}}{{getMedia "selectionText"}}{{/if~}}
+{{/inline}}
+`.trimStart(),
+
+ expected: `
+{{#*inline "sentence"}}
+ {{~#if definition.cloze}}{{{definition.cloze.sentence}}}{{/if~}}
+{{/inline}}
+
+{{#*inline "cloze-prefix"}}
+ {{~#if definition.cloze}}{{{definition.cloze.prefix}}}{{/if~}}
+{{/inline}}
+
+{{#*inline "cloze-body"}}
+ {{~#if definition.cloze}}{{{definition.cloze.body}}}{{/if~}}
+{{/inline}}
+
+{{#*inline "cloze-body-kana"}}
+ {{~#if definition.cloze}}{{{definition.cloze.bodyKana}}}{{/if~}}
+{{/inline}}
+
+{{#*inline "cloze-suffix"}}
+ {{~#if definition.cloze}}{{{definition.cloze.suffix}}}{{/if~}}
+{{/inline}}
+
+{{#*inline "clipboard-text"}}
+ {{~#if (hasMedia "clipboardText")}}{{{getMedia "clipboardText"}}}{{/if~}}
+{{/inline}}
+
+{{#*inline "selection-text"}}
+ {{~#if (hasMedia "selectionText")}}{{{getMedia "selectionText"}}}{{/if~}}
+{{/inline}}
+`.trimStart()
}
];