aboutsummaryrefslogtreecommitdiff
path: root/src/epub.rs
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2026-03-07 10:51:33 +0300
committerA Farzat <a@farzat.xyz>2026-03-07 11:17:18 +0300
commit2dff30140ff8b46b8b82b761b4305ceb7b67108d (patch)
tree737d1dd997c97232c8252bee6acf3978ba5ff003 /src/epub.rs
parentb68015a8eb94d0590c1cfa12095bc89885209d01 (diff)
downloadoreilly-epub-2dff30140ff8b46b8b82b761b4305ceb7b67108d.tar.gz
oreilly-epub-2dff30140ff8b46b8b82b761b4305ceb7b67108d.zip
Replace format! macro with xml! where xml is used
This commit does not produce a working version, as processed_fragment is escaped by xml!. This needs to be resolved.
Diffstat (limited to 'src/epub.rs')
-rw-r--r--src/epub.rs15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/epub.rs b/src/epub.rs
index 1d4676d..f9a5aac 100644
--- a/src/epub.rs
+++ b/src/epub.rs
@@ -111,26 +111,13 @@ pub fn create_epub_archive(
src_file.read_to_end(&mut buffer)?;
if let Some(chapter) = chapters.get(&entry.ourn) {
let chapter_dir = entry.full_path.parent().unwrap_or(RelativePath::new(""));
- let stylesheet_links = chapter
- .related_assets
- .stylesheets
- .iter()
- .filter_map(|u| url_to_file.get(u))
- .map(|e| {
- format!(
- "<link rel=\"stylesheet\" type=\"{}\" href=\"{}\" />\n",
- e.media_type,
- chapter_dir.relative(&e.full_path)
- )
- })
- .collect::<String>();
let html = String::from_utf8(buffer)?;
let html = build_epub_chapter(
epub_data,
chapter,
chapter_dir,
&html,
- &stylesheet_links,
+ &url_to_file,
&url_path_to_local,
)?;
zip.write_all(html.as_bytes())?;