mustache / spec

The Mustache spec.
MIT License
361 stars 71 forks source link

add test: comment content colliding with variable #137

Closed s9105947 closed 2 years ago

s9105947 commented 2 years ago

Currently, an implementation treating comments as undefined variables successfully passes all tests, because both undefined variables and comments render to empty string.

This clarifies the behavior: A comment MUST NOT render into anything, under any circumstances. This includes the case where a variable with the same name as the comment content is defined.

The test data is designed in a way to trigger any possible name collision, including whitespaces, a leading exclamation mark (!).

Closes #136

gasche commented 2 years ago

This also looks like a good idea to me. Thanks!

jgonggrijp commented 2 years ago

@spullara or @Danappelxx I think this one is ready to merge.

jgonggrijp commented 2 years ago

Also, I hereby offer to join you as a maintainer, to help process pull requests. No offense if you're not into it (yet).

Danappelxx commented 2 years ago

I've actually been trying to find your email to offer you the permissions 😁 my new job doesn't permit me to maintain open source projects so I'd love to hand it off!

jgonggrijp commented 2 years ago

That's a happy coincidence! If you managed to find it, please send me an email to tell me how you did it. :-)

Thanks for having me on board!