diff options
author | James Campos <james.r.campos@gmail.com> | 2020-09-23 18:40:15 -0700 |
---|---|---|
committer | James Campos <james.r.campos@gmail.com> | 2020-09-23 18:40:15 -0700 |
commit | 2a48081b1a683b6ac22fe5bd706b619be8520872 (patch) | |
tree | e35c951a118ab7aebb1455d1e89c2d840d697a4e /src/view.rs | |
parent | 139c3d96fc7ee8cd29f2c704913e8f57ea84f867 (diff) | |
download | bk-2a48081b1a683b6ac22fe5bd706b619be8520872.tar.gz |
render external links as plain text
Diffstat (limited to 'src/view.rs')
-rw-r--r-- | src/view.rs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/view.rs b/src/view.rs index 11eaccd..7593eea 100644 --- a/src/view.rs +++ b/src/view.rs @@ -244,16 +244,7 @@ impl View for Page { if let Ok(i) = r { let url = &c.links[i].2; - let mut link = bk.links.get(url); - // FIXME hack - if link.is_none() { - let url = url.split('#').next().unwrap(); - link = bk.links.get(url); - if link.is_none() { - return; - } - } - let &(chapter, byte) = link.unwrap(); + let &(chapter, byte) = bk.links.get(url).expect(url); let line = get_line(&bk.chapters[chapter].lines, byte); bk.jump((chapter, line)); } |