diff options
| -rw-r--r-- | crates/typst-html/src/encode.rs | 3 | ||||
| -rw-r--r-- | tests/ref/html/heading-html-basic.html | 2 | ||||
| -rw-r--r-- | tests/ref/html/link-basic.html | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/crates/typst-html/src/encode.rs b/crates/typst-html/src/encode.rs index b87b0e1d..62146f86 100644 --- a/crates/typst-html/src/encode.rs +++ b/crates/typst-html/src/encode.rs @@ -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) } diff --git a/tests/ref/html/heading-html-basic.html b/tests/ref/html/heading-html-basic.html index 69a1d017..56b1e32b 100644 --- a/tests/ref/html/heading-html-basic.html +++ b/tests/ref/html/heading-html-basic.html @@ -27,4 +27,4 @@ Level 7 </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/tests/ref/html/link-basic.html b/tests/ref/html/link-basic.html index 1f4e02e1..5d998667 100644 --- a/tests/ref/html/link-basic.html +++ b/tests/ref/html/link-basic.html @@ -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. </p> </body> -</html>
\ No newline at end of file +</html> |
