diff --git a/src/language-html/utils.js b/src/language-html/utils.js index 5b263eceb..ecbf5a139 100644 --- a/src/language-html/utils.js +++ b/src/language-html/utils.js @@ -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") { diff --git a/tests/html_script/__snapshots__/jsfmt.spec.js.snap b/tests/html_script/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..18a5cad25 --- /dev/null +++ b/tests/html_script/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,19 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`script.html 1`] = ` +====================================options===================================== +parsers: ["html"] +printWidth: 80 + | printWidth +=====================================input====================================== + + +=====================================output===================================== + + +================================================================================ +`; diff --git a/tests/html_script/jsfmt.spec.js b/tests/html_script/jsfmt.spec.js new file mode 100644 index 000000000..53763df9b --- /dev/null +++ b/tests/html_script/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname, ["html"]); diff --git a/tests/html_script/script.html b/tests/html_script/script.html new file mode 100644 index 000000000..5010a12a8 --- /dev/null +++ b/tests/html_script/script.html @@ -0,0 +1,3 @@ +