Skip to content

fix(html): no need to strip newline for text in script-like tag#5111

Merged
ikatyang merged 3 commits intoprettier:masterfrom
ikatyang:fix/html/style-trailing-newline
Sep 19, 2018
Merged

fix(html): no need to strip newline for text in script-like tag#5111
ikatyang merged 3 commits intoprettier:masterfrom
ikatyang:fix/html/style-trailing-newline

Conversation

@ikatyang
Copy link
Copy Markdown
Member

@ikatyang ikatyang commented Sep 19, 2018

The issue here is that the stripTrailingHardline does not work for js/ts, I fixed it and then I realized that we always print trailing newline in every language, so there's no need to strip newline for text in script-like tag.


Prettier pr-5111
Playground link

--parser parse5

Input:

<style>
  .foo {}
</style>

Output:

<style>
.foo {
}
</style>

  • 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.

@ikatyang ikatyang changed the title fix(html): no need to strip newline for text in script-like tag 5e3844e fix(html): no need to strip newline for text in script-like tag Sep 19, 2018
@ikatyang ikatyang mentioned this pull request Sep 19, 2018
26 tasks
@ikatyang ikatyang merged commit 4a084c8 into prettier:master Sep 19, 2018
@ikatyang ikatyang deleted the fix/html/style-trailing-newline branch September 19, 2018 16:03
@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.

2 participants