Novel-Grabber icon indicating copy to clipboard operation
Novel-Grabber copied to clipboard

[FEATURE REQUEST] Remove styling to include removing <br /> tags.

Open frykauf opened this issue 3 years ago • 11 comments

frykauf avatar Jun 10 '21 07:06 frykauf

I take it that you mean empty lines with "removing br tags" since you could end up with the whole chapter text being on a single line as some website do not have paragraph, br and/or new line('\n') tags.

On a different node I would like some feedback on the remove styling feature in general. What kind of text would you want when selecting it? Pure text (with line breaks \n in place of br and p) or are some rudimentary formatting tags allowed, like em, b, i, p?

Flameish avatar Jun 10 '21 10:06 Flameish

I took a look at the code and "Remove styling" is actually obsolete; it doesn't do anything. At some point I switched the default process to use a Safelist of allowed HTML tags/attributes and the styling attribute is not in it. I will probably remove the option all together.

Flameish avatar Jun 14 '21 14:06 Flameish

I think just the pure rudimentary inline formatting should be allowed but anything else not cleaned.

There are some cases where that would remove some intentional styling like inline style quotes but I wouldn’t expect almost any webnovel/online published novel to have that kind of attention to detail. Or needing it for that matter.

I could only see that actually important in officially published epubs by publishing companies, which you wouldn’t need novel-grabber for either.

Also maybe a page in the setting where the user could edit how he would like simple formatting/styling to look like -> you know how headings should look like, normal text, if you should have blank page before the next heading if the heading doesn’t start on left side (in 2 page mode), etc.

frykauf avatar Jun 15 '21 16:06 frykauf

I've added some basic chapter title editing (see #203) and removed the "remove styling" option like previously mentioned. Now concerning the text customization, I feel like this is better left to your eReader/-software, they often overwrite it anyway already. Same goes for the blank chapter page for some parts as I'm not that familiar with the practice itself and I'm not sure if the libraries I use for EPUB/PDF support something like that.

Flameish avatar Jun 16 '21 14:06 Flameish

I looked into it a bit and the blank page before next chapter is a simple "page-break-before: always“ css tag added to the the new chapter heading. Just tested it in iBooks and workes great. Viz https://ebookconversion.paulbrookes.net/css-heading-styles/ „A page Divider“

It seems most EPUB readers/editors ignore addding it automatically, seeing that even Calibre outputted stuff didn’t have it.

frykauf avatar Jun 21 '21 03:06 frykauf

And I did try adding page-break-before: always; on the simple span html chapter tags (the „Add Chapter Title“ option in Novel-Grabber) and it works perfectly as well.

frykauf avatar Jul 01 '21 14:07 frykauf

That's good to hear! I will probably add an option for that if it works this easily. Unfortunately I don't have much time to work on NG right now, so no promises when this will be done.

Flameish avatar Jul 02 '21 09:07 Flameish

Yeah, I’m just glad you’re interested in feedback. Actually it seems that "page-break-after:always“ has better support, so maybe adding a „span" at the end of each chapter would be better.

For some reason, it looks like page-break-after:always has got slightly better support than page-break-before:always in some Reading Systems.

As stated in iBooks Asset Guide, “if you include page breaks to mark a chapter break, use page-break-after to create a break at the end of a chapter, not page-break-before to insert the break at the beginning of the chapter. This modification improves performance with the table of contents.”

In any case, don’t use both since it will create a blank page in some Reading Systems.

From: https://friendsofepub.github.io/eBookTricks/#layout

Also interesting tips: https://friendsofepub.github.io/eBookDesignChecklist/

frykauf avatar Aug 18 '21 11:08 frykauf

Thanks for the tip!

Flameish avatar Aug 18 '21 12:08 Flameish

No problem man :)

frykauf avatar Aug 18 '21 14:08 frykauf

Oh, btw. Asianovel’s (new site) generated epubs seem really consistent, simple but extremely good looking formatting (normal/bold/italic dialogue look equally good) and one of the best behaving (in iBooks) epubs I’ve seen yet. Might be worth checking out their HTML/CSS structure.

I can send screenshots how it renders in iBooks if you want.

(Now if they could have better tracking of chapter updates on NovelUpdates :) )

frykauf avatar Aug 29 '21 01:08 frykauf