Forgot that internal tags (@author and so) will end in the RSS description… Fixed

This commit is contained in:
Phyks 2014-07-13 01:08:14 +02:00
parent 0f15a2b471
commit 24cb3a9182

View File

@ -781,6 +781,7 @@ rss += ("\t<channel>"
# Generate header (except title) + index file + rss file # Generate header (except title) + index file + rss file
for i, article in enumerate(["gen/"+x[4:-5]+".gen" for x in last_articles]): for i, article in enumerate(["gen/"+x[4:-5]+".gen" for x in last_articles]):
content, title, tags, date, author = "", "", "", "", "" content, title, tags, date, author = "", "", "", "", ""
content_desc = ""
try: try:
with open(article, "r") as fh: with open(article, "r") as fh:
for line in fh.readlines(): for line in fh.readlines():
@ -797,6 +798,7 @@ for i, article in enumerate(["gen/"+x[4:-5]+".gen" for x in last_articles]):
if "@tags=" in line: if "@tags=" in line:
tags = line[line.find("@tags=")+6:].strip() tags = line[line.find("@tags=")+6:].strip()
continue continue
content_desc += line
except IOError: except IOError:
sys.exit("[ERROR] Unable to open "+article+" file.") sys.exit("[ERROR] Unable to open "+article+" file.")
@ -823,7 +825,7 @@ for i, article in enumerate(["gen/"+x[4:-5]+".gen" for x in last_articles]):
"\t\t\t<guid isPermaLink=\"true\">" + "\t\t\t<guid isPermaLink=\"true\">" +
params["PROTOCOL"] + params["BLOG_URL"]+"/"+article[4:-4]+".html</guid>\n" params["PROTOCOL"] + params["BLOG_URL"]+"/"+article[4:-4]+".html</guid>\n"
# Apply remove_tags twice to also remove tags in @title and so # Apply remove_tags twice to also remove tags in @title and so
"\t\t\t<description>" + truncate(remove_tags(remove_tags(replace_tags(get_text_rss(content), "\t\t\t<description>" + truncate(remove_tags(remove_tags(replace_tags(get_text_rss(content_desc),
search_list, search_list,
replace_list)))) + replace_list)))) +
"</description>\n" + "</description>\n" +