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
HTML: Fix format on style[lang="sass"]
#9051
Merged
Merged
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
481ea90
HTML: Fix format on `style[lang="sass"]`
fisker b4c262f
Update logic
fisker 100a577
Fix vue custom block parser
fisker 9f79b08
Fix changelog
fisker 0719a03
Simplify logic
fisker 58539a0
Format 0719a03
5aa8b06
Fix unstableTests path
fisker 665d344
Rename
fisker e5d325c
Update tests
fisker daea3f6
Merge branch 'master' into html-infer-parser
fisker e9ac48a
Add more test
fisker ac1c5e5
Code style
fisker File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#### Fix format on `style[lang="sass"]` ([#9051](https://github.com/prettier/prettier/pull/9051) by [@fisker](https://github.com/fisker)) | ||
|
||
<!-- prettier-ignore --> | ||
```jsx | ||
<!-- Input --> | ||
<style lang="sass"> | ||
.hero | ||
@include background-centered | ||
</style> | ||
|
||
<!-- Prettier stable --> | ||
<style lang="sass"> | ||
.hero @include background-centered; | ||
</style> | ||
|
||
<!-- Prettier master --> | ||
<style lang="sass"> | ||
.hero | ||
@include background-centered | ||
</style> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
71 changes: 71 additions & 0 deletions
71
tests/html/multiparser/unknown/__snapshots__/jsfmt.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`unknown-lang.html format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["html"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<style lang="unknown"> | ||
foo | ||
bar | ||
</style> | ||
|
||
<script lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown" lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
</body> | ||
</html> | ||
|
||
=====================================output===================================== | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<style lang="unknown"> | ||
foo | ||
bar | ||
fisker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</style> | ||
|
||
<script lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown" lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
</body> | ||
</html> | ||
|
||
================================================================================ | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
run_spec(__dirname, ["html"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,6 +164,66 @@ printWidth: 80 | |
================================================================================ | ||
`; | ||
|
||
exports[`unknown.vue format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["vue"] | ||
printWidth: 80 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add tests for the case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| printWidth | ||
=====================================input====================================== | ||
<style lang="unknown"> | ||
foo | ||
bar | ||
</style> | ||
|
||
<script lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown" lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<template lang="unknown"> | ||
foo | ||
bar | ||
</template> | ||
|
||
=====================================output===================================== | ||
<style lang="unknown"> | ||
foo | ||
bar | ||
</style> | ||
|
||
<script lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<script type="unknown" lang="unknown"> | ||
foo | ||
bar | ||
</script> | ||
|
||
<template lang="unknown"> | ||
foo | ||
bar | ||
</template> | ||
|
||
================================================================================ | ||
`; | ||
|
||
exports[`vue-component.vue format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["vue"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One second, I need change this to valid css, because the parser might still be
css
and it throws.