diff options
author | James Campos <james.r.campos@gmail.com> | 2020-07-13 21:37:05 -0700 |
---|---|---|
committer | James Campos <james.r.campos@gmail.com> | 2020-07-13 21:37:05 -0700 |
commit | ce2e48d7a39fecf0e5c3ea0e16a4fa2de535518b (patch) | |
tree | 5f7f1b9f7d662b1bc9191056b4d5ace671732c56 /src/epub.rs | |
parent | 2637f03c3b59909da9eb1e5b9b73ff4f2b06cddd (diff) | |
download | bk-ce2e48d7a39fecf0e5c3ea0e16a4fa2de535518b.tar.gz |
inline styles
Diffstat (limited to 'src/epub.rs')
-rw-r--r-- | src/epub.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/epub.rs b/src/epub.rs index b5510c8..fb0445a 100644 --- a/src/epub.rs +++ b/src/epub.rs @@ -141,9 +141,23 @@ fn render(n: Node, buf: &mut String, attrs: &mut Attrs) { for c in n.children() { render(c, buf, attrs); } - attrs.push((buf.len(), Attribute::Reset)); + attrs.push((buf.len(), Attribute::NoBold)); buf.push('\n'); } + "em" => { + attrs.push((buf.len(), Attribute::Italic)); + for c in n.children() { + render(c, buf, attrs); + } + attrs.push((buf.len(), Attribute::NoItalic)); + } + "strong" => { + attrs.push((buf.len(), Attribute::Bold)); + for c in n.children() { + render(c, buf, attrs); + } + attrs.push((buf.len(), Attribute::NoBold)); + } "blockquote" | "p" | "tr" => { buf.push('\n'); for c in n.children() { |