From 83db3f770c07825a97875203be0d1086ca5d7078 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 25 Jul 2019 18:08:18 +0200 Subject: [PATCH] Don't generate HTML/CSS wrapper for the content unless the output is a destination file (HTML/PDF). --- platypush/plugins/http/webpage/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platypush/plugins/http/webpage/__init__.py b/platypush/plugins/http/webpage/__init__.py index e92648f4f8..a0bdcbd697 100644 --- a/platypush/plugins/http/webpage/__init__.py +++ b/platypush/plugins/http/webpage/__init__.py @@ -68,9 +68,7 @@ class HttpWebpagePlugin(Plugin): 'Published' if response.get('date_published') else 'Generated', response.get('date_published', datetime.datetime.now().isoformat()))) - content = '

{title}

{content}'.\ - format(title=title, content=response.get('content', '[No content available]'), - body_style='font-size: 22px; font-family: Tahoma, Geneva, sans-serif') + content = response.get('content', '') if not outfile: return { @@ -79,6 +77,10 @@ class HttpWebpagePlugin(Plugin): 'content': content, } + content = '

{title}

{content}'. \ + format(title=title, content=content, + body_style='font-size: 22px; font-family: Tahoma, Geneva, Verdana, Helvetica, sans-serif') + outfile = os.path.abspath(os.path.expanduser(outfile)) if outfile.lower().endswith('.pdf'):