aboutsummaryrefslogtreecommitdiffstats
path: root/src/renderer/html.rs
diff options
context:
space:
mode:
authorPhilipp A2019-11-12 22:57:02 +0100
committerPhilipp A2019-11-12 22:57:02 +0100
commit271cb95ec3e12d6f97852491bc723c5060ce4b75 (patch)
tree78cb094fb882fd6c56733ff9e4d1a9377713d393 /src/renderer/html.rs
parent18fba4a71eeebf3a2df91a6bcfda7f13e6c3f561 (diff)
downloadrust-rst-271cb95ec3e12d6f97852491bc723c5060ce4b75.tar.bz2
Run python tests
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 {