MCPcopy Create free account
hub / github.com/Stranger6667/css-inline / minify_css

Function minify_css

css-inline/tests/test_inlining.rs:1115–1134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1113
1114#[test]
1115fn minify_css() {
1116 let inliner = CSSInliner::options().minify_css(true).build();
1117 let html = r#"
1118<html>
1119<head>
1120<style>
1121h1 {
1122 color: blue;
1123 font-weight: bold;
1124}
1125</style>
1126</head>
1127<body>
1128<h1>Hello</h1>
1129</body>
1130</html>"#;
1131 let inlined = inliner.inline(html).unwrap();
1132 let expected = "<html><head>\n\n</head>\n<body>\n<h1 style=\"color:blue;font-weight:bold\">Hello</h1>\n\n</body></html>";
1133 assert_eq!(inlined, expected);
1134}
1135
1136#[test]
1137fn nth_child_selector() {

Callers

nothing calls this directly

Calls 3

minify_cssMethod · 0.80
buildMethod · 0.45
inlineMethod · 0.45

Tested by

no test coverage detected