Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export epub to txt, if epub has images in their own chapter, results in botched txt #285

Open
erictbar opened this issue Dec 13, 2024 · 0 comments

Comments

@erictbar
Copy link

If i run epub2tts --export txt book.epub for a book that has multiple images within a long chapter, where the epub is formatted to seperate the images into their own .xhtml file, the book.txt will cut out all of the chapter after the first image.

epub contains chapter1.xhtml and chapter1-01.xhtml to chapter1-06.xhtml

Every other part of the chapter has something like this:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="en" xml:lang="en">
<head>
<title>1. The Pencil Incident</title>
<meta content="text/html; charset=utf-8" http-equiv="default-style"/>
<link href="../styles/stylesheet.css" rel="stylesheet" type="text/css"/>
<meta content="urn:uuid:da81a0ef-b558-4391-9819-22b23e176730" name="Adept.expected.resource"/>
</head>
<body epub:type="bodymatter">
<span aria-label="16" epub:type="pagebreak" id="pg_16" role="doc-pagebreak"/>
<figure class="IMG1"><img alt="" class="img100" src="../images/pg16.jpg"/>
</figure>
</body>
</html> 

The output .txt stops with #Part 3 at the end of chapter1.xhtml and then goes to the beginning of Chapter 2 with Part 4.

Worked around by editing the epub in Calibre to remove images and place all text in chapter1.xhtml.

I have had books with these kind of chapters before (they are common in Yen Press published light novels), but this is the first one that has 3 in one long chapter. I also have recently updated epub2tts, as well as Ubuntu from 22.04 to 24.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant