aboutsummaryrefslogtreecommitdiff
path: root/pyblog
diff options
context:
space:
mode:
authorZhiming Wang <zmwangx@gmail.com>2015-06-09 10:36:52 -0700
committerZhiming Wang <zmwangx@gmail.com>2015-06-09 10:36:52 -0700
commit26fec949ac99c0117a75dc0558fd7d1b905ac387 (patch)
treea0b4c391d7b7c18a538d0953fd352e0f1dd949fb /pyblog
parentd739ff7f59931ae4bf6d878d1879f568cf349dd7 (diff)
downloadmy_new_personal_website-26fec949ac99c0117a75dc0558fd7d1b905ac387.tar.xz
my_new_personal_website-26fec949ac99c0117a75dc0558fd7d1b905ac387.zip
pyblog: extract script tags from feeds
Fixes #2.
Diffstat (limited to '')
-rwxr-xr-xpyblog3
1 files changed, 3 insertions, 0 deletions
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")