Skip to content

fix(html): do not format unknown script#5132

Merged
ikatyang merged 3 commits intoprettier:masterfrom
ikatyang:fix/html/do-not-format-unknown-script
Sep 23, 2018
Merged

fix(html): do not format unknown script#5132
ikatyang merged 3 commits intoprettier:masterfrom
ikatyang:fix/html/do-not-format-unknown-script

Conversation

@ikatyang
Copy link
Copy Markdown
Member

  • do not format unknown script
  • do not normalize spaces in script tags

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

</script>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<script type="application/x-typescript">class Student { fullName: string; constructor(public firstName: string, public middleInitial: string, public lastName: string) { this.fullName = firstName + " " + middleInitial + " " + lastName; } } interface Person { firstName: string; lastName: string; } function greeter(person : Person) { return "Hello, " + person.firstName + " " + person.lastName; } let user = new Student("Jane", "M.", "User"); document.body.innerHTML = greeter(user);</script>
<script type="application/x-typescript">
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There're syntax errors in the following two cases, so we just preserve them. I was confused with these changes at the first glance, but it turns out it's just the result for the space normalization fix.

@ikatyang ikatyang mentioned this pull request Sep 22, 2018
26 tasks
@ikatyang ikatyang merged commit 51954da into prettier:master Sep 23, 2018
@ikatyang ikatyang deleted the fix/html/do-not-format-unknown-script branch September 23, 2018 00:36
@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