-
Notifications
You must be signed in to change notification settings - Fork 174
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
html beautify removes spaces #36
Comments
Or should it ? |
Hey man, thanks for interest in this project. If you could please file an issue with https://github.com/einars/js-beautify . They are the ones who maintain the html/js/css formatter that this extension uses. I have noticed this but have lived with it for a while. They are very responsive and if you file an issue they'll tell you if it's in scope/possible/willing to do it. Thanks! |
@drewhjava I think a newer version of beautify-html.js is needed to fix this bug; if you test the above code in the online version http://jsbeautifier.org/, you should get a valid result. So what I did is copied http://jsbeautifier.org/js/lib/beautify-html.js to Brackets |
Hey guys this has to do with default unformatted settings. By default I've opted in to format every tag. In the actual html beautify code this is the unformatted array. ['a', 'span', 'bdo', 'em', 'strong', 'dfn', 'code', 'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym', 'q', 'sub', 'sup', 'tt', 'i', 'b', 'big', 'small', 'u', 's', 'strike', 'font', 'ins', 'del', 'pre', 'address', 'dt', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] If you would like, you can replace the unformatted array with this one for the time being. I don't want to change the default behavior of the extension right now, so I'll add this in as an option. function _formatHTML(unformattedText, indentChar, indentSize) {
var formattedText = html_beautify(unformattedText, {
indent_size: indentSize,
indent_char: indentChar,
max_char: 0,
unformatted: []
});
return formattedText;
} |
The text was updated successfully, but these errors were encountered: