From ff01e16610a9482f9f10a6ae7136ad7cd6a18ff8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 20 Jun 2021 21:15:06 +0530 Subject: [PATCH] Fix #1459 (Recipe: slight improvement to Hindu) --- recipes/hindu.recipe | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/recipes/hindu.recipe b/recipes/hindu.recipe index 3116aa5ba5..a81ddcaa3a 100644 --- a/recipes/hindu.recipe +++ b/recipes/hindu.recipe @@ -1,10 +1,12 @@ -from __future__ import with_statement -__license__ = 'GPL 3' -__copyright__ = '2009, Kovid Goyal ' +#!/usr/bin/env python +# vim:fileencoding=utf-8 +# License: GPLv3 Copyright: 2009, Kovid Goyal -from calibre.web.feeds.news import BasicNewsRecipe import string +from calibre import entity_to_unicode +from calibre.web.feeds.news import BasicNewsRecipe + def classes(classes): q = frozenset(classes.split(' ')) @@ -67,6 +69,7 @@ class TheHindu(BasicNewsRecipe): try: desc = soup.find('meta', attrs={'name': 'description'}).get('content') if not desc.startswith('Todays paper'): + desc = entity_to_unicode(desc) desc += '...' if len(desc) >= 199 else '' # indicate truncation article.text_summary = article.summary = desc except AttributeError: