HTML: Support <script type="text/html"> (#8371)

* Support HTML Script

* Add changelog

* Remove lang support
This commit is contained in:
Sosuke Suzuki authored and GitHub committed 2020-05-21 20:29:10 +09:00
1 parent 8ebda75fec
commit b44e702679
4 files changed
+45

No files matched your search

+26
View File
@@ -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>
```
+4
View File
@@ -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=""
+5
View File
@@ -12,6 +12,11 @@
</script><script type="invalid">
{ "json":false }
</script>
<script type="text/html">
<div>
<p>foo</p>
</div>
</script>
<script
async=""