Skip to content
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

Rules for text in tables result in unintuitive parse errors #4046

Open
stevecheckoway opened this issue Sep 22, 2018 · 1 comment
Open

Rules for text in tables result in unintuitive parse errors #4046

stevecheckoway opened this issue Sep 22, 2018 · 1 comment
Labels
clarification Standard could be clearer topic: parser

Comments

@stevecheckoway
Copy link

https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-intabletext

If any of the tokens in the pending table character tokens list are character tokens that are not ASCII whitespace, then this is a parse error:​ reprocess the character tokens in the pending table character tokens list using the rules given in the "anything else" entry in the "in table" insertion mode.

The quoted text indicates that this is a parse error and then directs the UA to reprocess the tokens according to a rule that also adds a parse error:

Parse error. Enable foster parenting, process the token using the rules for the "in body" insertion mode, and then disable foster parenting.

It seems like the intended behavior is for non-ASCII whitespace characters to be errors. E.g.,

<!DOCTYPE html>
<html>
<body>
<table>
X
</table>
</body>
</html>

should have one one error for the X.

The rules as specified give four parse errors: one for 12.2.6.4.10 The "in table text" insertion mode > Anything else on the </table> and one for each of the LF, X, and LF tokens from 12.2.6.4.9 The "in table" insertion mode > Anything else.

@annevk annevk added clarification Standard could be clearer topic: parser labels Sep 22, 2018
@stevecheckoway
Copy link
Author

Looks like html5lib-tests gives three errors for an almost identical test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer topic: parser
Development

No branches or pull requests

2 participants