From e32744eb6d0ae3a41c3c818d4e32146ba4c8f644 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 21 Jan 2009 10:06:09 -0800 Subject: [PATCH] Fix #1669 (xkcd recipe improvement: bubble help) --- src/calibre/web/feeds/recipes/recipe_xkcd.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/calibre/web/feeds/recipes/recipe_xkcd.py b/src/calibre/web/feeds/recipes/recipe_xkcd.py index f76cf5614e..35a65ab948 100644 --- a/src/calibre/web/feeds/recipes/recipe_xkcd.py +++ b/src/calibre/web/feeds/recipes/recipe_xkcd.py @@ -5,7 +5,7 @@ __copyright__ = '2008, Kovid Goyal ' Fetch xkcd. ''' -import time +import time, re from calibre.web.feeds.news import BasicNewsRecipe class XkcdCom(BasicNewsRecipe): @@ -17,6 +17,11 @@ class XkcdCom(BasicNewsRecipe): keep_only_tags = [dict(id='middleContent')] remove_tags = [dict(name='ul'), dict(name='h3'), dict(name='br')] no_stylesheets = True + # turn image bubblehelp into a paragraph + preprocess_regexps = [ + (re.compile(r'()'), + lambda m: '%s%s

%s

' % (m.group(1), m.group(3), m.group(2))) + ] def parse_index(self): INDEX = 'http://xkcd.com/archive/'