summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpraschke <stel@comfy.monster>2023-10-17 22:35:34 +0100
committerpraschke <stel@comfy.monster>2023-10-17 22:35:34 +0100
commit4527cc03fe88cd747d0eb62a65d9d54247653483 (patch)
treed40a96e7637750728e872a695fb384f035ebdb25
parent9b798601b48a40b65e38b433924a99d155872ba7 (diff)
update: pronunciation
-rw-r--r--docs/templates.md4
-rw-r--r--ext/data/templates/anki-field-templates-upgrade-v21.handlebars6
-rw-r--r--ext/data/templates/default-anki-field-templates.handlebars2
-rw-r--r--test/test-options-util.js18
4 files changed, 27 insertions, 3 deletions
diff --git a/docs/templates.md b/docs/templates.md
index 0aa26b84..f021dea6 100644
--- a/docs/templates.md
+++ b/docs/templates.md
@@ -754,7 +754,7 @@ same as the system used for generating popup and search page dictionary entries.
<details>
<summary>Syntax:</summary>
- <code>{{#pronunciation <i>format=string</i> <i>reading=string</i> <i>downstepPosition=integer</i> <i>[nasalPositions=array]</i> <i>[devoicePositions=array]</i>}}{{/pronunciation}}</code><br>
+ <code>{{pronunciation <i>format=string</i> <i>reading=string</i> <i>downstepPosition=integer</i> <i>[nasalPositions=array]</i> <i>[devoicePositions=array]</i>}}</code><br>
* _`format`_ <br>
The format of the HTML to generate. This can be any of the following values:
@@ -774,7 +774,7 @@ same as the system used for generating popup and search page dictionary entries.
<summary>Example:</summary>
```handlebars
- {{~#pronunciation format='text' reading='よむ' downstepPosition=1~}}{{~/pronunciation~}}
+ {{~pronunciation format='text' reading='よむ' downstepPosition=1~}}
```
</details>
diff --git a/ext/data/templates/anki-field-templates-upgrade-v21.handlebars b/ext/data/templates/anki-field-templates-upgrade-v21.handlebars
index 0bfd95a5..4d88b812 100644
--- a/ext/data/templates/anki-field-templates-upgrade-v21.handlebars
+++ b/ext/data/templates/anki-field-templates-upgrade-v21.handlebars
@@ -83,6 +83,12 @@
{{>>>>>>>}}
{{<<<<<<<}}
+{{~#pronunciation format=format reading=reading downstepPosition=position nasalPositions=nasalPositions devoicePositions=devoicePositions~}}{{~/pronunciation~}}
+{{=======}}
+{{~pronunciation format=format reading=reading downstepPosition=position nasalPositions=nasalPositions devoicePositions=devoicePositions~}}
+{{>>>>>>>}}
+
+{{<<<<<<<}}
{{~#furigana expression reading~}}{{~/furigana~}}
{{=======}}
{{~furigana expression reading~}}
diff --git a/ext/data/templates/default-anki-field-templates.handlebars b/ext/data/templates/default-anki-field-templates.handlebars
index 08950f78..d94f6d70 100644
--- a/ext/data/templates/default-anki-field-templates.handlebars
+++ b/ext/data/templates/default-anki-field-templates.handlebars
@@ -184,7 +184,7 @@
{{! Pitch Accents }}
{{#*inline "pitch-accent-item"}}
- {{~#pronunciation format=format reading=reading downstepPosition=position nasalPositions=nasalPositions devoicePositions=devoicePositions~}}{{~/pronunciation~}}
+ {{~pronunciation format=format reading=reading downstepPosition=position nasalPositions=nasalPositions devoicePositions=devoicePositions~}}
{{/inline}}
{{#*inline "pitch-accent-item-disambiguation"}}
diff --git a/test/test-options-util.js b/test/test-options-util.js
index 23cfc121..d94028c0 100644
--- a/test/test-options-util.js
+++ b/test/test-options-util.js
@@ -1562,6 +1562,24 @@ async function testFieldTemplatesUpdate(extDir) {
{{/inline}}
{{~> (lookup . "marker") ~}}`.trimStart()
+ },
+ // block helper update: pronunciation
+ {
+ oldVersion: 20,
+ newVersion: 21,
+ old: `
+{{#*inline "pitch-accent-item"}}
+ {{~#pronunciation format=format reading=reading downstepPosition=position nasalPositions=nasalPositions devoicePositions=devoicePositions~}}{{~/pronunciation~}}
+{{/inline}}
+
+{{~> (lookup . "marker") ~}}`.trimStart(),
+
+ expected: `
+{{#*inline "pitch-accent-item"}}
+ {{~pronunciation format=format reading=reading downstepPosition=position nasalPositions=nasalPositions devoicePositions=devoicePositions~}}
+{{/inline}}
+
+{{~> (lookup . "marker") ~}}`.trimStart()
}
];