From 26fec949ac99c0117a75dc0558fd7d1b905ac387 Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Tue, 9 Jun 2015 10:36:52 -0700 Subject: pyblog: extract script tags from feeds Fixes #2. --- pyblog | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pyblog') diff --git a/pyblog b/pyblog index b11435a8..c6a7ac3e 100755 --- a/pyblog +++ b/pyblog @@ -390,6 +390,9 @@ def generate_index_and_feed(): # remove line numbers for line_number_span in article.find_all("span", attrs={"class": "line-number"}): line_number_span.extract() + # remove script tags + for script_tag in article.find_all("script"): + script_tag.extract() entry.content_html = ''.join([str(content) for content in article.contents]) entry.content = ET.Element("content", type="html") -- cgit v1.2.1