Skip to content

Simplify doctypes #19

Closed
Closed
@wooorm

Description

@wooorm

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions