diff options
author | James Campos <james.r.campos@gmail.com> | 2020-09-23 22:41:49 -0700 |
---|---|---|
committer | James Campos <james.r.campos@gmail.com> | 2020-09-23 22:41:49 -0700 |
commit | e5b2e71b01aa48cb68f85826d2fa8cdad3e8f014 (patch) | |
tree | 60a4d910aa11470dbfa6e960549dff628e677d36 /src/epub.rs | |
parent | f00e1cc8f8568df9ae8e802f9250a36baa911570 (diff) | |
download | bk-e5b2e71b01aa48cb68f85826d2fa8cdad3e8f014.tar.gz |
fragment
Diffstat (limited to 'src/epub.rs')
-rw-r--r-- | src/epub.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/epub.rs b/src/epub.rs index 7f203d0..4beff00 100644 --- a/src/epub.rs +++ b/src/epub.rs @@ -76,6 +76,11 @@ impl Epub { let url = format!("{}#{}", relative, id); self.links.insert(url, (self.chapters.len(), pos)); } + for link in c.links.iter_mut() { + if link.2.starts_with('#') { + link.2.insert_str(0, relative); + } + } self.chapters.push(c); } } |