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

Who is intentionally moving omissible tags? #7

Open
foolip opened this issue May 28, 2019 · 3 comments
Open

Who is intentionally moving omissible tags? #7

foolip opened this issue May 28, 2019 · 3 comments

Comments

@foolip
Copy link

foolip commented May 28, 2019

https://htmlparser.info/introduction/

The rules for when they can be omitted are slightly convoluted, but they assume that the DOM is not allowed to change by omitting a tag. It is however conforming to intentionally move a tag such that omitting it no longer changes the DOM.

I'm having trouble understanding what this means. I think it's saying that it's OK for an author to place end tags such that removing them have no effect, like this:

<p>foo
</p><p>bar</p>

However, that seems like a strange thing to point out as being valid, since this is aligned with the rule of thumb of omission not changing the DOM. So I think I'm misunderstanding this bit, what is being conveyed.

@zcorpan
Copy link
Owner

zcorpan commented Aug 28, 2019

What I'm trying to say is that if you have this

<p>foo</p>
<p>bar</p>

then it's not allowed to omit the </p>

but if you have

<p>foo
</p><p>bar</p>

then it is allowed.

Maybe I should have these examples, and not talk about moving tags.

@foolip
Copy link
Author

foolip commented Aug 28, 2019

Talking about the bits of markup that are valid and not what changes to markup are confirming would probably help. Removing the tag in the two cases results in the same markup, which is conforming.

Is this really an FYI to authors that omitting tags can change where whitespace ends up, rather than a matter of conformance?

@zcorpan
Copy link
Owner

zcorpan commented Aug 28, 2019

In practice it's an FYI. If you read the spec strictly, it's about conformance, but you need to wear the ultra-pedantic glasses to see it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants