softmoth / raku-Template-Mustache

Raku library for the Mustache template format
https://modules.raku.org/dist/Template::Mustache:cpan:SOFTMOTH
Artistic License 2.0
21 stars 19 forks source link

Tag names can only contain what is considered an <ident> #26

Closed SyrupThinker closed 5 years ago

SyrupThinker commented 5 years ago

Because of this tags containing dashes (and other non \<ident> characters) will not be substituted, as can be seen here:

> perl6 -e 'use Template::Mustache; Template::Mustache.render(\'{{base00-hex}}\', { \'base00-hex\' => 1 }).say'
# OUTPUT: «{{base00-hex}}␤»

The spec leaves this point somewhat open, but the discussion in https://github.com/mustache/spec/issues/67 suggests that it can basically contain anything that isn't interpreted in some other way (minus whitespace).

The way I see it the following token, and possibly ones using it, would need to be changed. https://github.com/softmoth/p6-Template-Mustache/blob/5ad705e3b2e30fbc1cb9ae6590c49c7db7b51167/lib/Template/Mustache.pm#L31

softmoth commented 5 years ago

Thank you for the report & PR.