You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 09ebfa2
Browse filesBrowse the repository at this point in the historyBrowse files
feat(html): trim the body of a script holding a data block
A `type` that is neither a JavaScript MIME nor JSON makes the element a
data block — a template, a raw payload — which nothing executes or
parses. Its own syntax stays as written, `{{ }}` and the spacing inside
it included, but the whitespace around it reaches no consumer, so
collapsing takes it as @swc/html does.
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
+
3
+
exports[`ConfigCacheTestCases html minimize-script-data-blocks minimize-script-data-blocks should compile 1`] =`"<!doctype html><htmllang=en><head><title>Datablocks</title><scripttype=application/ld+json>{\\"a\\":1}</script></head><body><scripttype=text/x-template><pclass=\\"a\\">{{ t }}</p></script><scripttype=text/html><div>x</div></script><scripttype=unknown/thing>rawpayload</script><scriptsrc=__html_cbe5b59d_0.js></script></body></html>"`;
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
+
3
+
exports[`ConfigTestCases html minimize-script-data-blocks minimize-script-data-blocks should compile 1`] =`"<!doctype html><htmllang=en><head><title>Datablocks</title><scripttype=application/ld+json>{\\"a\\":1}</script></head><body><scripttype=text/x-template><pclass=\\"a\\">{{ t }}</p></script><scripttype=text/html><div>x</div></script><scripttype=unknown/thing>rawpayload</script><scriptsrc=__html_cbe5b59d_0.js></script></body></html>"`;
0 commit comments