aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpyAggr3g470r.py2
-rwxr-xr-xutils.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py
index 33a5da2c..67beea86 100755
--- a/pyAggr3g470r.py
+++ b/pyAggr3g470r.py
@@ -35,6 +35,7 @@ import calendar
import threading
from collections import Counter
+from BeautifulSoup import BeautifulSoup
import utils
import feedgetter
@@ -180,6 +181,7 @@ class Root:
article_content = utils.clear_string(article.article_description)
if article_content:
description = " ".join(article_content[:500].split(' ')[:-1])
+ description = str(BeautifulSoup(description))
else:
description = "No description."
# Title of the article
diff --git a/utils.py b/utils.py
index e5fc455d..5587ce0e 100755
--- a/utils.py
+++ b/utils.py
@@ -103,7 +103,7 @@ def clear_string(data):
"""
p = re.compile(r'<[^<]*?/?>') # HTML tags
q = re.compile(r'\s') # consecutive white spaces
- return p.sub('', q.sub(' ', data.replace('', '')))
+ return p.sub('', q.sub(' ', data))
def unescape(text):
"""
bgstack15