-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Disappearing helper contents #66
Comments
Looks like it's producing exactly what would be expected. |
But why is the helper-output treated as handlebars-template? |
try doing |
https://github.com/verbose/verb/blob/master/lib/plugins/comments.js. since lodash doesn't have any kind of comments feature, it was implemented as an extra feature. It doesn't look like I wired up the config store to be used for options on that plugin though, so the flag will need to be set every time you run verb until that's implemented. All we need to do is add something like this inside the plugin: var stripComments = this.config.get('stripComments'); then use whatever that returns if it's not undefined |
actually I think it should be disabled by default.... I'll mark this as a bug in the meantime since it's causing unexpected results and it's not clear to the user what's happening |
Ah, that explains it. Maybe comment-stripping should occur before parsing the template, so that helper output is not stripped. |
probably, let's give that a shot. I don't think there was a specific reason I chose
completely agree, this is why I marked it a bug. I would have never occurred to me that someone would create a lodash helper to generate handlebars comments lol. don't take that as a slam though! I'm all for using whatever techniques are necessary to get a job done! |
Maybe (haven't tried it yet!), it is possible to make comments in lodash-templates like |
I can't understand what is the logic. In both sides there's no logic for me - in template engine (no matter what it is) it would be skipped, also in verb. Why someone would want to preserve template comment, when template engine do nothing with them? But okey if they are preserved, where you will use them, for what, when and why? I mean.. if you want to use them just for hinting you always can use html comments and it is guaranteed that they won't be displayed, then the job won't be related to verb and template engine. I dont know, maybe missing the point. I think it's not a bug. |
PS: And okey, if you disable "stripping comments" they will stay after verb finishes rendering. So.. I guess you want to run one more rendering (with another template engine) over that output.. why? why not use verb, it is powerful and more than generator, more than documentator and etc. |
@tunnckoCore My problem is that the documentation of comment-patterns concerning Handlebars templates is wrong. The multiLineComment: [{
start: '<!--',
middle: '',
end: '-->'
}, {
start: '{{!--',
middle: '',
end: '--}}',
apidoc: true
}, {
start: '{{!',
middle: '',
end: '}}'
}] |
I just noticed that some of the entries of the
comment-patterns
-doc are not displayed correctly: the Mustache and Handlebars multiline-patterns are disappearing. I have cut the problem down to these two files.verb.md
:verbfile.js
The output is not, as I would have expected:
but
(see verb-tests).
I would like to know why. Is this a bug?
The text was updated successfully, but these errors were encountered: