HTML: Support <script type="text/html"> (#8371)
* Support HTML Script * Add changelog * Remove lang support
This commit is contained in:
1 parent
8ebda75fec
commit
b44e702679
4 files changed
+45
No files matched your search
@@ -0,0 +1,26 @@
|
||||
#### Support `<script type="text/html>` ([#8371](https://github.com/prettier/prettier/pull/8371) by [@sosukesuzuki](https://github.com/sosukesuzuki))
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```html
|
||||
<!-- Input -->
|
||||
<script type="text/html">
|
||||
<div>
|
||||
<p>foo</p>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- Prettier stable -->
|
||||
<script type="text/html">
|
||||
<div>
|
||||
<p>foo</p>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- Prettier master -->
|
||||
<script type="text/html">
|
||||
<div>
|
||||
<p>foo</p>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
```
|
||||
@@ -398,6 +398,10 @@ function _inferScriptParser(node) {
|
||||
return "markdown";
|
||||
}
|
||||
|
||||
if (type === "text/html") {
|
||||
return "html";
|
||||
}
|
||||
|
||||
if (type && (type.endsWith("json") || type.endsWith("importmap"))) {
|
||||
return "json";
|
||||
}
|
||||
|
||||
@@ -101,6 +101,11 @@ printWidth: 80
|
||||
</script><script type="invalid">
|
||||
{ "json":false }
|
||||
</script>
|
||||
<script type="text/html">
|
||||
<div>
|
||||
<p>foo</p>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script
|
||||
async=""
|
||||
@@ -132,6 +137,11 @@ End Function
|
||||
<script type="invalid">
|
||||
{ "json":false }
|
||||
</script>
|
||||
<script type="text/html">
|
||||
<div>
|
||||
<p>foo</p>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script
|
||||
async=""
|
||||
|
||||
@@ -12,6 +12,11 @@
|
||||
</script><script type="invalid">
|
||||
{ "json":false }
|
||||
</script>
|
||||
<script type="text/html">
|
||||
<div>
|
||||
<p>foo</p>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script
|
||||
async=""
|
||||
|
||||
Reference in new issue
Block a user