It would be very nice if there was a "search and replace" helper in handlebars.
Use case:
I have a card with a desc field like so:
"Deal [6] damage."
I would like to write something like in the following:
.font_dice { font-family: 'DicierRL'; } // a font with dice symbols only
.font_regular { font-family: 'Overpass'; }
<div class="desc font_regular">
// replace, field, text_to_find, text_to_replace_with
{{replace card.desc "[6]" <span class="font_dice">6</span>}}
</div>
So that the output is like so:
<div class="desc font_regular">
Deal <span class="font_dice">6</span> damage.
</div>
Resulting in the following render:
This way I don't have to write cumbersome html tags in my card descriptions and instead can just quickly write "[6]" when I want a d6 icon.
Would be even more phenomenal if it supported regex so that I could write capture groups and re-use them in the replaced output. This way I could write "[any digit]" and still have it work.
It would be very nice if there was a "search and replace" helper in handlebars.
Use case:
I have a card with a
descfield like so:"Deal [6] damage."
I would like to write something like in the following:
So that the output is like so:
Resulting in the following render:
This way I don't have to write cumbersome html tags in my card descriptions and instead can just quickly write "[6]" when I want a d6 icon.
Would be even more phenomenal if it supported regex so that I could write capture groups and re-use them in the replaced output. This way I could write "[any digit]" and still have it work.