janl / mustache.js

Minimal templating with {{mustaches}} in JavaScript
https://mustache.github.io
MIT License
16.37k stars 2.4k forks source link

Feature request: {{<parent}} blocks #825

Open JoshuaWise opened 8 months ago

JoshuaWise commented 8 months ago

The official mustache website describes {{<parent}}{{/parent}} blocks, which are basically partials, except they can contain overridable {{$block}}{{/block}} sections. As far as I can tell, this feature is missing from this package.

Reference: https://mustache.github.io/mustache.5.html#Parents

bobthecow commented 8 months ago

"blocks" (e.g. {{$foo}}{{/foo}}) and "parents" (e.g. {{<bar}}{{/bar}}) are part of the optional "template inheritance" spec. Many Mustache implementations don't currently implement this, as it's a more recent addition to the spec.

In this case, it was added to the Mustache spec a month after the most recent release of Mustache.js.

JoshuaWise commented 8 months ago

Ahh okay, then I guess it's not a bug. This issue can be recategorized as a feature request.

solidgoldpig commented 1 month ago

There was a previous PR for this

https://github.com/janl/mustache.js/pull/473