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>");
write_indent(&mut w);
write_element(&mut w, &document.root)?;
if w.pretty {
w.buf.push('\n');
}
Ok(w.buf)
}