From 47141e527e45880d2b143c0ec0c7f73bec30efc9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 14 Sep 2010 13:38:03 -0600 Subject: [PATCH 1/2] Fix handling of non-ASCII chars when redering series in default EPUB cover --- src/calibre/ebooks/oeb/transforms/cover.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/transforms/cover.py b/src/calibre/ebooks/oeb/transforms/cover.py index 59b42df68a..532c9bbc03 100644 --- a/src/calibre/ebooks/oeb/transforms/cover.py +++ b/src/calibre/ebooks/oeb/transforms/cover.py @@ -99,7 +99,8 @@ class CoverManager(object): series_string = None if m.series and m.series_index: series_string = _('Book %s of %s')%( - fmt_sidx(m.series_index[0], use_roman=True), m.series[0]) + fmt_sidx(m.series_index[0], use_roman=True), + unicode(m.series[0])) try: from calibre.ebooks import calibre_cover From 3ef0192e8d058fb2b904a0cef12979cd9a4951e1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 14 Sep 2010 13:39:30 -0600 Subject: [PATCH 2/2] Fix #6756 (Slate recipe does not work) --- resources/recipes/slate.recipe | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/resources/recipes/slate.recipe b/resources/recipes/slate.recipe index c03255d2df..9da1c4da78 100644 --- a/resources/recipes/slate.recipe +++ b/resources/recipes/slate.recipe @@ -27,9 +27,6 @@ class PeriodicalNameHere(BasicNewsRecipe): encoding = None language = 'en' - - - # Method variables for customizing feed parsing summary_length = 250 use_embedded_content = None @@ -45,13 +42,26 @@ class PeriodicalNameHere(BasicNewsRecipe): match_regexps = [] # The second entry is for 'Big Money', which comes from a different site, uses different markup - keep_only_tags = [dict(attrs={ 'id':['article_top', 'article_body']}), + keep_only_tags = [dict(attrs={ 'id':['article_top', 'article_body', 'story']}), dict(attrs={ 'id':['content']}) ] # The second entry is for 'Big Money', which comes from a different site, uses different markup - remove_tags = [dict(attrs={ 'id':['toolbox','recommend_tab','insider_ad_wrapper', - 'article_bottom_tools_cntr','fray_article_discussion', 'fray_article_links','bottom_sponsored_links','author_bio', - 'bizbox_links_bottom','ris_links_wrapper','BOXXLE']}), + remove_tags = [dict(attrs={ 'id':[ + 'add_comments_button', + 'article_bottom_tools', + 'article_bottom_tools_cntr', + 'bizbox_links_bottom', + 'BOXXLE', + 'comments_button', + 'comments-to-fray', + 'fbog_article_bottom_cntr', + 'fray_article_discussion', 'fray_article_links','bottom_sponsored_links','author_bio', + 'insider_ad_wrapper', + 'js_kit_cntr', + 'recommend_tab', + 'ris_links_wrapper', + 'toolbox', + ]}), dict(attrs={ 'id':['content-top','service-links-bottom','hed']}) ] excludedDescriptionKeywords = ['Slate V','Twitter feed','podcast'] @@ -339,8 +349,8 @@ class PeriodicalNameHere(BasicNewsRecipe): # Change

to

headline = soup.find("h1") - tag = headline.find("span") - tag.name = 'div' + #tag = headline.find("span") + #tag.name = 'div' if headline is not None : h2tag = Tag(soup, "h2")