From b784e5b11a596a456eb8879d394fde64bc63aaef Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 27 Sep 2021 18:19:53 -0400 Subject: Katakana to hiragana conversion options (#1965) * Refactor convertKatakanaToHiragana * Add keepProlongedSoundMarks option * Test keepProlongedSoundMarks option * Refactor * Add keepProlongedSoundMarks option to hiragana handlebars helper * Update documentation --- docs/templates.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/templates.md b/docs/templates.md index 638c79a6..778b8e2d 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -786,11 +786,14 @@ Converts katakana text to hiragana.
Syntax: - {{#hiragana value}}{{/hiragana}}
- {{#hiragana}}value{{/hiragana}}
+ {{#hiragana value [keepProlongedSoundMarks=true|false]}}{{/hiragana}}
+ {{#hiragana [keepProlongedSoundMarks=true|false]}}value{{/hiragana}}
* _`value`_
The text to convert. + * _`keepProlongedSoundMarks`_ _(optional)_
+ Whether or not the `ー` character should be kept or converted to a vowel character. + Defaults to `false` if not specified.
Example: @@ -798,12 +801,16 @@ Converts katakana text to hiragana. ```handlebars {{#hiragana "よみちゃん ヨミちゃん ヨミチャン"}}{{/hiragana}} {{#hiragana}}よみちゃん ヨミちゃん ヨミチャン{{/hiragana}} + {{#hiragana}}ローマ字{{/hiragana}} + {{#hiragana keepProlongedSoundMarks=true}}ローマ字{{/hiragana}} ``` Output: ```html よみちゃん よみちゃん よみちゃん よみちゃん よみちゃん よみちゃん + ろうま字 + ろーま字 ```
-- cgit v1.2.3