Open CaledoniaProject opened 8 years ago
Node is required to run to js-beautify, e.g
var js_beautify = require("js-beautify").js_beautify;
var css_beautify = require("js-beautify").css;
var html_beautify = require("js-beautify").html;
Just out of curiosity, have you tried the RegExp formatter, or just the BeautifulSoup formatter?
Hmm, I just use the format command in a html file, how can I try the RegExp formatter?
Sorry for the delay in response - add "formatter_version": "regexp"
to the "codeformatter_html_options"
block in your user settings (available under Preferences -> Package Settings -> CodeFormatter -> Settings - User).
I also encourage you to look at the other options available for the HTML formatter once you're on the RegExp formatter.
Wow, it works, just some minor problems
codeformatter_html_options
and edit on it, if I only use this,{
"codeformatter_html_options":
{
"formatter_version": "regex"
}
}
Codeformatter would complain about it
<title>xxx</title>
to
<title>
xxx
</title>
I don't want the new line in <title>
tag, is it possible to change that behaviour?
It's supposed to be "formatter_version": "regexp"
, not "formatter_version": "regex"
. That may have been the issue.
I'm still working on a generic fix for problems like your second issue, hopefully I'll get some time to work on it and create a pull request soon.
Aha, it was a typo, with regexp
CodeFormatter would still complain about it.
It wasn't a big problem though
BeautifulSoup does not recognise
meta
orlink
tags, and does not work with scripts,If you try to format anything like that, it would be a total mess.
However, another plugin called
HTML/JS/CSS Beautify
uses js-beautifier for HTML files and it works great. (Available with package control)So, can you please replace the BeautifulSoup solution with js-beautifier?