@@ -59,16 +59,16 @@ impl StyleCollector {
5959 let mut css = String::new();
6060 for e in &self.entries {
6161 if !e.base.is_empty() {
62− css.push_str(&format!(".{}{{{}}}\n", e.class_name, e.base));
62+ css.push_str(&format!(".{}{{{}}}", e.class_name, e.base));
6363 }
6464 if !e.hover.is_empty() {
65− css.push_str(&format!(".{}:hover{{{}}}\n", e.class_name, e.hover));
65+ css.push_str(&format!(".{}:hover{{{}}}", e.class_name, e.hover));
6666 }
6767 if !e.active.is_empty() {
68− css.push_str(&format!(".{}:active{{{}}}\n", e.class_name, e.active));
68+ css.push_str(&format!(".{}:active{{{}}}", e.class_name, e.active));
6969 }
7070 if !e.focus.is_empty() {
71− css.push_str(&format!(".{}:focus{{{}}}\n", e.class_name, e.focus));
71+ css.push_str(&format!(".{}:focus{{{}}}", e.class_name, e.focus));
7272 }
7373 }
7474 css
@@ -91,25 +91,7 @@ pub fn generate(doc: &Document) -> String {
9191
9292 match &doc.page_title {
9393 Some(title) => format!(
94− "\
95−<!DOCTYPE html>
96−<html>
97−<head>
98−<meta charset=\"utf-8\">
99−<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
100−<title>{title}</title>
101−<style>
102−*, *::before, *::after {{ box-sizing: border-box; }}
103−body {{ margin: 0; font-family: system-ui, -apple-system, sans-serif; }}
104−img {{ display: block; }}
105−{element_css}\
106−</style>
107−</head>
108−<body>
109−{body}\
110−</body>
111−</html>
112−",
94+ "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>{title}</title><style>*,*::before,*::after{{box-sizing:border-box}}body{{margin:0;font-family:system-ui,-apple-system,sans-serif}}img{{display:block}}{element_css}</style></head><body>{body}</body></html>",
11395 title = html_escape(title),
11496 element_css = element_css,
11597 body = body,
@@ -118,7 +100,7 @@ img {{ display: block; }}
118100 if element_css.is_empty() {
119101 body
120102 } else {
121− format!("<style>\n{}</style>\n{}", element_css, body)
103+ format!("<style>{}</style>{}", element_css, body)
122104 }
123105 }
124106 }
@@ -151,7 +133,6 @@ fn generate_node(
151133 }
152134 Node::Raw(content) => {
153135 out.push_str(content);
154− out.push('\n');
155136 }
156137 }
157138}
@@ -214,13 +195,13 @@ fn generate_element(
214195 for (i, child) in elem.children.iter().enumerate() {
215196 generate_node(child, Some(&elem.kind), out, styles);
216197 if is_paragraph && i < elem.children.len() - 1 {
217− out.push('\n');
198+ out.push(' ');
218199 }
219200 }
220201
221202 out.push_str("</");
222203 out.push_str(tag);
223− out.push_str(">\n");
204+ out.push('>');
224205}
225206
226207fn generate_image(
@@ -244,7 +225,7 @@ fn generate_image(
244225 out.push_str(&html_escape(&id));
245226 out.push('"');
246227 }
247− out.push_str(">\n");
228+ out.push('>');
248229}
249230
250231fn generate_text_segments(