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

Only use self-closing tags for void-elements #11

Closed
jonasfj opened this issue Jun 26, 2019 · 1 comment
Closed

Only use self-closing tags for void-elements #11

jonasfj opened this issue Jun 26, 2019 · 1 comment
Labels
bug Something isn't working pkg:sanitize_html Package sanitize_html

Comments

@jonasfj
Copy link
Member

jonasfj commented Jun 26, 2019

This is likely the cause of: dart-lang/pub-dev#2405

For a list of void-element see: https://www.w3.org/TR/html5/syntax.html#void-elements

In particular:

Tags are used to delimit the start and end of elements in the markup. Raw text, escapable raw text, and normal elements have a start tag to indicate where they begin, and an end tag to indicate where they end. The start and end tags of certain normal elements can be omitted, as described below in the section on [[#optional tags]]. Those that cannot be omitted must not be omitted. Void elements only have a start tag; end tags must not be specified for void elements. Foreign elements must either have a start tag and an end tag, or a start tag that is marked as self-closing, in which case they must not have an end tag.

It's clear that void-elements cannot have closing tags, but that for all other tags it is better to have <b></b> than <b/> as the latter is not allowed.

@jonasfj jonasfj added bug Something isn't working pkg:sanitize_html Package sanitize_html labels Jun 26, 2019
jonasfj added a commit to jonasfj/dart-neats that referenced this issue Jun 26, 2019
jonasfj added a commit to jonasfj/dart-neats that referenced this issue Jun 26, 2019
jonasfj added a commit to jonasfj/dart-neats that referenced this issue Jun 26, 2019
jonasfj added a commit that referenced this issue Jun 26, 2019
Fix issue #11, only use self-closing tags for void-elements
@jonasfj
Copy link
Member Author

jonasfj commented Jun 26, 2019

This has been fixed and patch was released in sanitize_html version 1.3.0, see:
https://pub.dev/packages/sanitize_html/versions/1.3.0#-changelog-tab-

@jonasfj jonasfj closed this as completed Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:sanitize_html Package sanitize_html
Projects
None yet
Development

No branches or pull requests

1 participant