Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 05-08-2019, 06:22 AM   #1
agirlnamedfia
Junior Member
agirlnamedfia began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2019
Location: Europe
Device: Kobo Aura
Question Problem with book summaries

Hey guys,

Joined the forum because I have a very specific question I cannot find the answer to: some of the summaries on my Kobo Aura show line breaks and others look perfectly fine. Sometimes there's also an abrupt font change.

I use the Calibre 'Comments' field to add the summaries. In Calibre everything looks fine. When I check the metadata html, the summary is coded in seperate lines, rather than one line, which is what's causing the linebreaks:



When there's a font change, it's also reflected in the html.

I've had this happen with summaries I got via 'download metadata', that I c&p into the box or that were already embedded in the file. The only thing that fixes it is editing the html or manually replacing the space where the line break is in the 'Comments' field.

My question is, does anybody have any idea why this happens and how I can fix it in bulk or prevent it from happening in the future? I have 2000+ books in my library, checking and manually changing all of them would be a huge effort.

Thanks!
agirlnamedfia is offline   Reply With Quote
Old 05-08-2019, 05:52 PM   #2
thiago.eec
Zealot
thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.
 
Posts: 110
Karma: 71600
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Edit metadata in bulk

@agirlnamedfia

Have you tried using Edit metadata in bulk > Search and replace?
You could use regular expressions* like this:

Code:
Search field: comments
Serch for: <p>(.*?)</p>
Replace with: \1
The one above would remove "lines" created with p tags. You could use other expressions to remove inline styles too:

Code:
Search for: style="(.*?)"
Replace with: - leave it blank
or

Code:
Search for: <span(.*?)>(.*?)</span>
Replace with: \2
These two would remove all changes in fonts, colors, sizes, etc.


Is this what you are looking for?



*Change the search mode to regular expressions.

Last edited by thiago.eec; 05-08-2019 at 05:59 PM. Reason: added info about search mode
thiago.eec is offline   Reply With Quote
Old 05-08-2019, 07:50 PM   #3
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 3,976
Karma: 9300000
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, iPad 9.7, iPad 12.9
Iirc, there's a Calibre plugin available to strip all formatting from comments. I think it was called Clean Comments or something?
ilovejedd is offline   Reply With Quote
Old 05-08-2019, 10:59 PM   #4
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 5,880
Karma: 26679693
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Aura One, Aura H2O, Aura HD, Nexus 7 HD, iPad Air, Tolino epos
I think the plugin ilovejedd is referring to is Terisa de morgan's Cleaning Comment plugin.
DNSB is offline   Reply With Quote
Old 05-09-2019, 03:13 AM   #5
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 16,825
Karma: 26315630
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
Quote:
Originally Posted by agirlnamedfia View Post
Joined the forum because I have a very specific question I cannot find the answer to: some of the summaries on my Kobo Aura show line breaks and others look perfectly fine. Sometimes there's also an abrupt font change.

I use the Calibre 'Comments' field to add the summaries. In Calibre everything looks fine. When I check the metadata html, the summary is coded in seperate lines, rather than one line, which is what's causing the linebreaks:



When there's a font change, it's also reflected in the html.

I've had this happen with summaries I got via 'download metadata', that I c&p into the box or that were already embedded in the file. The only thing that fixes it is editing the html or manually replacing the space where the line break is in the 'Comments' field.

My question is, does anybody have any idea why this happens and how I can fix it in bulk or prevent it from happening in the future? I have 2000+ books in my library, checking and manually changing all of them would be a huge effort.
I believe this is an issue with the latest Kobo firmware version, version 4.14.12777. It seems to be rendering any line breaks in the comments. Before, they were either ignored or rendered as a space. I hadn't notice it until someone else reported it. I tend to clean the comments of line breaks, so I don't usually see this. And I haven't done enough testing to be completely sure of what is happening.

I haven't seen any issues with fonts changes. Any strangeness there on the device, I can see in calibre and fix there before resending the books.

Also, your image isn't showing. You could post the code within code-tags so that we can see what you have. That might help to prove what the issue is if I am wrong.
davidfor is offline   Reply With Quote
Old 05-10-2019, 06:32 AM   #6
agirlnamedfia
Junior Member
agirlnamedfia began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2019
Location: Europe
Device: Kobo Aura
Thanks for the suggestions! Here's what I tried.

Quote:
Originally Posted by thiago.eec View Post
@agirlnamedfia Have you tried using Edit metadata in bulk > Search and replace?
The <p> one won't be useful because there aren't any <p> tags where the line breaks occur. I'll try the style tag search for fonts/font sizes, though, thanks for that!

Quote:
Originally Posted by ilovejedd View Post
Iirc, there's a Calibre plugin available to strip all formatting from comments. I think it was called Clean Comments or something?
The only thing it did was change the line breaks to <br/> and thus making them visible in the "Edit metadata" window, unfortunately.

Quote:
Originally Posted by davidfor View Post
I believe this is an issue with the latest Kobo firmware version, version 4.14.12777. It seems to be rendering any line breaks in the comments. Before, they were either ignored or rendered as a space. I hadn't notice it until someone else reported it. I tend to clean the comments of line breaks, so I don't usually see this. And I haven't done enough testing to be completely sure of what is happening.

I haven't seen any issues with fonts changes. Any strangeness there on the device, I can see in calibre and fix there before resending the books.

Also, your image isn't showing. You could post the code within code-tags so that we can see what you have. That might help to prove what the issue is if I am wrong.
If that's the case (which it might be), wouldn't it be a problem for every book, though? So far, for the 700 or so that I've checked, only about 1/4 had the issue.

Anyway, apologies for the image not showing. Should be fixed now? I can't show you the code in tags because it won't show what the problem is, but I took some more screenshots...

This is what the code in "Edit Book" looks like. As marked, the line breaks happen when every line gets a new line number, for lack of a better explanation:



This is what the "Edit Metadata" comments section looks like in normal view, where no line breaks are visible:



This is what the "Edit Metadata" comments section looks like in HTML view, where you can see the line breaks:



If I remove the line breaks in the HTML view, then the problem is solved, but like I said before, I'd rather not have to check all the books and manually change them if I can at all help it...
Attached Thumbnails
Click image for larger version

Name:	01 Code in Edit Book.jpg
Views:	22
Size:	94.0 KB
ID:	171397   Click image for larger version

Name:	02 Edit Metadata normal view.jpg
Views:	20
Size:	148.1 KB
ID:	171398   Click image for larger version

Name:	03 Edit Metadata HTML view.jpg
Views:	20
Size:	154.1 KB
ID:	171399  
agirlnamedfia is offline   Reply With Quote
Old 05-10-2019, 02:37 PM   #7
agirlnamedfia
Junior Member
agirlnamedfia began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2019
Location: Europe
Device: Kobo Aura
UPDATE: I came across another book where the font spontaneously changes mid-summary. I tried
  • Comment Cleaning
  • search and replace
  • Erase all formatting

None of these got rid of the font code.

Here's what it looks like in the HTML view of "Edit Metadata":


And here is what the code looks like in "Edit Book":


Also I haven't a clue what's up with the image hosting (I uploaded them to a public MobileRead album and copied the BBCode, I feel like that should work?) but I hosted these externally so HOPEFULLY you'll be able to see them. If not, see attachments.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2019-05-10 at 20.17.39.jpg
Views:	16
Size:	60.7 KB
ID:	171409   Click image for larger version

Name:	Screen Shot 2019-05-10 at 20.19.09.jpg
Views:	15
Size:	45.4 KB
ID:	171410  
agirlnamedfia is offline   Reply With Quote
Old 05-10-2019, 03:24 PM   #8
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 3,976
Karma: 9300000
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, iPad 9.7, iPad 12.9
Another thing you can try installing is the Job Spy plugin. It has an option to convert comments into plain text.


P.S. Please note you'll need to run Polish books, Embed metadata, Convert or use the Send to device function to actually update the embedded comments metadata in the ePub file sent to the Kobo.


P.P.S. I think the latest version of Calibre gets rid of the line breaks when downloading comments metadata. For existing comments though, you could do a search and replace to convert them to space.

Code:
Search field: comments
Search for: \n
Replace with:  (space)

P.P.P.S. And for removing <font> tags.

Code:
Search field: comments
Search for: <font[^>]*>(.*)</font>
Replace with: \1

Last edited by ilovejedd; 05-10-2019 at 03:45 PM.
ilovejedd is offline   Reply With Quote
Old 05-10-2019, 03:36 PM   #9
thiago.eec
Zealot
thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.thiago.eec knows who John Galt is.
 
Posts: 110
Karma: 71600
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by agirlnamedfia View Post
This is what the code in "Edit Book" looks like. As marked, the line breaks happen when every line gets a new line number, for lack of a better explanation:


The problem is that your comments have line breaks inserted with the ENTER key. This creates a non-visual mark (LF) on the end of each of those points. You can also use regex to get rid of then:

Code:
Search field: comments
Search for: "([^>])\n"
Replace with: "\1 "
*remove the quotation marks and make sure you put the space after the "1"

Quote:
Originally Posted by agirlnamedfia View Post
None of these got rid of the font code.
Well, regex gain:

Code:
Search field: comments
Search for: <font(.*?)>(.*?)</font>
Replace with: \2

Last edited by thiago.eec; 05-10-2019 at 04:15 PM. Reason: correction for the font code
thiago.eec is offline   Reply With Quote
Old 05-11-2019, 02:52 AM   #10
agirlnamedfia
Junior Member
agirlnamedfia began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2019
Location: Europe
Device: Kobo Aura
YES.

Hallelujah, I managed to get rid of all of them with the bulk search/replace. Still no clue why this happens sometimes and not others, but I suppose I'll have to check new books in the future.

Thanks so much for the help, guys!
agirlnamedfia is offline   Reply With Quote
Old 05-11-2019, 03:08 AM   #11
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 16,825
Karma: 26315630
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
Quote:
Originally Posted by agirlnamedfia View Post
If that's the case (which it might be), wouldn't it be a problem for every book, though? So far, for the 700 or so that I've checked, only about 1/4 had the issue.
Which to me suggests only 1/4 of your books have embedded line breaks anywhere.
Quote:
Anyway, apologies for the image not showing. Should be fixed now? I can't show you the code in tags because it won't show what the problem is, but I took some more screenshots...

This is what the code in "Edit Book" looks like. As marked, the line breaks happen when every line gets a new line number, for lack of a better explanation:


This is what the "Edit Metadata" comments section looks like in normal view, where no line breaks are visible:

This is what the "Edit Metadata" comments section looks like in HTML view, where you can see the line breaks:

If I remove the line breaks in the HTML view, then the problem is solved, but like I said before, I'd rather not have to check all the books and manually change them if I can at all help it...
And that is exactly what I was expecting. I expect there to be linebreaks after "First Lady of", "has emerged" and so on. And a double space between "United States" and "In a life of". In previous Kobo firmware versions, the first example would be on a single line (unless they wrapped there) and there would be a single line between the paragraphs.

To demonstrate this, the attached book has the following in the comments in calibre:

Code:
<div><p>This is a comment. There is a linebreak
after the word linebreak.</p><p>There are no linebreaks between this comment and the previous one. The p close and open tags are on the same line.</p>

<p>But there are two linebreaks before this one. i.e. there are two lines between the close and open tags.</p><p>And
in
this

paragraph,
there
is
a
linebreak
after
each

word

. With

two
linebreaks
after
the
four-letter
words.</p></div>
The screenshots are from device. They show the first two pages of the synopsis for this book when I sideloaded it. The screenshots show the linebreaks and multiple empty lines where here linebreaks are in the comments.

If this isn't what you are seeing on the device, we need to see screenshots or photos to show what you are seeing.

A quick fix for this seems to be using a metadata plugboard for the comments. Apparently the template "{comments}" will remove the linebreaks.
Attached Thumbnails
Click image for larger version

Name:	CommentWithLinebreak-synopsis-1.png
Views:	23
Size:	23.5 KB
ID:	171413   Click image for larger version

Name:	CommentWithLinebreak-synopsis-2.png
Views:	19
Size:	12.9 KB
ID:	171414  
Attached Files
File Type: epub Comment With Linebreak - davidfor.epub (1.8 KB, 23 views)
davidfor is offline   Reply With Quote
Old 05-11-2019, 08:12 AM   #12
agirlnamedfia
Junior Member
agirlnamedfia began at the beginning.
 
Posts: 5
Karma: 10
Join Date: May 2019
Location: Europe
Device: Kobo Aura
Quote:
Originally Posted by davidfor View Post
If this isn't what you are seeing on the device, we need to see screenshots or photos to show what you are seeing.
No, that was exactly what I was seeing.

I did a bulk metadata search and replace, which replaced the line breaks with spaces and now it is fixed!
agirlnamedfia is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Book summaries on the Kindle? Uthred Amazon Kindle 20 03-16-2013 06:34 AM
Compressed Book Summaries Tony30 Deals and Resources (No Self-Promotion or Affiliate Links) 1 02-25-2013 07:57 AM
Book summaries not fully downloading with v3.0 151 chilady1 Related Tools 7 04-11-2012 04:21 PM
Soundview Executive Book Summaries pking36330 Deals and Resources (No Self-Promotion or Affiliate Links) 4 11-11-2009 09:17 PM
Summaries of books available RandmTask Reading Recommendations 3 08-24-2009 09:19 AM


All times are GMT -4. The time now is 04:22 AM.


MobileRead.com is a privately owned, operated and funded community.