@maizzle/framework 4.0.0-alpha.5 → 4.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/nodejs.yml +1 -1
- package/package.json +6 -5
- package/src/commands/serve.js +21 -14
- package/src/generators/output/to-string.js +1 -1
- package/src/generators/postcss.js +29 -0
- package/src/generators/posthtml.js +66 -61
- package/src/generators/tailwindcss.js +2 -2
- package/src/index.js +17 -13
- package/src/transformers/index.js +60 -57
- package/src/transformers/inlineCss.js +1 -1
- package/src/transformers/minify.js +1 -1
- package/src/transformers/prettify.js +1 -1
- package/src/transformers/removeInlineBackgroundColor.js +1 -1
- package/src/transformers/removeInlinedSelectors.js +71 -0
- package/src/transformers/removeUnusedCss.js +17 -2
- package/src/transformers/sixHex.js +24 -1
- package/src/transformers/transform.js +35 -6
- package/test/expected/posthtml/component.html +13 -0
- package/test/expected/{inheritance.html → posthtml/extend-template.html} +2 -2
- package/test/expected/posthtml/fetch.html +5 -0
- package/test/expected/posthtml/layout.html +3 -0
- package/test/expected/transformers/atimport-in-style.html +14 -0
- package/test/expected/transformers/base-image-url.html +83 -83
- package/test/expected/transformers/preserve-transform-css.html +27 -0
- package/test/fixtures/posthtml/component.html +19 -0
- package/test/fixtures/{inheritance.html → posthtml/extend-template.html} +7 -7
- package/test/fixtures/posthtml/fetch.html +9 -0
- package/test/fixtures/posthtml/layout.html +11 -0
- package/test/fixtures/transformers/atimport-in-style.html +11 -0
- package/test/fixtures/transformers/base-image-url.html +85 -85
- package/test/fixtures/transformers/preserve-transform-css.html +25 -0
- package/test/stubs/components/component.html +5 -0
- package/test/stubs/data.json +14 -0
- package/test/stubs/layouts/basic.html +1 -0
- package/test/stubs/{layout.html → layouts/full.html} +0 -0
- package/test/stubs/{layout-basic.html → layouts/template.html} +5 -5
- package/test/stubs/post.css +6 -0
- package/test/stubs/tailwind/{preserve.html → content-source.html} +0 -0
- package/test/stubs/tailwind/tailwind.css +3 -0
- package/test/stubs/template.html +10 -10
- package/test/test-postcss.js +8 -0
- package/test/test-posthtml.js +66 -0
- package/test/{test-tailwind.js → test-tailwindcss.js} +3 -3
- package/test/test-tostring.js +142 -132
- package/test/test-transformers.js +479 -343
- package/test/expected/transformers/transform-postcss.html +0 -19
|
@@ -1,22 +1,51 @@
|
|
|
1
1
|
const posthtml = require('posthtml')
|
|
2
|
+
const {get, omit, has} = require('lodash')
|
|
3
|
+
const PostCSS = require('../generators/postcss')
|
|
2
4
|
const posthtmlContent = require('posthtml-content')
|
|
3
5
|
const Tailwind = require('../generators/tailwindcss')
|
|
4
|
-
const
|
|
6
|
+
const safeClassNames = require('posthtml-safe-class-names')
|
|
5
7
|
|
|
6
8
|
module.exports = async (html, config = {}, direct = false) => {
|
|
7
9
|
const replacements = direct ? config : get(config, 'transform', {})
|
|
8
10
|
const posthtmlOptions = get(config, 'build.posthtml.options', {})
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
|
-
* Compile CSS in <style
|
|
13
|
+
* Compile CSS in <style {post|tailwind}css> tags
|
|
12
14
|
*/
|
|
13
15
|
const maizzleConfig = omit(config, ['build.tailwind.css', 'css'])
|
|
14
16
|
const tailwindConfig = get(config, 'build.tailwind.config', 'tailwind.config.js')
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
replacements.postcss = css => PostCSS.process(css, maizzleConfig)
|
|
19
|
+
replacements.tailwindcss = css => Tailwind.compile(css, html, tailwindConfig, maizzleConfig)
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
return posthtml([
|
|
22
|
+
styleDataEmbed(),
|
|
23
|
+
posthtmlContent(replacements),
|
|
24
|
+
safeClassNames()
|
|
25
|
+
])
|
|
26
|
+
.process(html, posthtmlOptions)
|
|
27
|
+
.then(result => result.html)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Prevent CSS inlining
|
|
32
|
+
*
|
|
33
|
+
* Add a `data-embed` attribute to <style> tags that we want to preserve.
|
|
34
|
+
* Can be used for HTML email client targeting hacks.
|
|
35
|
+
*/
|
|
36
|
+
const styleDataEmbed = () => tree => {
|
|
37
|
+
const process = node => {
|
|
38
|
+
if (
|
|
39
|
+
node.tag === 'style'
|
|
40
|
+
&& node.attrs
|
|
41
|
+
&& (has(node.attrs, 'preserve') || has(node.attrs, 'embed'))) {
|
|
42
|
+
node.attrs = {...node.attrs, 'data-embed': true}
|
|
43
|
+
node.attrs.preserve = false
|
|
44
|
+
node.attrs.embed = false
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return node
|
|
48
|
+
}
|
|
20
49
|
|
|
21
|
-
return
|
|
50
|
+
return tree.walk(process)
|
|
22
51
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Parent
|
|
2
|
-
Child in second.html
|
|
1
|
+
Parent
|
|
2
|
+
Child in second.html
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<head>
|
|
3
|
-
<style>.test {
|
|
4
|
-
background-image: url('https://example.com/image.jpg');
|
|
5
|
-
background: url('https://example.com/image.jpg');
|
|
6
|
-
background-image: url('https://preserve.me/image.jpg');
|
|
7
|
-
background: url('https://preserve.me/image.jpg');
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.test-2 {
|
|
11
|
-
background-image: url("https://example.com/image.jpg");
|
|
12
|
-
background: url("https://example.com/image.jpg");
|
|
13
|
-
background-image: url("https://preserve.me/image.jpg");
|
|
14
|
-
background: url("https://preserve.me/image.jpg");
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.test-3 {
|
|
18
|
-
background-image: url(https://example.com/image.jpg);
|
|
19
|
-
background: url(https://example.com/image.jpg);
|
|
20
|
-
background-image: url(https://preserve.me/image.jpg);
|
|
21
|
-
background: url(https://preserve.me/image.jpg);
|
|
22
|
-
}</style>
|
|
23
|
-
</head>
|
|
24
|
-
|
|
25
|
-
<body>
|
|
26
|
-
<img src="https://example.com/test.jpg">
|
|
27
|
-
<img src="https://example.com/test.jpg">
|
|
28
|
-
|
|
29
|
-
<img src="https://example.com/image1.jpg" srcset="https://example.com/image1-HD.jpg 2x, https://example.com/image1-phone.jpg 100w">
|
|
30
|
-
|
|
31
|
-
<img src="https://example.com/image2.jpg" srcset="https://example.com/image2-HD.jpg 2x, https://example.com/image2-phone.jpg 100w">
|
|
32
|
-
|
|
33
|
-
<picture>
|
|
34
|
-
<source media="(max-width: 799px)" srcset="https://example.com/elva-480w-close-portrait.jpg">
|
|
35
|
-
<source media="(min-width: 800px)" srcset="https://example.com/elva-800w.jpg">
|
|
36
|
-
<img src="https://example.com/elva-800w.jpg" alt="...">
|
|
37
|
-
</picture>
|
|
38
|
-
|
|
39
|
-
<video width="250" poster="https://example.com/flower.jpg">
|
|
40
|
-
<source src="https://example.com/media/flower.webm" type="video/webm">
|
|
41
|
-
<source src="https://example.tv/media/flower.mp4" type="video/mp4">
|
|
42
|
-
<track default="" kind="captions" srclang="en" src="https://example.com/media/tracks/friday.vtt">
|
|
43
|
-
</video>
|
|
44
|
-
|
|
45
|
-
<audio src="https://example.com/media/sample.mp3">
|
|
46
|
-
Fallback content
|
|
47
|
-
</audio>
|
|
48
|
-
|
|
49
|
-
<embed type="video/webm" src="https://example.com/media/flower.mp4" width="250" height="200">
|
|
50
|
-
|
|
51
|
-
<iframe width="300" height="200" src="https://example.com/embed.html"></iframe>
|
|
52
|
-
|
|
53
|
-
<input type="image" src="https://example.com/image.jpg" alt="">
|
|
54
|
-
|
|
55
|
-
<script src="https://example.com/javascript.js"></script>
|
|
56
|
-
|
|
57
|
-
<div>
|
|
58
|
-
<!--[if mso]>
|
|
59
|
-
<v:image xmlns:v="urn:schemas-microsoft-com:vml" src="https://example.com/image.jpg" style="600px;height:400px;" />
|
|
60
|
-
<v:rect fill="false" stroke="false" style="position:absolute;600px;height:400px;">
|
|
61
|
-
<v:textbox inset="0,0,0,0"><div><![endif]-->
|
|
62
|
-
<div>test</div>
|
|
63
|
-
<!--[if mso]></div></v:textbox></v:rect><![endif]-->
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<table>
|
|
67
|
-
<tr>
|
|
68
|
-
<td background="https://example.com/image.png" bgcolor="#7bceeb" width="120" height="92" valign="top">
|
|
69
|
-
<!--[if gte mso 9]>
|
|
70
|
-
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:120px;height:92px;">
|
|
71
|
-
<v:fill type="tile" src="https://example.com/image.png" color="#7bceeb" />
|
|
72
|
-
<v:textbox inset="0,0,0,0">
|
|
73
|
-
<![endif]-->
|
|
74
|
-
<div>test</div>
|
|
75
|
-
<!--[if gte mso 9]>
|
|
76
|
-
</v:textbox>
|
|
77
|
-
</v:rect>
|
|
78
|
-
<![endif]-->
|
|
79
|
-
</td>
|
|
80
|
-
</tr>
|
|
81
|
-
</table>
|
|
82
|
-
</body>
|
|
83
|
-
</html>
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<style>.test {
|
|
4
|
+
background-image: url('https://example.com/image.jpg');
|
|
5
|
+
background: url('https://example.com/image.jpg');
|
|
6
|
+
background-image: url('https://preserve.me/image.jpg');
|
|
7
|
+
background: url('https://preserve.me/image.jpg');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.test-2 {
|
|
11
|
+
background-image: url("https://example.com/image.jpg");
|
|
12
|
+
background: url("https://example.com/image.jpg");
|
|
13
|
+
background-image: url("https://preserve.me/image.jpg");
|
|
14
|
+
background: url("https://preserve.me/image.jpg");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.test-3 {
|
|
18
|
+
background-image: url(https://example.com/image.jpg);
|
|
19
|
+
background: url(https://example.com/image.jpg);
|
|
20
|
+
background-image: url(https://preserve.me/image.jpg);
|
|
21
|
+
background: url(https://preserve.me/image.jpg);
|
|
22
|
+
}</style>
|
|
23
|
+
</head>
|
|
24
|
+
|
|
25
|
+
<body>
|
|
26
|
+
<img src="https://example.com/test.jpg">
|
|
27
|
+
<img src="https://example.com/test.jpg">
|
|
28
|
+
|
|
29
|
+
<img src="https://example.com/image1.jpg" srcset="https://example.com/image1-HD.jpg 2x, https://example.com/image1-phone.jpg 100w">
|
|
30
|
+
|
|
31
|
+
<img src="https://example.com/image2.jpg" srcset="https://example.com/image2-HD.jpg 2x, https://example.com/image2-phone.jpg 100w">
|
|
32
|
+
|
|
33
|
+
<picture>
|
|
34
|
+
<source media="(max-width: 799px)" srcset="https://example.com/elva-480w-close-portrait.jpg">
|
|
35
|
+
<source media="(min-width: 800px)" srcset="https://example.com/elva-800w.jpg">
|
|
36
|
+
<img src="https://example.com/elva-800w.jpg" alt="...">
|
|
37
|
+
</picture>
|
|
38
|
+
|
|
39
|
+
<video width="250" poster="https://example.com/flower.jpg">
|
|
40
|
+
<source src="https://example.com/media/flower.webm" type="video/webm">
|
|
41
|
+
<source src="https://example.tv/media/flower.mp4" type="video/mp4">
|
|
42
|
+
<track default="" kind="captions" srclang="en" src="https://example.com/media/tracks/friday.vtt">
|
|
43
|
+
</video>
|
|
44
|
+
|
|
45
|
+
<audio src="https://example.com/media/sample.mp3">
|
|
46
|
+
Fallback content
|
|
47
|
+
</audio>
|
|
48
|
+
|
|
49
|
+
<embed type="video/webm" src="https://example.com/media/flower.mp4" width="250" height="200">
|
|
50
|
+
|
|
51
|
+
<iframe width="300" height="200" src="https://example.com/embed.html"></iframe>
|
|
52
|
+
|
|
53
|
+
<input type="image" src="https://example.com/image.jpg" alt="">
|
|
54
|
+
|
|
55
|
+
<script src="https://example.com/javascript.js"></script>
|
|
56
|
+
|
|
57
|
+
<div>
|
|
58
|
+
<!--[if mso]>
|
|
59
|
+
<v:image xmlns:v="urn:schemas-microsoft-com:vml" src="https://example.com/image.jpg" style="600px;height:400px;" />
|
|
60
|
+
<v:rect fill="false" stroke="false" style="position:absolute;600px;height:400px;">
|
|
61
|
+
<v:textbox inset="0,0,0,0"><div><![endif]-->
|
|
62
|
+
<div>test</div>
|
|
63
|
+
<!--[if mso]></div></v:textbox></v:rect><![endif]-->
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<table>
|
|
67
|
+
<tr>
|
|
68
|
+
<td background="https://example.com/image.png" bgcolor="#7bceeb" width="120" height="92" valign="top">
|
|
69
|
+
<!--[if gte mso 9]>
|
|
70
|
+
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:120px;height:92px;">
|
|
71
|
+
<v:fill type="tile" src="https://example.com/image.png" color="#7bceeb" />
|
|
72
|
+
<v:textbox inset="0,0,0,0">
|
|
73
|
+
<![endif]-->
|
|
74
|
+
<div>test</div>
|
|
75
|
+
<!--[if gte mso 9]>
|
|
76
|
+
</v:textbox>
|
|
77
|
+
</v:rect>
|
|
78
|
+
<![endif]-->
|
|
79
|
+
</td>
|
|
80
|
+
</tr>
|
|
81
|
+
</table>
|
|
82
|
+
</body>
|
|
83
|
+
</html>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<style data-embed="">.block {
|
|
5
|
+
display: block !important;
|
|
6
|
+
} .inline {
|
|
7
|
+
display: inline !important;
|
|
8
|
+
} .table {
|
|
9
|
+
display: table !important;
|
|
10
|
+
} .contents {
|
|
11
|
+
display: contents !important;
|
|
12
|
+
} .transform {
|
|
13
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;
|
|
14
|
+
} div {
|
|
15
|
+
text-transform: uppercase;
|
|
16
|
+
} [data-ogsc] .inexistent {
|
|
17
|
+
color: #ef4444;
|
|
18
|
+
} div > u + .body .gmail-android-block {
|
|
19
|
+
display: block !important;
|
|
20
|
+
} u + #body a {
|
|
21
|
+
color: inherit;
|
|
22
|
+
}</style>
|
|
23
|
+
</head>
|
|
24
|
+
<body>
|
|
25
|
+
<div>test</div>
|
|
26
|
+
</body>
|
|
27
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<component
|
|
2
|
+
src="test/stubs/components/component.html"
|
|
3
|
+
text="Example"
|
|
4
|
+
locals='{
|
|
5
|
+
"foo": "bar"
|
|
6
|
+
}'
|
|
7
|
+
>
|
|
8
|
+
Variable from page: [[ page.env ]]
|
|
9
|
+
|
|
10
|
+
<component
|
|
11
|
+
src="test/stubs/components/component.html"
|
|
12
|
+
text="Nested component"
|
|
13
|
+
locals='{
|
|
14
|
+
"foo": "bar (nested)"
|
|
15
|
+
}'
|
|
16
|
+
>
|
|
17
|
+
Variable from page (nested): [[ page.env ]]
|
|
18
|
+
</component>
|
|
19
|
+
</component>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
---
|
|
2
|
-
template: second
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
<extends src="test/stubs/template.html">
|
|
6
|
-
<block name="button">Child in second.html</block>
|
|
7
|
-
</extends>
|
|
1
|
+
---
|
|
2
|
+
template: second
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<extends src="test/stubs/template.html">
|
|
6
|
+
<block name="button">Child in second.html</block>
|
|
7
|
+
</extends>
|
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<head>
|
|
3
|
-
<style>
|
|
4
|
-
.test {
|
|
5
|
-
background-image: url('image.jpg');
|
|
6
|
-
background: url('image.jpg');
|
|
7
|
-
background-image: url('https://preserve.me/image.jpg');
|
|
8
|
-
background: url('https://preserve.me/image.jpg');
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.test-2 {
|
|
12
|
-
background-image: url("image.jpg");
|
|
13
|
-
background: url("image.jpg");
|
|
14
|
-
background-image: url("https://preserve.me/image.jpg");
|
|
15
|
-
background: url("https://preserve.me/image.jpg");
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.test-3 {
|
|
19
|
-
background-image: url(image.jpg);
|
|
20
|
-
background: url(image.jpg);
|
|
21
|
-
background-image: url(https://preserve.me/image.jpg);
|
|
22
|
-
background: url(https://preserve.me/image.jpg);
|
|
23
|
-
}
|
|
24
|
-
</style>
|
|
25
|
-
</head>
|
|
26
|
-
|
|
27
|
-
<body>
|
|
28
|
-
<img src="test.jpg">
|
|
29
|
-
<img src="https://example.com/test.jpg">
|
|
30
|
-
|
|
31
|
-
<img src="image1.jpg" srcset="image1-HD.jpg 2x,image1-phone.jpg 100w">
|
|
32
|
-
|
|
33
|
-
<img src="https://example.com/image2.jpg" srcset="https://example.com/image2-HD.jpg 2x, https://example.com/image2-phone.jpg 100w">
|
|
34
|
-
|
|
35
|
-
<picture>
|
|
36
|
-
<source media="(max-width: 799px)" srcset="elva-480w-close-portrait.jpg">
|
|
37
|
-
<source media="(min-width: 800px)" srcset="elva-800w.jpg">
|
|
38
|
-
<img src="elva-800w.jpg" alt="...">
|
|
39
|
-
</picture>
|
|
40
|
-
|
|
41
|
-
<video width="250" poster="flower.jpg">
|
|
42
|
-
<source src="media/flower.webm" type="video/webm">
|
|
43
|
-
<source src="https://example.tv/media/flower.mp4" type="video/mp4">
|
|
44
|
-
<track default kind="captions" srclang="en" src="media/tracks/friday.vtt">
|
|
45
|
-
</video>
|
|
46
|
-
|
|
47
|
-
<audio src="media/sample.mp3">
|
|
48
|
-
Fallback content
|
|
49
|
-
</audio>
|
|
50
|
-
|
|
51
|
-
<embed type="video/webm" src="media/flower.mp4" width="250" height="200">
|
|
52
|
-
|
|
53
|
-
<iframe width="300" height="200" src="embed.html"></iframe>
|
|
54
|
-
|
|
55
|
-
<input type="image" src="image.jpg" alt="">
|
|
56
|
-
|
|
57
|
-
<script src="javascript.js"></script>
|
|
58
|
-
|
|
59
|
-
<div>
|
|
60
|
-
<!--[if mso]>
|
|
61
|
-
<v:image xmlns:v="urn:schemas-microsoft-com:vml" src="image.jpg" style="600px;height:400px;" />
|
|
62
|
-
<v:rect fill="false" stroke="false" style="position:absolute;600px;height:400px;">
|
|
63
|
-
<v:textbox inset="0,0,0,0"><div><![endif]-->
|
|
64
|
-
<div>test</div>
|
|
65
|
-
<!--[if mso]></div></v:textbox></v:rect><![endif]-->
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<table>
|
|
69
|
-
<tr>
|
|
70
|
-
<td background="image.png" bgcolor="#7bceeb" width="120" height="92" valign="top">
|
|
71
|
-
<!--[if gte mso 9]>
|
|
72
|
-
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:120px;height:92px;">
|
|
73
|
-
<v:fill type="tile" src="image.png" color="#7bceeb" />
|
|
74
|
-
<v:textbox inset="0,0,0,0">
|
|
75
|
-
<![endif]-->
|
|
76
|
-
<div>test</div>
|
|
77
|
-
<!--[if gte mso 9]>
|
|
78
|
-
</v:textbox>
|
|
79
|
-
</v:rect>
|
|
80
|
-
<![endif]-->
|
|
81
|
-
</td>
|
|
82
|
-
</tr>
|
|
83
|
-
</table>
|
|
84
|
-
</body>
|
|
85
|
-
</html>
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<style>
|
|
4
|
+
.test {
|
|
5
|
+
background-image: url('image.jpg');
|
|
6
|
+
background: url('image.jpg');
|
|
7
|
+
background-image: url('https://preserve.me/image.jpg');
|
|
8
|
+
background: url('https://preserve.me/image.jpg');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.test-2 {
|
|
12
|
+
background-image: url("image.jpg");
|
|
13
|
+
background: url("image.jpg");
|
|
14
|
+
background-image: url("https://preserve.me/image.jpg");
|
|
15
|
+
background: url("https://preserve.me/image.jpg");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.test-3 {
|
|
19
|
+
background-image: url(image.jpg);
|
|
20
|
+
background: url(image.jpg);
|
|
21
|
+
background-image: url(https://preserve.me/image.jpg);
|
|
22
|
+
background: url(https://preserve.me/image.jpg);
|
|
23
|
+
}
|
|
24
|
+
</style>
|
|
25
|
+
</head>
|
|
26
|
+
|
|
27
|
+
<body>
|
|
28
|
+
<img src="test.jpg">
|
|
29
|
+
<img src="https://example.com/test.jpg">
|
|
30
|
+
|
|
31
|
+
<img src="image1.jpg" srcset="image1-HD.jpg 2x,image1-phone.jpg 100w">
|
|
32
|
+
|
|
33
|
+
<img src="https://example.com/image2.jpg" srcset="https://example.com/image2-HD.jpg 2x, https://example.com/image2-phone.jpg 100w">
|
|
34
|
+
|
|
35
|
+
<picture>
|
|
36
|
+
<source media="(max-width: 799px)" srcset="elva-480w-close-portrait.jpg">
|
|
37
|
+
<source media="(min-width: 800px)" srcset="elva-800w.jpg">
|
|
38
|
+
<img src="elva-800w.jpg" alt="...">
|
|
39
|
+
</picture>
|
|
40
|
+
|
|
41
|
+
<video width="250" poster="flower.jpg">
|
|
42
|
+
<source src="media/flower.webm" type="video/webm">
|
|
43
|
+
<source src="https://example.tv/media/flower.mp4" type="video/mp4">
|
|
44
|
+
<track default kind="captions" srclang="en" src="media/tracks/friday.vtt">
|
|
45
|
+
</video>
|
|
46
|
+
|
|
47
|
+
<audio src="media/sample.mp3">
|
|
48
|
+
Fallback content
|
|
49
|
+
</audio>
|
|
50
|
+
|
|
51
|
+
<embed type="video/webm" src="media/flower.mp4" width="250" height="200">
|
|
52
|
+
|
|
53
|
+
<iframe width="300" height="200" src="embed.html"></iframe>
|
|
54
|
+
|
|
55
|
+
<input type="image" src="image.jpg" alt="">
|
|
56
|
+
|
|
57
|
+
<script src="javascript.js"></script>
|
|
58
|
+
|
|
59
|
+
<div>
|
|
60
|
+
<!--[if mso]>
|
|
61
|
+
<v:image xmlns:v="urn:schemas-microsoft-com:vml" src="image.jpg" style="600px;height:400px;" />
|
|
62
|
+
<v:rect fill="false" stroke="false" style="position:absolute;600px;height:400px;">
|
|
63
|
+
<v:textbox inset="0,0,0,0"><div><![endif]-->
|
|
64
|
+
<div>test</div>
|
|
65
|
+
<!--[if mso]></div></v:textbox></v:rect><![endif]-->
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<table>
|
|
69
|
+
<tr>
|
|
70
|
+
<td background="image.png" bgcolor="#7bceeb" width="120" height="92" valign="top">
|
|
71
|
+
<!--[if gte mso 9]>
|
|
72
|
+
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:120px;height:92px;">
|
|
73
|
+
<v:fill type="tile" src="image.png" color="#7bceeb" />
|
|
74
|
+
<v:textbox inset="0,0,0,0">
|
|
75
|
+
<![endif]-->
|
|
76
|
+
<div>test</div>
|
|
77
|
+
<!--[if gte mso 9]>
|
|
78
|
+
</v:textbox>
|
|
79
|
+
</v:rect>
|
|
80
|
+
<![endif]-->
|
|
81
|
+
</td>
|
|
82
|
+
</tr>
|
|
83
|
+
</table>
|
|
84
|
+
</body>
|
|
85
|
+
</html>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<style tailwindcss preserve>
|
|
5
|
+
div {
|
|
6
|
+
@apply uppercase;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
[data-ogsc] .inexistent {
|
|
10
|
+
color: #ef4444;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
div > u + .body .gmail-android-block {
|
|
14
|
+
display: block !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
u + #body a {
|
|
18
|
+
color: inherit;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
21
|
+
</head>
|
|
22
|
+
<body>
|
|
23
|
+
<div>test</div>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<block name="template"></block>
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
---
|
|
2
|
-
template: base
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
<block name="template"></block>
|
|
1
|
+
---
|
|
2
|
+
template: base
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<block name="template"></block>
|
|
File without changes
|
package/test/stubs/template.html
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
---
|
|
2
|
-
template: first
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
<extends src="test/stubs/
|
|
6
|
-
<block name="template">
|
|
7
|
-
Parent
|
|
8
|
-
<block name="button">Child in first.html</block>
|
|
9
|
-
</block>
|
|
10
|
-
</extends>
|
|
1
|
+
---
|
|
2
|
+
template: first
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<extends src="test/stubs/layouts/template.html">
|
|
6
|
+
<block name="template">
|
|
7
|
+
Parent
|
|
8
|
+
<block name="button">Child in first.html</block>
|
|
9
|
+
</block>
|
|
10
|
+
</extends>
|