-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yoko Oh Noes should report any content after </body> as an error. #517
Comments
I tried the examples in http://mozilla.github.io/slowparse/ but slowparse didn't report any errors. Probably the most sensible path forward is try to add this check to our copy of slowparse. I would like to someday push our changes upstream. |
OK, I'll see if I can make those changes and will post a PR if it pans out. Likely sometime tonight or over the weekend. |
Thanks for looking into this. |
Your welcome. I took a look at the source code over the weekend, but I'm having trouble understanding where the syntax errors are being created. I can see that there are factory functions in slowparse for each parse error, and that in live-editor.output_webpage.js there are lint messages. I'm not familiar with backbone, so maybe this is where my confusion is, but I can't seem to find where the errors are being used. Slowparse doesn't seem to have any effect on the output. I can completely remove parse errors, and nothing seems to break. For example: I removed INVALID_TAG_NAME from parseErrorBuilders, and even removed each "throws" for INVALID_TAG_NAME and yet the error is still caught and Oh Noes, still says the appropriate message when I use an invalid tag name. I also see that postMessage() is somehow used to communicate with webpageOutput but I don't really understand how, other than it is used in the html worker. Any clue where I look to get started with this? |
When making changes always, make changes in |
Ah OK thanks! |
One of the most common issues reported in the HTML/CSS challenges is caused from users creating nodes before or after the
<body>
and</body>
tags (after being the most common).It's possible to change each grader to display a message such as:
"It looks like you are trying to place your content after the
</body>
tag. Make sure your content sits between the<body>
and</body>
tags."However this does not prevent the HTML from rendering in the output window, which is what I think is confusing students so much, and it's not valid HTML anyways.
Slowparse should see the following as a syntax error and give an appropriate message.
<body></body>node</html>
as well as<body></body></html>node
All though the examples will technically render in a browser W3C will give, "Error: Non-space character after body." followed by "Fatal Error: Cannot recover after last error. Any further errors will be ignored." when ran through their validator.
To limit user confusion, and to encourage writing valid HTML, this should be seen as an error at KA.
The text was updated successfully, but these errors were encountered: