From 0373303d7f3fd4a2be7aa89c6bb87da1004cec58 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 10 Feb 2015 13:50:11 +0100 Subject: * credits + markup fixes --- http/index.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'http') diff --git a/http/index.py b/http/index.py index 4bccde5..9ba0371 100644 --- a/http/index.py +++ b/http/index.py @@ -68,7 +68,7 @@ def handler(req): return apache.OK # we need to sanitize line breaks and double-closed anchors manually - remote_content = bs4('' + ' '.join(remote_content[delimiters[0]+1:delimiters[1]]).replace('
', '
').replace('', '') + '', 'html.parser') + remote_content = bs4('
' + ' '.join(remote_content[delimiters[0]+1:delimiters[1]]).replace('
', '
').replace('', '') + '
', 'html.parser') # stub template for output page page_content = bs4(''' @@ -80,7 +80,7 @@ def handler(req): ''', 'html.parser') - page_content.html.body.append(remote_content.body) + page_content.html.body.append(remote_content.div) # internal links being rewritten to application links for link in page_content.select('a[href^="?p=21&pid="]'): @@ -119,6 +119,10 @@ def handler(req): for element in page_content.select(selector): link = element.wrap(page_content.new_tag('a')) link['href'] = search_url + + # credits info + credits_div = bs4('
Pomysł Ivana,
Ivan jest zajebisty.
', 'html.parser', from_encoding='utf-8') + page_content.html.body.div.append(credits_div.div) req.content_type = 'text/html' req.write(page_content.prettify('utf-8')) -- cgit v1.2.3