support script type of text/babel in language-html (#5167)
parent
f87c82cc4e
commit
b84635f0d0
|
@ -17,6 +17,7 @@ function embed(path, print, textToDoc, options) {
|
||||||
parent.type === "script" &&
|
parent.type === "script" &&
|
||||||
((!parent.attribs.lang && !parent.attribs.type) ||
|
((!parent.attribs.lang && !parent.attribs.type) ||
|
||||||
parent.attribs.type === "text/javascript" ||
|
parent.attribs.type === "text/javascript" ||
|
||||||
|
parent.attribs.type === "text/babel" ||
|
||||||
parent.attribs.type === "application/javascript")
|
parent.attribs.type === "application/javascript")
|
||||||
) {
|
) {
|
||||||
const parser = options.parser === "flow" ? "flow" : "babylon";
|
const parser = options.parser === "flow" ? "flow" : "babylon";
|
||||||
|
|
|
@ -23,6 +23,9 @@ exports[`js.html - html-verify 1`] = `
|
||||||
|
|
||||||
alert(message);
|
alert(message);
|
||||||
</script>
|
</script>
|
||||||
|
<script type="text/babel">
|
||||||
|
const someJS = 'this should be formatted'
|
||||||
|
</script>
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var message = "Alert!";
|
var message = "Alert!";
|
||||||
|
@ -39,6 +42,9 @@ var message = "Alert!";
|
||||||
|
|
||||||
alert(message);
|
alert(message);
|
||||||
</script>
|
</script>
|
||||||
|
<script type="text/babel">
|
||||||
|
const someJS = "this should be formatted";
|
||||||
|
</script>
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
|
@ -13,3 +13,6 @@
|
||||||
|
|
||||||
alert(message);
|
alert(message);
|
||||||
</script>
|
</script>
|
||||||
|
<script type="text/babel">
|
||||||
|
const someJS = 'this should be formatted'
|
||||||
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue