Skip to content

Print <!doctype html> lowercase rather than uppercase #6502

@k-yle

Description

@k-yle

Prettier 1.18.2
Playground link

--parser html

Input:

<!doctype html>
<html>
  text
</html>

Output:

<!DOCTYPE html>
<html>
  text
</html>

Expected behavior:
It'd be great if there were an option to disable transforming the html doctype tag into uppercase. Per the spec, the doctype is case insensitive - even google.com has its doctype declaration in lowercase. For normal HTML tags, prettier accepts all uppercase, e.g. <DIV> or all lowercase, e.g. <div>, however the doctype tag must be uppercase.

I would expect prettier not to treat the doctype differently from other HTML tags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:htmlIssues affecting HTML (and SVG but not JSX)status:needs discussionIssues needing discussion and a decision to be made before action can be taken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions