-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sub, sup, bold and small helpers undocumented? #1628
Comments
I think, this works because console.log("test".bold()) // "<b>bold</b>" |
@nknapp happy to put in a PR if you can point me in the right direction? |
Unintended? Probably. But it also works and I don't know who relies on it working. We can change it in 5.0, but not in 4.x I would make it a runtime option (boolean flag) The difficulty is that old templates need to work with the current runtime and vice versa. |
I tried this in #1594 but decided to create a simpler solution first. |
I'd like to know why the behaviour is a problem for you. |
I am trying to progressively convert a project from mustache to handlebars. One of the partials that is used a lot is the button which wraps the template in a
Since |
And mustache does not resolve prototype properties? |
I'm just wondering: One of the major features of Handlebars was its mustache-compatibility. I just wonder why this has never occured before and why this case isn't caught by the mustache-testcases that handlebars runs against in each build. |
Mustache does not resolve the prototype properties no:
|
I think it is not that easy to implement this check correctly. It should be a runtime option, but because compiler and runtime must remain compatible in 4.x, we cannot just add a function to the "container" object in the runtime that performs the check. If the compiled template calls the function and it is not there because the runtime is older than the compiler, then people will complain (I made that mistake already). In 5.0, that would be OK, but still, the "lookup"-helper does not have access to the "container" and cannot check the runtime option. And the "lookup"-helper should behave equally to a direct lookup. I have plans for releasing a 5.0 version. Apart from code-cleanup, this this a feature I wanted anyway, for security reasons. It would be great if you start it.
|
What is the roadmap for 5.0 is there likely to be an alpha/beta version anytime soon? Is it feature complete, would it be plausible to use in a development environment? |
My plan for 5.0 is to
My main motivation is to go back to the master branch and eliminate the other two pain points. |
Disallowing prototype access is released in 4.6. This issue should be fixed now. |
I recently came across some weird behaviour where the template
{{#url}}{{small}}{{/url}}
when passed the data{ url: 'https://google.com' }
wraps the url insmall
html tags, initially I thought this is just built-in helpers, but looking at the docs it is not documented as one. Furthermore, when logging the built-in helpers and partialssmall
is not referenced anywhere, I also found the same to be true forsub
,sup
andbold
. Searching the codebase for these terms also yields nothing. I am left very confused. Where is this behaviour coming from? and is it possible to turn it off?I wrote a little JSFiddle to demonstrate the issue: https://jsfiddle.net/d0ve69xL/
The text was updated successfully, but these errors were encountered: