Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 07-11-2016, 12:25 PM   #1
Milica Who
Junior Member
Milica Who began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2016
Device: ASUS fonepad
XML characters in metadata

Hi, this is the first time I'm posting here...sorry if I'm in the wrong place, but I'm not very familiar with how mobile read works (i.e. threads and such).

Anyway I have a problem when editing metadata with Calibre. Actually with showing said metadata in my ebook reader (I use Bookari, a.k.a. Mantano). You see, when I download metadata from, let's say, Amazon, and modify epub, comment (book info) should show in ebook reader, but it doesn't. Eventually, I discovered that the problem is in these xml tags: < and > in content.opf. Mantano won't read description in content.opf that starts with these tags. I have no idea how can I configure calibre not to put these.

Books the comments of which Mantano reads have only <dc:description> and </dc:description> at the beginning and the end , respectively, in content.opf. HTML source (in edit metadata window) of books that have their own description (which Mantano reads) and the books the metadata of which Calibre downloaded shows that tags used are the same (<p class="description"> , <div>, etc.) in both cases. When I erase those xml tags from description section in content.opf and leave only bare text and save changes, Calibre just puts them back. When I erase them in Sigil, they stay erased. So, the only thing that's left is that Calibre is forcing these tags in content.opf.

Is there anyway around this? Without manually editing content.opf of every book. Something in Calibre configuration?

Thanks in advance! And thanks for all the work!
Milica Who is offline   Reply With Quote
Old 07-11-2016, 12:33 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
calibre auto-HTMLizes all comments, but you can "cheat" and clean out the tags using bulk search & replace.

See this thread for more details: https://www.mobileread.com/forums/sho...d.php?t=268119

Edit: And this thread has a plugin which should also do the job I think: https://www.mobileread.com/forums/sho...d.php?t=271734
eschwartz is offline   Reply With Quote
Advert
Old 07-11-2016, 01:11 PM   #3
Milica Who
Junior Member
Milica Who began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2016
Device: ASUS fonepad
Thank you so, so much for this!!! I've been searching for a solution on the net for the past three days, but nowhere in the results were those threads...Plug-in you pointed me to worked perfectly!

Milica Who is offline   Reply With Quote
Old 07-11-2016, 01:13 PM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
To be fair, I found it myself because I remembered the author of the plugin and did an attachment search.
eschwartz is offline   Reply With Quote
Old 07-11-2016, 01:39 PM   #5
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,234
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Well, I've removed, at least, the faulty releases
Terisa de morgan is offline   Reply With Quote
Advert
Old 07-11-2016, 02:45 PM   #6
Milica Who
Junior Member
Milica Who began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2016
Device: ASUS fonepad
Quote:
Originally Posted by Terisa de morgan View Post
Well, I've removed, at least, the faulty releases
Thank you for this plug-in! I was really considering editing books one by one with Sigil, so to say you saved me a loooot of time would be an understatement really!
Milica Who is offline   Reply With Quote
Old 07-11-2016, 03:45 PM   #7
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,234
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by Milica Who View Post
Thank you for this plug-in! I was really considering editing books one by one with Sigil, so to say you saved me a loooot of time would be an understatement really!
You're welcome. I didn't think it could be useful really, that's the reason it's only at that thread.
Terisa de morgan is offline   Reply With Quote
Old 07-11-2016, 04:56 PM   #8
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
They say prevention is better than cure, see ==>> Preferences->Download Metadata->Convert all downloaded comments to plain text.

Quote:
Originally Posted by Terisa de morgan View Post
You're welcome. I didn't think it could be useful really, that's the reason it's only at that thread.
@Terisa de morgan - any reason why your plugin can't be made official? The above won't fix what's been already downloaded, and some folks might prefer to normalise selectively.

BR

Last edited by BetterRed; 07-11-2016 at 05:21 PM.
BetterRed is offline   Reply With Quote
Old 07-11-2016, 05:00 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Do plaintext downloaded comments lose the
Code:
<p class="description">
???
eschwartz is offline   Reply With Quote
Old 07-11-2016, 05:08 PM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@eschwartz - seems so - on the test I did before prior post I didn't see any mark up between <dc:description> and <\dc:description> in content.opf, and I chose a book riddled with bold and italics in its comments.

I only noticed the setting the other day when responding to the issue regarding downloading Authors from B&N.

BR
BetterRed is offline   Reply With Quote
Old 07-11-2016, 05:15 PM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Nice find, then!
eschwartz is offline   Reply With Quote
Old 07-11-2016, 06:04 PM   #12
Milica Who
Junior Member
Milica Who began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2016
Device: ASUS fonepad
Quote:
Originally Posted by BetterRed View Post
They say prevention is better than cure, see ==>> Preferences->Download Metadata->Convert all downloaded comments to plain text.


