Closed s9105947 closed 2 years ago
Good call @s9105947. Intuitively, I agree with you that B is correct. I also agree that the top-level overview of the comments spec seems to indicate the same:
Especially the combination of the phrases "should never appear in the resulting output" and "may contain any substring" (emphasis mine in both cases) seems to indicate that comments are very absolute, so a collision with a variable name should not result in that variable being interpolated.
Thirdly, I agree that this intention isn't enforced in the tests yet. None of the tests have data.
If you like a challenge, please feel welcome to hack together a PR. Reviews are there to help smooth out rough edges. I will happily review your changes and test them against my own implementation, and others might join in, too.
Dear Maintainers,
I've noticed that some implementations treat
{{! comments}}
just as normal variable replacements, just hoping that the user does not define a variable! comments
.Example: Data:
{"! blabla": "never shown"}
Template:>{{! blabla}}<
Rendered A:>never shown<
Rendered B:><
Handling comments as (hopefully) undefined variables yields Rendered A, but I think the spec suggests Rendered B.
Which is correct?
There is no test case ensuring this behavior, can one get added? (I can hack together a PR, but I'm not certain that I'll get it to run.)