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

Simplify doctypes #19

Closed
wooorm opened this issue Jan 16, 2020 · 0 comments
Closed

Simplify doctypes #19

wooorm opened this issue Jan 16, 2020 · 0 comments
Labels
💪 phase/solved Post is done 🐛 type/bug This is a problem

Comments

@wooorm
Copy link
Member

wooorm commented Jan 16, 2020

Subject of the issue

The doctype node is currently more complex than what HTML supports.

Now that we have xast, there’s definitely no reason to be so complex.

Actual behaviour

There are name, public, and system fields which could have any string value, adding unnecessary complexity.

Expected behaviour

HTML allows the value of name to be case-insensitive html, no public, and an optional system of about:legacy-compat.

I propose removing name, public, and system, and thus making a doctype look like this:

{"type": "doctype"}

Other tools (specifically, hast-util-to-html) could have an option to add the doctype legacy string (SYSTEM "about:legacy-compat"), and maybe even have an option to use HTML instead of html.

@wooorm wooorm added 🙉 open/needs-info This needs some more info and removed 🔍 status/open labels Apr 12, 2021
@wooorm wooorm closed this as completed in 733e83b Apr 14, 2021
@wooorm wooorm added 💪 phase/solved Post is done and removed 🙉 open/needs-info This needs some more info labels Apr 14, 2021
typescript-bot pushed a commit to DefinitelyTyped/DefinitelyTyped that referenced this issue Aug 21, 2021
hast recenly moved to no longer respecting `public`, `system`
on doctype nodes, as they do not affect HTML.
For folks that are handling XML, xast is a much better ecosystem
that does allow more complex doctypes.

See: <syntax-tree/hast#19>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done 🐛 type/bug This is a problem
Development

No branches or pull requests

1 participant