mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
feat(html/minifier): Compress characters in head
(#4682)
This commit is contained in:
parent
b509ca0c7b
commit
cac8cee62a
@ -340,7 +340,13 @@ impl VisitMut for Minifier {
|
||||
self.current_element_namespace = old_current_element_namespace;
|
||||
self.is_script_json_ld = old_value_is_script_json_ld;
|
||||
|
||||
n.children.retain(|child| !matches!(child, Child::Comment(comment) if !self.is_conditional_comment(&comment.data)));
|
||||
let allow_to_remove_spaces = &*n.tag_name == "head" && n.namespace == Namespace::HTML;
|
||||
|
||||
n.children.retain(|child| match child {
|
||||
Child::Comment(comment) if !self.is_conditional_comment(&comment.data) => false,
|
||||
Child::Text(_) if allow_to_remove_spaces => false,
|
||||
_ => true,
|
||||
});
|
||||
|
||||
let mut already_seen: AHashSet<JsWord> = Default::default();
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<a href=13.html id=rm13 aria-labelledby="rm13 attr">read more</a>
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
|
||||
<p><button autofocus value=next>Button</button></p>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<p class="foo bar">foo bar baz</p>
|
||||
<p class=foo>foo bar baz</p>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<table width=200 border=1 align=center cellpadding=4 cellspacing=0>
|
||||
<tbody><tr>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<div contenteditable="">Stress reliever</div>
|
||||
<div contenteditable="">Stress reliever</div>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<input class=form-control id={{vm.formInputName}} name={{vm.formInputName}} placeholder=YYYY-MM-DD date-range-picker data-ng-model=vm.value data-ng-model-options="{ debounce: 1000 }" data-ng-pattern=vm.options.format data-options=vm.datepickerOptions>
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<p title=\n lang="" dir="">x</p>
|
||||
<p>x</p>
|
||||
|
@ -1,7 +1,4 @@
|
||||
<!doctype html><html><head>
|
||||
<meta charset=utf-8>
|
||||
<title>Test</title>
|
||||
</head>
|
||||
<!doctype html><html><head><meta charset=utf-8><title>Test</title></head>
|
||||
<body>
|
||||
<form action=handler.php method=post>
|
||||
<input name=str>
|
||||
|
@ -1,9 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<meta charset=UTF-8>
|
||||
<meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv=X-UA-Compatible content="ie=edge">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>Document</title></head>
|
||||
<body>
|
||||
<iframe id=test src=test.html></iframe>
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<img src=test.png alt=test>
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<input name=a>
|
||||
<input name=b>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<form action=/test>
|
||||
<input onkeydown=myFunction()>
|
||||
|
@ -1,12 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
<link rel=stylesheet href=a.css>
|
||||
<link rel=stylesheet href=b.css>
|
||||
<link rel=stylesheet href=b.css>
|
||||
<link rel=stylesheet href=c.css>
|
||||
<link rel=stylesheet href=d.css type="">
|
||||
<link rel=stylesheet href=d.css type=unknown/unknown>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title><link rel=stylesheet href=a.css><link rel=stylesheet href=b.css><link rel=stylesheet href=b.css><link rel=stylesheet href=c.css><link rel=stylesheet href=d.css type=""><link rel=stylesheet href=d.css type=unknown/unknown></head>
|
||||
<body>
|
||||
<div>test</div>
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<meter id=fuel max=100 low=33 high=66 optimum=80 value=50>
|
||||
at 50/100
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<ol>
|
||||
<li>Mix flour, baking powder, sugar, and salt.</li>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<progress></progress>
|
||||
|
||||
|
@ -1,9 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<meta charset=UTF-8>
|
||||
<meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv=X-UA-Compatible content="ie=edge">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>Document</title></head>
|
||||
<body>
|
||||
<div data-test=test></div>
|
||||
<div data-test=test></div>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<a href=# rel="value1 nofollow">Link</a>
|
||||
<a href=# rel="value1 nofollow">Link</a>
|
||||
|
@ -1,14 +1,10 @@
|
||||
<!doctype html><html><head><script defer>
|
||||
console.log();
|
||||
</script>
|
||||
<script>
|
||||
</script><script>
|
||||
console.log();
|
||||
</script>
|
||||
<script type=module>
|
||||
</script><script type=module>
|
||||
console.log();
|
||||
</script>
|
||||
<script>window.jQuery || document.write('<script src="jquery.js"><\/script>')</script>
|
||||
<script type=text/html>
|
||||
</script><script>window.jQuery || document.write('<script src="jquery.js"><\/script>')</script><script type=text/html>
|
||||
<div>
|
||||
test
|
||||
</div>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<p title=bar>foo</p>
|
||||
<p title=bar>foo</p>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<img srcset="elva-fairy-480w.jpg 480w,elva-fairy-800w.jpg 800w" sizes="(max-width: 600px) 480px,800px" src=elva-fairy-800w.jpg alt="Elva dressed as a fairy">
|
||||
|
||||
|
@ -1,30 +1,22 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
<style>
|
||||
<!doctype html><html lang=en><head><title>Document</title><style>
|
||||
h1 {color:red;}
|
||||
p {color:blue;}
|
||||
</style>
|
||||
<style>
|
||||
</style><style>
|
||||
h1 {color:red;}
|
||||
p {color:blue;}
|
||||
</style>
|
||||
<style>
|
||||
</style><style>
|
||||
h1 {color:red;}
|
||||
p {color:blue;}
|
||||
</style>
|
||||
<style type=" ">
|
||||
</style><style type=" ">
|
||||
h1 {color:red;}
|
||||
p {color:blue;}
|
||||
</style>
|
||||
<style>
|
||||
</style><style>
|
||||
h1 {color:red;}
|
||||
p {color:blue;}
|
||||
</style>
|
||||
<style type=unknown/unknown>
|
||||
</style><style type=unknown/unknown>
|
||||
h1 {color:red;}
|
||||
p {color:blue;}
|
||||
</style>
|
||||
</head>
|
||||
</style></head>
|
||||
<body>
|
||||
<p style="color: red; background-color: rgb(100, 75, 200);"></p>
|
||||
<p></p>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<textarea name=test id=test></textarea>
|
||||
|
||||
|
@ -1,9 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<meta charset=UTF-8>
|
||||
<meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv=X-UA-Compatible content="ie=edge">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>Document</title></head>
|
||||
<body>
|
||||
|
||||
<video controls src=/media/cc0-videos/friday.mp4>
|
||||
|
@ -1,21 +1,10 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<meta charset=UTF-8>
|
||||
<meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv=X-UA-Compatible content="ie=edge">
|
||||
<title>Document</title>
|
||||
<!--[if !IE]>-->
|
||||
<link href=non-ie.css rel=stylesheet>
|
||||
<!--<![endif]-->
|
||||
<!--[if IE]>
|
||||
<!doctype html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>Document</title><!--[if !IE]>--><link href=non-ie.css rel=stylesheet><!--<![endif]--><!--[if IE]>
|
||||
<link type="text/css" rel="stylesheet" href="/stylesheets/no-ie.css">
|
||||
<![endif]-->
|
||||
<!--[if IE 8]>
|
||||
<![endif]--><!--[if IE 8]>
|
||||
<link href="ie8only.css" rel="stylesheet">
|
||||
<![endif]-->
|
||||
<!-- [if IE 8]>
|
||||
<![endif]--><!-- [if IE 8]>
|
||||
<link href="ie8only.css" rel="stylesheet">
|
||||
<![endif] -->
|
||||
</head>
|
||||
<![endif] --></head>
|
||||
<body>
|
||||
|
||||
|
||||
|
@ -1,7 +1,4 @@
|
||||
<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head>
|
||||
<title>!DOCTYPE</title>
|
||||
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
|
||||
</head>
|
||||
<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>!DOCTYPE</title><meta http-equiv=Content-Type content="text/html; charset=utf-8"></head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html><head>
|
||||
<title>Title of the document</title>
|
||||
</head>
|
||||
<!doctype html><html><head><title>Title of the document</title></head>
|
||||
|
||||
<body>
|
||||
The content of the document......
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html><head>
|
||||
<title>Title of the document</title>
|
||||
</head>
|
||||
<!doctype html><html><head><title>Title of the document</title></head>
|
||||
|
||||
<body>
|
||||
The content of the document......
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html system "about:legacy-compat"><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html system "about:legacy-compat"><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<div>test</div>
|
||||
|
||||
|
@ -1,9 +1,4 @@
|
||||
<!doctype html><html lang=EN><head>
|
||||
<meta charset=UTF-8>
|
||||
<meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv=X-UA-Compatible content="ie=edge">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=EN><head><meta charset=UTF-8><meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>Document</title></head>
|
||||
<body>
|
||||
<div data-test=Test>TEST</div>
|
||||
<p>blah<span>blah 2<span>blah 3</span></span></p>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<a href=test.html><div>hey</div></a>
|
||||
<a href>ok</a>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
test<br>test
|
||||
test<br>test
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<begriffs.pagination ng-init="perPage=20" collection=logs url="\'/api/logs?user=-1\'" per-page=perPage per-page-presets=[10,20,50,100] template-url=/assets/paginate-anything.html></begriffs.pagination>
|
||||
<some-tag-1></some-tag-1><some-tag-2></some-tag-2>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<form action="" class=form-example>
|
||||
<div class=form-example>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
<p>For more information, read <a href=https://stackoverflow.com/questions/17408815/fieldset-resizes-wrong-appears-to-have-unremovable-min-width-min-content/17863685#17863685>this Stack Overflow answer</a>.</p>
|
||||
<p>a</p><div>b</div>
|
||||
|
@ -1,12 +1,7 @@
|
||||
<!doctype html><html><head>
|
||||
<title>Party Coffee Cake</title>
|
||||
<script type=application/ld+json>{"@context":"https://schema.org/","@type":"Recipe","author":{"@type":"Person","name":"Mary Stone"},"datePublished":"2018-03-10","description":"This coffee cake is awesome and perfect for parties.","name":"Party Coffee Cake","prepTime":"PT20M"}</script>
|
||||
<script type=application/ld+json crossorigin=anonymous>{"@context":"https://schema.org/","@type":"Recipe","author":{"@type":"Person","name":"Mary Stone"},"datePublished":"2018-03-10","description":"This coffee cake is awesome and perfect for parties.","name":"Party Coffee Cake","prepTime":"PT20M"}</script>
|
||||
<script type=application/ld+json crossorigin=anonymous>
|
||||
<!doctype html><html><head><title>Party Coffee Cake</title><script type=application/ld+json>{"@context":"https://schema.org/","@type":"Recipe","author":{"@type":"Person","name":"Mary Stone"},"datePublished":"2018-03-10","description":"This coffee cake is awesome and perfect for parties.","name":"Party Coffee Cake","prepTime":"PT20M"}</script><script type=application/ld+json crossorigin=anonymous>{"@context":"https://schema.org/","@type":"Recipe","author":{"@type":"Person","name":"Mary Stone"},"datePublished":"2018-03-10","description":"This coffee cake is awesome and perfect for parties.","name":"Party Coffee Cake","prepTime":"PT20M"}</script><script type=application/ld+json crossorigin=anonymous>
|
||||
{
|
||||
broken
|
||||
</script>
|
||||
<script type=unknown>
|
||||
</script><script type=unknown>
|
||||
{
|
||||
"@context": "https://schema.org/",
|
||||
"@type": "Recipe",
|
||||
@ -19,10 +14,7 @@
|
||||
"description": "This coffee cake is awesome and perfect for parties.",
|
||||
"prepTime": "PT20M"
|
||||
}
|
||||
</script>
|
||||
<script type=speculationrules>{"prerender":[{"score":0.5,"source":"list","urls":["/page/2"]},{"if_href_matches":["https://*.wikipedia.org/**"],"if_not_selector_matches":[".restricted-section *"],"score":0.1,"source":"document"}]}</script>
|
||||
<script type=importmap>{"imports":{"lodash":"/node_modules/lodash-es/lodash.js","moment":"/node_modules/moment/src/moment.js"}}</script>
|
||||
</head>
|
||||
</script><script type=speculationrules>{"prerender":[{"score":0.5,"source":"list","urls":["/page/2"]},{"if_href_matches":["https://*.wikipedia.org/**"],"if_not_selector_matches":[".restricted-section *"],"score":0.1,"source":"document"}]}</script><script type=importmap>{"imports":{"lodash":"/node_modules/lodash-es/lodash.js","moment":"/node_modules/moment/src/moment.js"}}</script></head>
|
||||
<body>
|
||||
<h2>Party coffee cake recipe</h2>
|
||||
<p>
|
||||
|
@ -1,9 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<meta charset=UTF-8>
|
||||
<meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv=X-UA-Compatible content="ie=edge">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>Document</title></head>
|
||||
<body>
|
||||
<template id=productrow>
|
||||
<div class=foo>
|
||||
|
@ -1,6 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><title>Document</title></head>
|
||||
<body>
|
||||
|
||||
<div id='John"&Harry'>Test</div>
|
@ -0,0 +1,17 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<!-- anchor linking to external file -->
|
||||
<a href="https://www.mozilla.com/">External Link</a>
|
||||
</noscript>
|
||||
<p>Rocks!</p>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,9 @@
|
||||
<!doctype html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>Document</title></head>
|
||||
<body>
|
||||
<noscript>
|
||||
|
||||
<a href=https://www.mozilla.com/>External Link</a>
|
||||
</noscript>
|
||||
<p>Rocks!</p>
|
||||
|
||||
</body></html>
|
@ -0,0 +1,21 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Document</title>
|
||||
<template>
|
||||
<div>
|
||||
test
|
||||
</div>
|
||||
<ul>
|
||||
<li>test</li>
|
||||
<li>test</li>
|
||||
</ul>
|
||||
</template>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,12 @@
|
||||
<!doctype html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>Document</title><template>
|
||||
<div>
|
||||
test
|
||||
</div>
|
||||
<ul>
|
||||
<li>test</li>
|
||||
<li>test</li>
|
||||
</ul>
|
||||
</template></head>
|
||||
<body>
|
||||
|
||||
</body></html>
|
25
crates/swc_html_minifier/tests/fixture/text/title/input.html
Normal file
25
crates/swc_html_minifier/tests/fixture/text/title/input.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>
|
||||
Document
|
||||
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
test
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>test1</li>
|
||||
<li>test2</li>
|
||||
<li>test3</li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,17 @@
|
||||
<!doctype html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>
|
||||
Document
|
||||
|
||||
</title></head>
|
||||
<body>
|
||||
<p>
|
||||
test
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>test1</li>
|
||||
<li>test2</li>
|
||||
<li>test3</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</body></html>
|
@ -1,9 +1,4 @@
|
||||
<!doctype html><html lang=en><head>
|
||||
<meta charset=UTF-8>
|
||||
<meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv=X-UA-Compatible content="ie=edge">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<!doctype html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>Document</title></head>
|
||||
<body>
|
||||
<div data-test=one></div>
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Document</title>
|
||||
Test
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,6 @@
|
||||
<!doctype html><html lang=en><head><meta charset=UTF-8><meta name=viewport content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv=X-UA-Compatible content="ie=edge"><title>Document</title></head><body>Test
|
||||
|
||||
|
||||
|
||||
|
||||
</body></html>
|
Loading…
Reference in New Issue
Block a user