From e5b2e71b01aa48cb68f85826d2fa8cdad3e8f014 Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 23 Sep 2020 22:41:49 -0700 Subject: fragment --- src/epub.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/epub.rs') 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); } } -- cgit v1.2.3