From 89bdcfe89314eeeca82bcfce298a204506f9f18b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 19 Mar 2017 18:01:17 +0530 Subject: [PATCH] Amazon metadata download: Fix title and author names being bolded in the downloaded comments when using bing to get amazon metadata. Fixes #1674088 [When downloading book metadata, words from title and author name are bolded in "Comments"](https://bugs.launchpad.net/calibre/+bug/1674088) --- src/calibre/ebooks/metadata/sources/amazon.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/metadata/sources/amazon.py b/src/calibre/ebooks/metadata/sources/amazon.py index f3e9e2cb4e..325757c475 100644 --- a/src/calibre/ebooks/metadata/sources/amazon.py +++ b/src/calibre/ebooks/metadata/sources/amazon.py @@ -533,6 +533,12 @@ class Worker(Thread): # Get details {{{ ' @class="emptyClear" or @id="collapsePS" or' ' @id="expandPS"]'): c.getparent().remove(c) + for b in desc.xpath('descendant::b[@style]'): + # Bing highlights search results + s = b.get('style', '') + if 'color' in s: + b.tag = 'span' + del b.attrib['style'] for a in desc.xpath('descendant::a[@href]'): del a.attrib['href'] @@ -821,7 +827,7 @@ class Worker(Thread): # Get details {{{ class Amazon(Source): name = 'Amazon.com' - version = (1, 1, 0) + version = (1, 2, 0) minimum_calibre_version = (2, 82, 0) description = _('Downloads metadata and covers from Amazon')