@Terisa de morgan - any reason why your plugin can't be made official? The above won't fix what's been already downloaded, and some folks might prefer to normalise selectively.

BR
I checked that box before I even attempted to download metadata, and the problem I had with xml tags was still present. Believe me I tried everything before I posted the question, and so far only the plug-in worked...Just now I tried it on a book that already came with its own metadata, but also with those problematic xml tags in content.opf. And the plug-in worked on that book, too.
Milica Who is offline   Reply With Quote
Old 07-11-2016, 06:19 PM   #13
Milica Who
Junior Member
Milica Who began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2016
Device: ASUS fonepad
Quote:
Originally Posted by eschwartz View Post
Do plaintext downloaded comments lose the
Code:
<p class="description">
???
In HTML source of metadata they don't...aside from <p class="description">, they still have for example <div> for paragraphs and <br> for line breaks. The problem was that Calibre translated < and > into &lt; and &gt; respectively in the content.opf which should have no tags at all. With plug-in that doesn't happen - there's no <p class="description">, <div> and <br> tags in the description section of content.opf, you just have bare text but separated in paragraphs following the <div> tag pattern of the HTML source. The same goes for line breaks.
Milica Who is offline   Reply With Quote
Old 07-11-2016, 06:57 PM   #14
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Milica Who View Post
I checked that box before I even attempted to download metadata, and the problem I had with xml tags was still present. Believe me I tried everything before I posted the question, and so far only the plug-in worked...Just now I tried it on a book that already came with its own metadata, but also with those problematic xml tags in content.opf. And the plug-in worked on that book, too.
Quote:
Originally Posted by Milica Who View Post
In HTML source of metadata they don't...aside from <p class="description">, they still have for example <div> for paragraphs and <br> for line breaks. The problem was that Calibre translated < and > into &lt; and &gt; respectively in the content.opf which should have no tags at all. With plug-in that doesn't happen - there's no <p class="description">, <div> and <br> tags in the description section of content.opf, you just have bare text but separated in paragraphs following the <div> tag pattern of the HTML source. The same goes for line breaks.
@Milica - if calibre isn't removing all the markup in your downloaded Comments when the setting is checked then IMO that's a defect that should be rectified. Perhaps you could report the issue at Bugs : calibre with details of a book and metadata source that has the problem.

I did a spot check on one book and the result was fine - the dc:description was free of any HTML markup. I don't use the metadata download feature much, what's more I normally have Comments unchecked.

BTW - I am not suggesting that the setting obviates the need for Terisa's plugin, in fact I've suggested it be made a registered plugin.

BR

Last edited by BetterRed; 07-11-2016 at 07:26 PM.
BetterRed is offline   Reply With Quote
Old 07-11-2016, 08:28 PM   #15
Milica Who
Junior Member
Milica Who began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2016
Device: ASUS fonepad
Quote:
Originally Posted by BetterRed View Post
@Milica - if calibre isn't removing all the markup in your downloaded Comments when the setting is checked then IMO that's a defect that should be rectified. Perhaps you could report the issue at Bugs : calibre with details of a book and metadata source that has the problem.

I did a spot check on one book and the result was fine - the dc:description was free of any HTML markup. I don't use the metadata download feature much, what's more I normally have Comments unchecked.

BTW - I am not suggesting that the setting obviates the need for Terisa's plugin, in fact I've suggested it be made a registered plugin.

BR
I don't know if those tags, or HTML markup as you called it (I'm not very familiar with these stuff ), are problematic for Mantano e-reader only or for other ebook readers (that have the ability to read description) too. If this problem appears in other ebook readers, too, then I also think it would be good to report a bug. If this issue is only Mantano related, I don't know if that's enough to report a bug...?

I agree, it would still be good to make this official plug-in, regardless of this being a bug or not .
Milica Who is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed - odd characters printing w/custom metadata jacket tags jecilop Library Management 5 07-11-2017 06:18 PM
After merging all the .xml files, how do you divide it back into .xml files? automa Sigil 10 08-13-2013 07:43 AM
¿Convert unicode decomposed characters to unique/normal characters? JohnQwerty Calibre 3 04-05-2012 12:08 PM
[PRS-650] media.xml - Title from Metadata Plugboard is not used Maniac Devices 9 10-08-2011 11:01 AM
Why xml?? real_yoni Sony Reader Dev Corner 1 01-20-2009 11:45 AM


All times are GMT -4. The time now is 03:40 AM.


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