Format <script> inside SVG (#14400)
This commit is contained in:
1 parent
686320a88c
commit
ecfa324b69
9 files changed
+350
-33
No files matched your search
@@ -19,16 +19,7 @@ printWidth: 80
|
||||
</html>
|
||||
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs /> <style >
|
||||
polygon { fill: black }
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font:18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
<defs />
|
||||
|
||||
<g>
|
||||
<g><polygon points="5,5 195,10 185,185 10,195" />
|
||||
@@ -73,18 +64,6 @@ printWidth: 80
|
||||
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs />
|
||||
<style>
|
||||
polygon {
|
||||
fill: black;
|
||||
}
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font: 18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<g>
|
||||
<g>
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`svg.html - {"embeddedLanguageFormatting":"off"} format 1`] = `
|
||||
====================================options=====================================
|
||||
embeddedLanguageFormatting: "off"
|
||||
parsers: ["html"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>SVG</title>
|
||||
</head>
|
||||
<body>
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<script>
|
||||
document.addEventListener(
|
||||
'DOMContentLoaded', () => {
|
||||
const element = document.getElementById('foo')
|
||||
if (element) {
|
||||
element.fillStyle = 'currentColor'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style >
|
||||
polygon { fill: black }
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font:18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
</svg>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
=====================================output=====================================
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>SVG</title>
|
||||
</head>
|
||||
<body>
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<script>
|
||||
document.addEventListener(
|
||||
'DOMContentLoaded', () => {
|
||||
const element = document.getElementById('foo')
|
||||
if (element) {
|
||||
element.fillStyle = 'currentColor'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
polygon { fill: black }
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font:18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
</svg>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`svg.html format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["html"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>SVG</title>
|
||||
</head>
|
||||
<body>
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<script>
|
||||
document.addEventListener(
|
||||
'DOMContentLoaded', () => {
|
||||
const element = document.getElementById('foo')
|
||||
if (element) {
|
||||
element.fillStyle = 'currentColor'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style >
|
||||
polygon { fill: black }
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font:18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
</svg>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
=====================================output=====================================
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>SVG</title>
|
||||
</head>
|
||||
<body>
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const element = document.getElementById("foo");
|
||||
if (element) {
|
||||
element.fillStyle = "currentColor";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
polygon {
|
||||
fill: black;
|
||||
}
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font: 18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
</svg>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`svg.svg - {"embeddedLanguageFormatting":"off"} format 1`] = `
|
||||
====================================options=====================================
|
||||
embeddedLanguageFormatting: "off"
|
||||
parsers: ["html"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<script>
|
||||
document.addEventListener(
|
||||
'DOMContentLoaded', () => {
|
||||
const element = document.getElementById('foo')
|
||||
if (element) {
|
||||
element.fillStyle = 'currentColor'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style >
|
||||
polygon { fill: black }
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font:18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
</svg>
|
||||
|
||||
=====================================output=====================================
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<script>
|
||||
document.addEventListener(
|
||||
'DOMContentLoaded', () => {
|
||||
const element = document.getElementById('foo')
|
||||
if (element) {
|
||||
element.fillStyle = 'currentColor'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
polygon { fill: black }
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font:18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
</svg>
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`svg.svg format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["html"]
|
||||
printWidth: 80
|
||||
| printWidth
|
||||
=====================================input======================================
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<script>
|
||||
document.addEventListener(
|
||||
'DOMContentLoaded', () => {
|
||||
const element = document.getElementById('foo')
|
||||
if (element) {
|
||||
element.fillStyle = 'currentColor'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style >
|
||||
polygon { fill: black }
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font:18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
</svg>
|
||||
|
||||
=====================================output=====================================
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const element = document.getElementById("foo");
|
||||
if (element) {
|
||||
element.fillStyle = "currentColor";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
polygon {
|
||||
fill: black;
|
||||
}
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font: 18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
</svg>
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -0,0 +1,2 @@
|
||||
run_spec(import.meta, ["html"]);
|
||||
run_spec(import.meta, ["html"], { embeddedLanguageFormatting: "off" });
|
||||
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>SVG</title>
|
||||
</head>
|
||||
<body>
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<script>
|
||||
document.addEventListener(
|
||||
'DOMContentLoaded', () => {
|
||||
const element = document.getElementById('foo')
|
||||
if (element) {
|
||||
element.fillStyle = 'currentColor'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style >
|
||||
polygon { fill: black }
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font:18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
</svg>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,21 @@
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<script>
|
||||
document.addEventListener(
|
||||
'DOMContentLoaded', () => {
|
||||
const element = document.getElementById('foo')
|
||||
if (element) {
|
||||
element.fillStyle = 'currentColor'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style >
|
||||
polygon { fill: black }
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font:18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 398 B |
@@ -11,16 +11,7 @@
|
||||
</html>
|
||||
|
||||
<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs /> <style >
|
||||
polygon { fill: black }
|
||||
|
||||
div {
|
||||
color: white;
|
||||
font:18px serif;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
<defs />
|
||||
|
||||
<g>
|
||||
<g><polygon points="5,5 195,10 185,185 10,195" />
|
||||
|
||||
Reference in new issue
Block a user