Terminate pretty-printed HTML with trailing newline (#5661)

This commit is contained in:
Laurenz 2025-01-06 14:55:34 +01:00 committed by GitHub
parent e8bbf3794f
commit cb8d862a55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 2 deletions

View File

@ -12,6 +12,9 @@ pub fn html(document: &HtmlDocument) -> SourceResult<String> {
w.buf.push_str("<!DOCTYPE html>"); w.buf.push_str("<!DOCTYPE html>");
write_indent(&mut w); write_indent(&mut w);
write_element(&mut w, &document.root)?; write_element(&mut w, &document.root)?;
if w.pretty {
w.buf.push('\n');
}
Ok(w.buf) Ok(w.buf)
} }

View File

@ -27,4 +27,4 @@
Level 7 Level 7
</div> </div>
</body> </body>
</html> </html>

View File

@ -18,4 +18,4 @@
Contact <a href="mailto:hi@typst.app">hi@typst.app</a> or call <a href="tel:123">123</a> for more information. Contact <a href="mailto:hi@typst.app">hi@typst.app</a> or call <a href="tel:123">123</a> for more information.
</p> </p>
</body> </body>
</html> </html>