Sublime Forum

No working W3C validation plugin in Sublime text anymore?

#1

Hi,

Used the Validation plugin “W3C Validators” for years, but it recently stopped working on Windows and Mac. Does anyone know of a alternative to do HTML validation within Sublime text 4?

Regards,

David

0 Likes

#2

Looking at the package, looks like it’s not seen any activity since 2017. So not sure why would it break suddenly if it was working earlier. You haven’t mentioned if there are any errors in the console or what exactly is not working ? If you could post that, maybe someone can help.

0 Likes

#3

Yes I have seen errors in the console talking about a not valid certificate or something with the SSL.
Maybe the URL of W3V has changed?

File "C:\Users\David\AppData\Roaming\Sublime Text 3\Installed Packages\W3CValidators.sublime- 
package\W3CValidators.py", line 64, in run
File "C:\Users\David\AppData\Roaming\SUBLIM~1\Packages\requests\all\requests\api.py", line 112, 
in 
post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Users\David\AppData\Roaming\SUBLIM~1\Packages\requests\all\requests\api.py", line 58, 
in 
request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\David\AppData\Roaming\SUBLIM~1\Packages\requests\all\requests\sessions.py", 
line 
522, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\David\AppData\Roaming\SUBLIM~1\Packages\requests\all\requests\sessions.py", 
line 642, in send
r = adapter.send(request, **kwargs)
File "C:\Users\David\AppData\Roaming\SUBLIM~1\Packages\requests\all\requests\adapters.py", 
line 513, in send
raise SSLError(e, request=request)
(_ssl.c:548)
0 Likes

#4
raise SSLError(e)
requests.packages.urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate 
verify failed (_ssl.c:548)
0 Likes

#5

I guess this may be caused by an expired root certificate, which is used with priority by python 3.3’s urllib.

See:

2 Likes

#6

@deathaxe
Thanks for the link!
Unfortunately that means that there is no HTML validation available anymore in Sublime Text?
Or is there a alternative that I don’t know of?

0 Likes

#7

What kind of HTML validation ? I wonder if LSP + LSP-html can do it, but probably @rwols may have a better idea about it.

0 Likes

#8

W3C Markup Validation Service from within Sublime Text, meaning you can test local in Sublime and a local server with no need to be online on my live server with the website or app I’m working on. Worked perfect for years!

0 Likes

#9

You might be able to work around the ssl issue by adding a .python-version file containing 3.8 to that plugin. Otherwise you could use the command line tools with a custom build system to do the validation locally instead of uploading your code every time you want to check it (see http://validator.w3.org/source/#getting).

1 Like

#10

@bschaaf

Thanks for the tip!
Can you please explain how to get (on Mac) python 3.8 locally installed in a folder of choice?
How do I open the plugin file for further editing of the link to the python 3.8?

Regards,

David

0 Likes

#11

We’ve got documentation on that here: https://www.sublimetext.com/docs/api_environments.html

1 Like

#12

@bschaaf

How do I open the plugin file for further editing of the link to the python 3.8?

0 Likes

#13

Hi,

How can I edit the W3Cvalidators.py file? When I try to change something it doesn’t work! To start with I want to change the URL’s http in https

class AbstractValidator(sublime_plugin.TextCommand):
markup_validator_url = 'http://validator.w3.org/check'
css_validator_url = 'http://jigsaw.w3.org/css-validator/validator'
0 Likes

#14

Can you be more specific? What doesn’t work, how are you editing it, etc?

0 Likes

#15

What you could try is git cloning https://github.com/ericsorenson/Sublime-W3CValidators into the Packages directory. And then add a .python-version file into it containing a single value 3.8 (This will cause the plugin to run in the 3.8 environment). Maybe that can get past the SSL issue your seeing (based on Ben’s message).

If you have used View Package File, then it won’t work i.e. you can’t edit because it opens package resource files in a read only state.

1 Like

#16

this must be 10 characters

0 Likes

#17

OK that’s good advice thanks!

0 Likes

#18

Anyways the plugin seems simple enough but needs cleaning. Might make a good weekend project.

0 Likes

#19

@UltraInstinct05

PY3 = sys.version_info[0] == 3

if PY3:
from urllib.request import urlopen
from urllib.parse import urlencode
else:
from urllib import urlopen
from urllib import urlencode

Is this the part that links to python? And what needs to change?

0 Likes

#20

All of the code in that .py file is python code and not just the snippet you posted. The suggestion was to create that python version file (and have that value 3.8 in it). That causes the plugin to run using Python 3.8 which is much newer version and might overcome that SSL error. If there are still errors in the console after that, then someone needs to dig deeper into the code to see what’s wrong.

0 Likes