feat(html): format script with "application/ld+json" (#5642)
parent
8e612f05a0
commit
cbf06bf388
|
@ -375,6 +375,10 @@ function inferScriptParser(node) {
|
|||
if (node.attrMap.type === "text/markdown") {
|
||||
return "markdown";
|
||||
}
|
||||
|
||||
if (node.attrMap.type === "application/ld+json") {
|
||||
return "json";
|
||||
}
|
||||
}
|
||||
|
||||
if (node.name === "style") {
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`script.html 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["html"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
<script type="application/ld+json">
|
||||
{ "json":true }
|
||||
</script>
|
||||
|
||||
=====================================output=====================================
|
||||
<script type="application/ld+json">
|
||||
{ "json": true }
|
||||
</script>
|
||||
|
||||
================================================================================
|
||||
`;
|
|
@ -0,0 +1 @@
|
|||
run_spec(__dirname, ["html"]);
|
|
@ -0,0 +1,3 @@
|
|||
<script type="application/ld+json">
|
||||
{ "json":true }
|
||||
</script>
|
Loading…
Reference in New Issue