diff options
author | James Campos <james.r.campos@gmail.com> | 2020-06-17 14:45:46 -0700 |
---|---|---|
committer | James Campos <james.r.campos@gmail.com> | 2020-06-17 14:45:46 -0700 |
commit | 07aff0373a25ee7ad7b4da10b30207dde3fb29ec (patch) | |
tree | e6c9ace47f4b2029bcd8f51cc7e74c6104f6e3b0 /src | |
parent | 82b332a546b0946cde8975b4ed5b5c3b702316c1 (diff) | |
download | bk-07aff0373a25ee7ad7b4da10b30207dde3fb29ec.tar.gz |
0.2
Diffstat (limited to 'src')
-rw-r--r-- | src/epub.rs | 4 | ||||
-rw-r--r-- | src/main.rs | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/epub.rs b/src/epub.rs index f850add..d74bd2a 100644 --- a/src/epub.rs +++ b/src/epub.rs @@ -47,11 +47,11 @@ impl Epub { match n.tag_name().name() { "h1" | "h2" | "h3" | "h4" | "h5" | "h6" => { - buf.push_str("\n\x1b\x5b1m"); + buf.push_str("\n\x1b[1m"); for c in n.children() { Self::render(buf, c); } - buf.push_str("\x1b\x5b0m\n"); + buf.push_str("\x1b[0m\n"); } "blockquote" | "p" | "tr" => { buf.push('\n'); diff --git a/src/main.rs b/src/main.rs index 8914f4f..dffbfff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -530,8 +530,7 @@ struct Props { fn restore(save_path: &str) -> Option<(String, Props)> { let args: Args = argh::from_env(); let width = args.width; - let path = args.path - .and_then(|s| Some(fs::canonicalize(s).unwrap().to_str().unwrap().to_string())); + let path = args.path.map(|s| fs::canonicalize(s).unwrap().to_str().unwrap().to_string()); let save = fs::read_to_string(save_path).and_then(|s| { let mut lines = s.lines(); Ok(( |