diff options
author | Kuuuube <61125188+Kuuuube@users.noreply.github.com> | 2024-05-04 11:22:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-04 15:22:30 +0000 |
commit | c3c5d58688a411c6ed450b89494c59037197df55 (patch) | |
tree | 72e28604d770c9b8baea92318fddc885b91cb711 /ext/data/templates | |
parent | e1484c7cfe9953d81ad0825dde4bf22964bcfb45 (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 'ext/data/templates')
-rw-r--r-- | ext/data/templates/anki-field-templates-upgrade-v33.handlebars | 69 | ||||
-rw-r--r-- | ext/data/templates/default-anki-field-templates.handlebars | 14 |
2 files changed, 76 insertions, 7 deletions
diff --git a/ext/data/templates/anki-field-templates-upgrade-v33.handlebars b/ext/data/templates/anki-field-templates-upgrade-v33.handlebars new file mode 100644 index 00000000..6fb967e5 --- /dev/null +++ b/ext/data/templates/anki-field-templates-upgrade-v33.handlebars @@ -0,0 +1,69 @@ +{{<<<<<<<}} +{{#*inline "sentence"}} + {{~#if definition.cloze}}{{definition.cloze.sentence}}{{/if~}} +{{/inline}} +{{=======}} +{{#*inline "sentence"}} + {{~#if definition.cloze}}{{{definition.cloze.sentence}}}{{/if~}} +{{/inline}} +{{>>>>>>>}} + +{{<<<<<<<}} +{{#*inline "cloze-prefix"}} + {{~#if definition.cloze}}{{definition.cloze.prefix}}{{/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"}} + {{~#if definition.cloze}}{{{definition.cloze.body}}}{{/if~}} +{{/inline}} +{{>>>>>>>}} + +{{<<<<<<<}} +{{#*inline "cloze-body-kana"}} + {{~#if definition.cloze}}{{definition.cloze.bodyKana}}{{/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 "cloze-suffix"}} + {{~#if definition.cloze}}{{{definition.cloze.suffix}}}{{/if~}} +{{/inline}} +{{>>>>>>>}} + +{{<<<<<<<}} +{{#*inline "clipboard-text"}} + {{~#if (hasMedia "clipboardText")}}{{getMedia "clipboardText"}}{{/if~}} +{{/inline}} +{{=======}} +{{#*inline "clipboard-text"}} + {{~#if (hasMedia "clipboardText")}}{{{getMedia "clipboardText"}}}{{/if~}} +{{/inline}} +{{>>>>>>>}} + +{{<<<<<<<}} +{{#*inline "selection-text"}} + {{~#if (hasMedia "selectionText")}}{{getMedia "selectionText"}}{{/if~}} +{{/inline}} +{{=======}} +{{#*inline "selection-text"}} + {{~#if (hasMedia "selectionText")}}{{{getMedia "selectionText"}}}{{/if~}} +{{/inline}} +{{>>>>>>>}}
\ No newline at end of file diff --git a/ext/data/templates/default-anki-field-templates.handlebars b/ext/data/templates/default-anki-field-templates.handlebars index 46d5c889..3ca7ba18 100644 --- a/ext/data/templates/default-anki-field-templates.handlebars +++ b/ext/data/templates/default-anki-field-templates.handlebars @@ -149,23 +149,23 @@ {{/inline}} {{#*inline "sentence"}} - {{~#if definition.cloze}}{{definition.cloze.sentence}}{{/if~}} + {{~#if definition.cloze}}{{{definition.cloze.sentence}}}{{/if~}} {{/inline}} {{#*inline "cloze-prefix"}} - {{~#if definition.cloze}}{{definition.cloze.prefix}}{{/if~}} + {{~#if definition.cloze}}{{{definition.cloze.prefix}}}{{/if~}} {{/inline}} {{#*inline "cloze-body"}} - {{~#if definition.cloze}}{{definition.cloze.body}}{{/if~}} + {{~#if definition.cloze}}{{{definition.cloze.body}}}{{/if~}} {{/inline}} {{#*inline "cloze-body-kana"}} - {{~#if definition.cloze}}{{definition.cloze.bodyKana}}{{/if~}} + {{~#if definition.cloze}}{{{definition.cloze.bodyKana}}}{{/if~}} {{/inline}} {{#*inline "cloze-suffix"}} - {{~#if definition.cloze}}{{definition.cloze.suffix}}{{/if~}} + {{~#if definition.cloze}}{{{definition.cloze.suffix}}}{{/if~}} {{/inline}} {{#*inline "tags"}} @@ -269,7 +269,7 @@ {{/inline}} {{#*inline "clipboard-text"}} - {{~#if (hasMedia "clipboardText")}}{{getMedia "clipboardText"}}{{/if~}} + {{~#if (hasMedia "clipboardText")}}{{{getMedia "clipboardText"}}}{{/if~}} {{/inline}} {{#*inline "conjugation"}} @@ -393,7 +393,7 @@ {{/inline}} {{#*inline "selection-text"}} - {{~#if (hasMedia "selectionText")}}{{getMedia "selectionText"}}{{/if~}} + {{~#if (hasMedia "selectionText")}}{{{getMedia "selectionText"}}}{{/if~}} {{/inline}} {{#*inline "sentence-furigana"}} |