-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
option to ignore section or line in html #575
Comments
If you set the script to something other than <script type="text/lodash">
var defaults = [[- JSON.stringify(defaults, null, '\t') ]];
</script> The unformatted list should also work if you're using the most recent version. But that is a new feature, so it might be incomplete. |
I think the best approach would be to ignore anything between HTML comments, for example:
I quite often work with .NET projects which use Razor, and it would amazing if I could just exclude them from being processed. Once the file finished processing, the beautifier could just remove Real world exampleSource file:
Processed output:
Proposed solution (input file):
|
Excellent description. I don't know when this will happen but at least it is well documented. 👍 |
+1 html: Real world example from js:
After prettify:
|
This has been implemented for javascript beautifier in #384. It addresses the issue as reported but I'm leaving this one open to track implementation on the html side. |
+1 for html |
+1 for html |
👍 Would love to be able to ignore HTML sections using comments 😄 |
See #944. |
Fixed in c4f03cc |
I'm using a lodash template with a custom tag set to [[ and ]] to prevent tags set with gulp from interfering with normal mustache tags.
Beautify is breaking one of these apart:
To:
I've tried to set the unformatted list for html in the .jsbeautifyrc but that didn't seem to have any effect.
Is there a way to prevent beautify from splitting this line? It would be nice to have a ignore line style comment similar to jshint or htmlhint. Perhaps adding another set of tags to the mustache support, so it could use {{ as well as [[.
Thx
The text was updated successfully, but these errors were encountered: