Open Kristinita opened 6 years ago
same here
Same here. This is SUPER frustrating. What's the point of even installing this?
Getting same error on linux. Tried removing the package and reinstalling.
Changing my user settings to "formatter_version": "regex",
prevents the error, but it doesn't run the beautiful soup formatter.
To get the beautiful soup formatter to run I removed indent_size from the args in CodeFormatter/codeformatter/htmlformatter.py.
Same and what @desean1625 suggested didn't change anything
I did this and it works but the result sux for my case so I'm not gonna use it anyway
if formatter == 'bs4' and use_bs4:
p_indent_size = 4
options = htmlbeautifier.default_options()
# # if 'indent_size' in self.opts:
# # p_indent_size = self.opts['indent_size']
# try:
# soup = BeautifulSoup(text, 'html.parser')
# stdout = soup.prettify(
# formatter=None, indent_size=p_indent_size)
# except Exception as e:
# stderr = str(e)
1. Summary
If:
site-packages
folder add to my local Sublime Text environment,"formatter_version": "bs4"
in my"codeformatter_html_options"
.I can't format any HTML file. I get an error in Sublime Text console:
2. Environment
3. Steps to reproduce
I reproduce the problem in a version of Sublime Text without plugins and user settings.
3.1. Without global site-packages path
I install CodeFormatter → I restart Sublime Text → I print in Sublime Text console:
3.2. With global site-packages path
See manual, how use global Python packages in Sublime Text environment.
For example, my package KristinitaLuckyLink contains lines:
These lines add
'C:\\Python36\\Lib\\site-packages'
path to Sublime Text environment in Sublime Text start.Package Control: Add Repository
→ I pastehttps://github.com/Kristinita/KristinitaLuckyLink
→ Enter →Package Control: Install Package
→ I selectKristinitaLuckyLink
→ I restart Sublime Text → I print in Sublime Text console:Pay attention to
'C:\\Python36\\Lib\\site-packages'
.Then I open any valid HTML file → Ctrl+Shift+P (⌘⇧p for Mac) →
CodeFormatter
.4. Expected behavior
If no
'C:\\Python36\\Lib\\site-packages'
or
"formatter_version": "regexp",
inUser/CodeFormatter.sublime-settings
:HTML file successful beautify.
5. Actual behavior
Else
'C:\\Python36\\Lib\\site-packages'
and
"formatter_version": "bs4",
inUser/CodeFormatter.sublime-settings
:I get an error:
Thanks.