diff --git a/misc/userscripts/readability b/misc/userscripts/readability index 26a46b0ec..4cf987c70 100755 --- a/misc/userscripts/readability +++ b/misc/userscripts/readability @@ -21,16 +21,24 @@ tmpfile = os.path.join( if not os.path.exists(os.path.dirname(tmpfile)): os.makedirs(os.path.dirname(tmpfile)) -# styling for window size depended margin scaling and line height -header = """ +# Styling for dynamic window margin scaling and line height +HEADER = """ + %s """ @@ -42,15 +50,15 @@ with codecs.open(os.environ['QUTE_HTML'], 'r', 'utf-8') as source: from breadability.readable import Article as reader doc = reader(data) title = doc._original_document.title - content = header % title + doc.readable + "" + content = HEADER % title + doc.readable + "" except ImportError: from readability import Document doc = Document(data) title = doc.title() - content = doc.summary().replace('', header % title) + content = doc.summary().replace('', HEADER % title) with codecs.open(tmpfile, 'w', 'utf-8') as target: - target.write(content) + target.write(content.lstrip()) with open(os.environ['QUTE_FIFO'], 'w') as fifo: fifo.write('open -t %s' % tmpfile)