From 420c4fd7aeb9c4685d0c7e0f285f323130bc5b8c Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Tue, 9 Jun 2015 10:12:59 -0700 Subject: pyblog: do not include line-number classes in feed For one thing, the top attribute is not recommended in feeds (see https://github.com/zmwangx/zmwangx.github.io/issues/2). Also, extracting line numbers (which are useless in feeds) make the feeds smaller. --- pyblog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyblog b/pyblog index eca043ff..1ace53e8 100755 --- a/pyblog +++ b/pyblog @@ -385,6 +385,9 @@ def generate_index_and_feed(): article.header.extract() if article.footer is not None: article.footer.extract() + # remove line numbers + for line_number_span in article.find_all("span", attrs={"class": "line-number"}): + line_number_span.extract() entry.content_html = ''.join([str(content) for content in article.contents]) entry.content = ET.Element("content", type="html") -- cgit v1.2.1