aboutsummaryrefslogtreecommitdiffstats
path: root/src/renderer/html.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer/html.rs')
-rw-r--r--src/renderer/html.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/renderer/html.rs b/src/renderer/html.rs
index 56e3175..869444f 100644
--- a/src/renderer/html.rs
+++ b/src/renderer/html.rs
@@ -15,8 +15,16 @@ use crate::document_tree::{
// static FOOTNOTE_SYMBOLS: [char; 10] = ['*', '†', '‡', '§', '¶', '#', '♠', '♥', '♦', '♣'];
-pub fn render_html<W>(document: &Document, mut stream: W) -> Result<(), Error> where W: Write {
- document.render_html(stream.by_ref())
+pub fn render_html<W>(document: &Document, mut stream: W, standalone: bool) -> Result<(), Error> where W: Write {
+ if standalone {
+ document.render_html(stream.by_ref())
+ } else {
+ let stream = stream.by_ref();
+ for c in document.children() {
+ (*c).render_html(stream)?;
+ }
+ Ok(())
+ }
}
trait HTMLRender {