|
@@ -6,7 +6,7 @@
|
|
|
# Author: jianglin
|
|
|
# Email: xiyang0807@gmail.com
|
|
|
# Created: 2016-05-20 13:18:19 (CST)
|
|
|
-# Last Update:星期五 2016-6-17 13:28:58 (CST)
|
|
|
+# Last Update:星期日 2016-6-19 16:51:32 (CST)
|
|
|
# By:
|
|
|
# Description:
|
|
|
# **************************************************************************
|
|
@@ -14,9 +14,11 @@ from flask import Blueprint, render_template, request, url_for
|
|
|
from maple import app
|
|
|
from maple.helpers import is_num
|
|
|
from maple.topic.models import Tags, Topic
|
|
|
+from maple.filters import Filters
|
|
|
from urllib.parse import urljoin
|
|
|
+from werkzeug.utils import escape
|
|
|
from werkzeug.contrib.atom import AtomFeed
|
|
|
-from maple.filters import Filters
|
|
|
+
|
|
|
|
|
|
site = Blueprint('tag', __name__)
|
|
|
|
|
@@ -41,7 +43,7 @@ def tag(tag):
|
|
|
|
|
|
@site.route('/<tag>/feed')
|
|
|
def rss(tag):
|
|
|
- feed = AtomFeed('Recent Topics',
|
|
|
+ feed = AtomFeed('%s·HonMaple社区'%tag,
|
|
|
feed_url=request.url,
|
|
|
url=request.url_root,
|
|
|
subtitle='I like solitude, yearning for freedom')
|
|
@@ -50,8 +52,8 @@ def rss(tag):
|
|
|
for topic in topics:
|
|
|
feed.add(
|
|
|
topic.title,
|
|
|
- Filters.safe_markdown(topic.content)
|
|
|
- if topic.is_markdown else topic.content,
|
|
|
+ escape(Filters.safe_markdown(topic.content)
|
|
|
+ if topic.is_markdown else topic.content),
|
|
|
content_type='html',
|
|
|
author=topic.author.username,
|
|
|
url=urljoin(request.url_root,
|