aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/epub.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/epub.rs b/src/epub.rs
index a52c9d0..f70964c 100644
--- a/src/epub.rs
+++ b/src/epub.rs
@@ -225,6 +225,15 @@ fn render(n: Node, c: &mut Chapter) {
c.render_text(n);
c.text.push('\n');
}
+ "pre" => {
+ c.text.push_str("\n ");
+ n
+ .descendants()
+ .filter(Node::is_text)
+ .map(|n| n.text().unwrap().replace('\n', "\n "))
+ .for_each(|s| c.text.push_str(&s));
+ c.text.push('\n');
+ }
_ => c.render_text(n),
}
}