diff --git a/web/app.py b/web/app.py index 892707c..dd5d6d9 100644 --- a/web/app.py +++ b/web/app.py @@ -813,7 +813,10 @@ By using this service, you agree not to do anything malicious. You agree to use content = '' # try: l_news = News.query.order_by(News.time.desc()).first() - return render_template('index.html', news = Markup(content), content_block = Markup(home_text.data), text = l_news.text[:300] + '...', subject = l_news.subject, date = l_news.date, news_id = l_news.id) + dots = '' + if len(l_news.text) > 300: + dots = '...' + return render_template('index.html', news = Markup(content), content_block = Markup(home_text.data), text = l_news.text[:300] + dots, subject = l_news.subject, date = l_news.date, news_id = l_news.id) # except: # content = '' # return render_template('index.html', content_block = Markup(home_text.data)) @@ -824,7 +827,7 @@ By using this service, you agree not to do anything malicious. You agree to use def tos_page(): tos_text = Pages.query.filter_by(id=2).first() - return render_template('generic.html', markup_content = tos_text.data) + return render_template('markdown_generic.html', markup_content = tos_text.data) @app.route('/page/') def other_page(id): diff --git a/web/templates/generic.html b/web/templates/generic.html index 6244bd2..4b6251b 100644 --- a/web/templates/generic.html +++ b/web/templates/generic.html @@ -5,7 +5,7 @@
-{{markup_content|markdown}} +{{markup_content}}
diff --git a/web/templates/markdown_generic.html b/web/templates/markdown_generic.html new file mode 100644 index 0000000..6244bd2 --- /dev/null +++ b/web/templates/markdown_generic.html @@ -0,0 +1,12 @@ +{% extends 'flask_user/_public_base.html' %} +{% block content %} +

 

+ +
+ + +{{markup_content|markdown}} + +
+ +{% endblock %}