Skip to content

Trim lines (elements) from chapter body before packing into EPUB file - #2857

Open
g-play01 wants to merge 3 commits into
dteviot:ExperimentalTabModefrom
g-play01:feat/trimContent
Open

Trim lines (elements) from chapter body before packing into EPUB file#2857
g-play01 wants to merge 3 commits into
dteviot:ExperimentalTabModefrom
g-play01:feat/trimContent

Conversation

@g-play01

Copy link
Copy Markdown

Ran into cases where sites add content like number of words per chapter, the chapter title again, a please report if any issues at the start / end of a chapter and that ends up getting packed into the epub and can get annoying especially when you use a TTS reader created this advanced option that defaults to 0 i.e so off by default that removes a specified number of elements from the processed chapter bodies in convertRawDomToContent. Tested a local build on firefox on 2 sites works as expected.

Let me know if ya'll want anything else changed on this.

@ARYAN-9099

ARYAN-9099 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

You can also fix the parsers of the problematic sites.

@g-play01

g-play01 commented Jul 31, 2026

Copy link
Copy Markdown
Author

The sites have varying behaviour based on the story series, some stories only have 1 line to remove while otheres have 2 and others have none, I felt this was a more universal solution.

@ARYAN-9099

ARYAN-9099 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

@g-play01 how about a additional feature that will remove lines containing specific phrases?

@gamebeaker

Copy link
Copy Markdown
Collaborator

I think stuff like this should be included in the specific parser or made with another program.

The sites have varying behaviour based on the story series, some stories only have 1 line to remove while otheres have 2 and others have none, I felt this was a more universal solution.

Any examples?

As this implies manual involvement per downloaded epub i think it is reasonable that the person post processes the ebook. With for example calibre or https://github.com/dteviot/EpubEditor

It could be for example a EpubEditor script where the first variable is the count of elements removed.

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

Successfully merging this pull request may close these issues.

3 participants