[Sublime Text 2] W3C validation check package "W3C Validators" | Bashalog.
dubharmonic/Sublime-W3CValidators
It was Python that I touched for the first time, but it was a simple source, so I decided to fix it. As a result, it mainly supports Python 2-> 3.
Refer to the official reference. API Reference - Sublime Text 3 Documentation Porting Guide - Sublime Text 3 Documentation
Also, Python 2-> 3 and later guides. Python 3 Porting Guide — Porting to Python 3 v1 documentation
It seems that the specifications of urllib have been changed and that it has to be encoded / decoded in binary when sending and receiving requests.
reference: Python 3.x: urllib.request error - Stack Overflow
- encodedParams = urllib.urlencode(params)
- output = urllib.urlopen(validatorUrl, encodedParams).read()
+ encodedParams = urllib.parse.urlencode(params)
+ binary_data = encodedParams.encode('utf-8')
+ output = urllib.request.urlopen(validatorUrl, binary_data).read().decode("utf-8")
+
Please download from the following, install manually, and then restart Sublime Text 3.
For Mac
git clone https://github.com/ksz/Sublime-W3CValidators
mv Sublime-W3CValidators ~/Library/Application Support/Sublime Text 3/Packages/
Recommended Posts