Skip to content

feat(html): switch to htmlparser2#5127

Merged
ikatyang merged 5 commits intoprettier:masterfrom
ikatyang:feat/html/switch-to-htmlparser2
Sep 22, 2018
Merged

feat(html): switch to htmlparser2#5127
ikatyang merged 5 commits intoprettier:masterfrom
ikatyang:feat/html/switch-to-htmlparser2

Conversation

@ikatyang
Copy link
Copy Markdown
Member

@ikatyang ikatyang commented Sep 21, 2018

Closes #5117
Closes #5119

  • switch to htmlparser2
  • support custom self-closing tags
  • support HTML entities
  • remove extra trailing newline for <template> (repro)
  • distinguish empty/empty-string attributes (<tag x>/<tag x="">)
  • rename --parser parse5 with --parser html
    • since we didn't officially release it, I guess we don't need to deprecate/redirect it?
  • enable html since 1.15, which means it's enabled by default if you install the dev version from GitHub after this PR merged.

Prettier pr-5127
Playground link

--parser html

Input:

<Custom />

<template><div class="app"></div></template>

<X a/>

<X a=""/>

&quot;

Output:

<Custom />

<template>
  <div class="app"></div>
</template>

<X a />

<X a="" />

&quot;

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory)
  • I’ve read the contributing guidelines.

@StarpTech Sorry, it seems we do not need to switch to your fork.

@StarpTech @thorn0 Thanks for your advice!

@ikatyang ikatyang mentioned this pull request Sep 21, 2018
26 tasks
Copy link
Copy Markdown
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

@ikatyang ikatyang merged commit 13147fa into prettier:master Sep 22, 2018
@ikatyang ikatyang deleted the feat/html/switch-to-htmlparser2 branch September 22, 2018 13:53
@ikatyang ikatyang added this to the 1.15 milestone Oct 25, 2018
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 23, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants