From 3b886960050e9c41071e032b0cf92d0d5ab547f5 Mon Sep 17 00:00:00 2001 From: praschke Date: Sun, 22 Oct 2023 14:33:33 +0100 Subject: catch a few more cases in the template patch --- .../anki-field-templates-upgrade-v21.handlebars | 98 ++++++++++++---------- 1 file changed, 54 insertions(+), 44 deletions(-) diff --git a/ext/data/templates/anki-field-templates-upgrade-v21.handlebars b/ext/data/templates/anki-field-templates-upgrade-v21.handlebars index 4d88b812..33c4dc6c 100644 --- a/ext/data/templates/anki-field-templates-upgrade-v21.handlebars +++ b/ext/data/templates/anki-field-templates-upgrade-v21.handlebars @@ -1,85 +1,91 @@ {{<<<<<<<}} -{{~#set "any" false}}{{/set~}} +{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}} {{=======}} -{{~set "any" false~}} +{{formatGlossary ../dictionary .}} {{>>>>>>>}} {{<<<<<<<}} -{{~#set "any" true}}{{/set~}} +{{~#furigana}}{{{.}}}{{/furigana~}} {{=======}} -{{~set "any" true~}} +{{~furigana .~}} {{>>>>>>>}} {{<<<<<<<}} -{{#each glossary}}{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}{{/each}} +{{#furigana}}{{{definition}}}{{/furigana}} {{=======}} -{{#each glossary}}{{formatGlossary ../dictionary .}}{{/each}} +{{furigana definition}} {{>>>>>>>}} {{<<<<<<<}} -{{#each glossary}}{{#formatGlossary ../dictionary}}{{{.}}}{{/formatGlossary}}{{#unless @last}} | {{/unless}}{{/each}} +{{~#furigana expression reading~}}{{~/furigana~}} {{=======}} -{{#each glossary}}{{formatGlossary ../dictionary .}}{{#unless @last}} | {{/unless}}{{/each}} +{{~furigana expression reading~}} {{>>>>>>>}} {{<<<<<<<}} - +{{~#furigana expression reading}}{{/furigana~}} {{=======}} - +{{~furigana expression reading~}} {{>>>>>>>}} {{<<<<<<<}} -{{~#set "previousDictionary" dictionary~}}{{~/set~}} +{{~#furiganaPlain}}{{{.}}}{{/furiganaPlain~}} {{=======}} -{{~set "previousDictionary" dictionary~}} +{{~furiganaPlain .~}} {{>>>>>>>}} {{<<<<<<<}} -[sound:{{#getMedia "audio"}}{{/getMedia}}] +{{#furiganaPlain}}{{{definition}}}{{/furiganaPlain}} {{=======}} -[sound:{{getMedia "audio"}}] +{{furiganaPlain definition}} {{>>>>>>>}} {{<<<<<<<}} -{{~#furigana}}{{{.}}}{{/furigana~}} +{{~#furiganaPlain expression reading~}}{{~/furiganaPlain~}} {{=======}} -{{~furigana .~}} +{{~furiganaPlain expression reading~}} {{>>>>>>>}} {{<<<<<<<}} -{{#furigana}}{{{definition}}}{{/furigana}} +{{~#furiganaPlain expression reading}}{{/furiganaPlain~}} {{=======}} -{{furigana definition}} +{{~furiganaPlain expression reading~}} {{>>>>>>>}} {{<<<<<<<}} -{{~#furiganaPlain}}{{{.}}}{{/furiganaPlain~}} +{{#getMedia "audio"}}{{/getMedia}} {{=======}} -{{~furiganaPlain .~}} +{{getMedia "audio"}} {{>>>>>>>}} {{<<<<<<<}} -{{#furiganaPlain}}{{{definition}}}{{/furiganaPlain}} +{{#getMedia "screenshot"}}{{/getMedia}} {{=======}} -{{furiganaPlain definition}} +{{getMedia "screenshot"}} {{>>>>>>>}} {{<<<<<<<}} - +{{#getMedia "clipboardImage"}}{{/getMedia}} {{=======}} - +{{getMedia "clipboardImage"}} {{>>>>>>>}} {{<<<<<<<}} - +{{#getMedia "clipboardText"}}{{/getMedia}} {{=======}} - +{{getMedia "clipboardText"}} {{>>>>>>>}} {{<<<<<<<}} -{{~#if (hasMedia "clipboardText")}}{{#getMedia "clipboardText"}}{{/getMedia}}{{/if~}} +{{#getMedia "selectionText"}}{{/getMedia}} {{=======}} -{{~#if (hasMedia "clipboardText")}}{{getMedia "clipboardText"}}{{/if~}} +{{getMedia "selectionText"}} +{{>>>>>>>}} + +{{<<<<<<<}} +{{#getMedia "textFurigana" definition.cloze.sentence escape=false}}{{/getMedia}} +{{=======}} +{{getMedia "textFurigana" definition.cloze.sentence escape=false}} {{>>>>>>>}} {{<<<<<<<}} @@ -89,9 +95,21 @@ {{>>>>>>>}} {{<<<<<<<}} -{{~#furigana expression reading~}}{{~/furigana~}} +{{~#set "any" false}}{{/set~}} {{=======}} -{{~furigana expression reading~}} +{{~set "any" false~}} +{{>>>>>>>}} + +{{<<<<<<<}} +{{~#set "any" true}}{{/set~}} +{{=======}} +{{~set "any" true~}} +{{>>>>>>>}} + +{{<<<<<<<}} +{{~#set "previousDictionary" dictionary~}}{{~/set~}} +{{=======}} +{{~set "previousDictionary" dictionary~}} {{>>>>>>>}} {{<<<<<<<}} @@ -107,9 +125,9 @@ {{>>>>>>>}} {{<<<<<<<}} -{{~#get "separator"}}{{/get~}}{{{.}}} +{{~#get "separator"}}{{/get~}} {{=======}} -{{~get "separator"~}}{{{.}}} +{{~get "separator"~}} {{>>>>>>>}} {{<<<<<<<}} @@ -131,21 +149,13 @@ {{>>>>>>>}} {{<<<<<<<}} - {{~#set (concat "used_" .) true~}}{{~/set~}} - {{~#set "first" false~}}{{~/set~}} +{{~#set "first" false~}}{{~/set~}} {{=======}} - {{~set (concat "used_" .) true~}} - {{~set "first" false~}} +{{~set "first" false~}} {{>>>>>>>}} {{<<<<<<<}} -{{~#if (hasMedia "selectionText")}}{{#getMedia "selectionText"}}{{/getMedia}}{{/if~}} +{{~#set (concat "used_" .) true~}}{{~/set~}} {{=======}} -{{~#if (hasMedia "selectionText")}}{{getMedia "selectionText"}}{{/if~}} -{{>>>>>>>}} - -{{<<<<<<<}} -{{#getMedia "textFurigana" definition.cloze.sentence escape=false}}{{/getMedia}} -{{=======}} -{{getMedia "textFurigana" definition.cloze.sentence escape=false}} +{{~set (concat "used_" .) true~}} {{>>>>>>>}} -- cgit v1.2.3