View Single Post
Old 09-29-2020, 02:26 PM   #1493
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,489
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Rev. Bob View Post
1.4.1 saved the modified files with UNIX EOLs (CR only), while 1.5.9 saved them with DOS EOLs (CRLF). One of the short story sections displayed a phantom text-comparison difference that looked like an extra linefeed, but bringing both modified copies into Notepad++ and changing the 1.5.9 version to use UNIX EOLs made them byte-identical. The same behavior showed up in the longer book as well, and I don't see a pattern. Some chapters display several instances, while others show none at all.
FWIW: UNIX EOL is LF. IIRC Mac is CR, but that might be outdated info. DOS (Windows) is CRLF. This BS has been causing me headaches for nigh-on 45 years.

I am not surprised at the difference. The last change I made was to take out all guesswork about modifying the files. Reason: in calibre V4.3 the system method not only corrected line endings but sometimes changed to encoding to 8-bit ASCII, which broke everything. Taking it out made calibre V5 leave use the "system" line ending. I suspect if you ran the plugin on Linux or Mac you would get slightly different behaviour.

This can be fixed if we are willing to fork.
Quote:
I should note that in the case of at least one file for each book, this extends to a known-static file which my copy of calibre custom-generates: titlepage.xhtml. (I use different stock cover page code, but it's a calibre source file mod; it doesn't come from the books.)
The plugin pays special attention to that file.
Quote:
It turns out that loading the beta book into the calibre editor, making and undoing a minimal change to an affected file, resaving the book, and extracting that file results in its EOLs being changed to the CR format, which is why I conclude that this is a quite minor bug in 1.5.9.
HTML is supposed to ignore EOL differences. I think the rule is any of CR, CRLF, or LF are treated as a space. The line ending should make no difference at all in what the reader app displays.

That said, I am willing to back the changes out if you are willing to support a fork.
chaley is offline   Reply With Quote