-
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
Raw block helpers #573
Raw block helpers #573
Conversation
Generally I like this but do worry about the performance overhead that this may introduce for something that is not a super common use case. How much size does this add to the generated parser file? |
File sizes for output: handlebars.js - 75kb |
<com>[\s\S]*?"--}}" { yytext = yytext.substr(0, yyleng-4); this.popState(); return 'COMMENT'; } | ||
|
||
<mu>"{{{{" { return 'OPEN_RAW_BLOCK'; } | ||
<mu>"}}}}" { this.popState(); this.begin('raw'); return 'CLOSE_RAW_BLOCK'; } | ||
<mu>"{{{{"[^\x00]*"}}}}" { yytext = yytext.substr(4, yyleng-8); this.popState(); return 'RAW_BLOCK'; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this construct? I don't see it used in the productions below.
I'm not sure how common this use case is but it only adds ~1.6kb and I've noted a few places that the jison output can be optimized. We will need to document this but after that happens I'll merge it. |
I can try to document but a PR would certainly make that process faster :) |
@jezell We just landed some major changes to the code organization. Would you be willing to rebase this onto master? |
I'm still experiencing the issue this merge should resolve. I'm trying to put
Adding changing double braces with 4 doesn't work in this case. E.g.
|
@shturm please open a new issue. Discussion of issues on a closed issue are very likely to be lost. We will want to see an example of the code failing, I'm not sure quite sure what exactly is failing from your comment. |
Adds support for raw block helpers. Example:
{{{{markdown}}}}
In handlebars.js text like {{name}} will not be substituted with the value of the variable name.
{{{{/markdown}}}}
Fixes #559