Skip to content

Commit

Permalink
pre tags
Browse files Browse the repository at this point in the history
Co-authored-by: jonseitz <[email protected]>
  • Loading branch information
aeosynth and jonseitz committed Oct 28, 2021
1 parent 4d1af5f commit 61beded
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/epub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}
Expand Down

1 comment on commit 61beded

@jonseitz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, cool. This looks good and works well on my end!

Please sign in to comment.