Comments (4)
Are you using the -g
option? Trying the script myself I find that when I use -g
option it does't work. I'm not sure why at this point. I didn't write the script and it's not really maintained, but I'll try to make some time to look into over the next couple days. In the mean time, maybe @hsivonen might be able to say.
Otherwise, the version of the script at https://github.com/validator/validator/blob/master/resources/examples/html5check.py appears to still be working as expected when I use it without specifying any other options. Are you using that version? Without any options specified?
The last couple of days the test script stopped working.
If you're not using the -g
option, can you be more specific? Exactly in what way has the script stopped working? e.g., it doesn't run at all, or it runs but you get some error message? (If so, what error message.) Or it runs without errors but the output isn't what you expect?
Has the output from validator.nu changed in the last couple of days?
Yes, I made some changes to the backend recently that have some effect on the metadata of the error messages that get emitted; in particular, the messages now emit a range identifier for the location of the error in the document source, rather than a single position identifier. I wouldn't think that would affect the behavior of this script—because I'd assume the script is just passing on the messages as-is—but maybe it's trying to do some post-processing of the messages (I have no idea because I haven't looked in detail at the script source yet to see).
from validator.
I specified the errors in more detail in this issue at html5-lint: mozilla/html5-lint#15
Yes, I am using the -g
(and -eh
) option.
Apperantly the response
variable in the script is no longer automatically an interator over the lines.
Traceback (most recent call last):
File "./html5check.py", line 232, in <module>
for line in response:
TypeError: iteration over non-sequence
I was able to get the script working again with a small modification to that for-loop causing the error:
for line in response.read().split('\n'):
if line:
sys.stdout.write(quotedName)
sys.stdout.write(line + '\n')
I use the -g
option to get the output as separate lines, because I want to filter the output.
My usage of the script (on Travis to check my websites):
CHECK=$(for file in *.html; do python ../html5check.py -geh $file; done;)
if [[ ! -z $(echo "$CHECK" | grep -vE 'index_|iframe') ]]; then echo "$CHECK"; exit 1; fi;
The script itself does not seem to do any post processing to the actual content of the response.
The latest version of the script from html5-lint also works without the -g
option.
from validator.
OK it sounds like you got the fix you need. So maybe you could open a PR against the https://github.com/mozilla/html5-lint/blob/master/html5check.py and after that I can backport it to the https://github.com/validator/validator/blob/master/resources/examples/html5check.py upstream version.
Or if you believe I've regressed the backend in some way that I should fix, lemme know.
from validator.
Fixed in mozilla/html5-lint#16
from validator.
Related Issues (20)
- CSS being identified as html thus giving error
- Add "onpageswap" attribute to "body" element
- WordPress Gutenberg Block Library CSS incorrect validation HOT 3
- No warning for validator HOT 2
- Icon for "verified html" HOT 2
- Add writingsuggestions attribute
- No error when using ASCII upper alphas in Attribute Name for Custom Data Attributes HOT 1
- Possible misuse of aria-label. (If you disagree with this warning
- Add shadowrootserializable attribute to template element
- the XML syntax is not recommended
- bad my compute
- CSS text-wrap and shape-margin throwing validator errors
- Button with type="button" doesn't support role="combobox"
- Element dialog is missing required attribute role HOT 1
- Error Code 429 - too many requests
- Warnings about non supported, non global ARIA attributes use on ARIA roles
- Misunderstood language HOT 2
- <a> must not appear as a descendant of <button>
- Bad value onion-location for attribute http-equiv on element meta. HOT 1
- False positive on valid CSP `sandbox` values
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from validator.