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

Quotes are added on empty known html arttributes #53

Closed
1 of 5 tasks
StarpTech opened this issue Oct 23, 2018 · 0 comments
Closed
1 of 5 tasks

Quotes are added on empty known html arttributes #53

StarpTech opened this issue Oct 23, 2018 · 0 comments

Comments

@StarpTech
Copy link
Member

StarpTech commented Oct 23, 2018

🐛 Bug Report

Omit quotes when possible. According to https://html.spec.whatwg.org/multipage/introduction.html#intro-early-example

Attributes are placed inside the start tag, and consist of a name and a value, separated by an "=" character. The attribute value can remain unquoted if it doesn't contain ASCII whitespace or any of " ' ` = < or >. Otherwise, it has to be quoted using either single or double quotes. The value, along with the "=" character, can be omitted altogether if the value is the empty string.

To Reproduce

Steps to reproduce the behavior:

When a known HTML attribute is used and it has no value we add quotes.

<v-layout row wrap>

result

<v-layout row wrap="">

Expected behavior

Quotes should only be added when the attribute has a value

Paste the results here:

<v-layout row wrap>

result

<v-layout row wrap>

Context

  • Angular
  • Svelte
  • Vue
  • Riot
  • HTML5 only

Your Environment

  • Prettyhtml version: 0.3.3
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

1 participant