Improve template title

This commit is contained in:
Thomas Sileo
2019-07-17 09:29:48 +02:00
parent b7c421ff80
commit 8ed8a436e5
3 changed files with 8 additions and 4 deletions

8
app.py
View File

@@ -34,7 +34,7 @@ from flask import request
from flask import session
from flask import url_for
from flask_wtf.csrf import CSRFProtect
from html2text import html2text
import html2text
from itsdangerous import BadSignature
from little_boxes import activitypub as ap
from little_boxes.activitypub import ActivityType
@@ -123,6 +123,10 @@ else:
SIG_AUTH = HTTPSigAuth(KEY)
H2T = html2text.HTML2Text()
H2T.ignore_links = True
H2T.ignore_images = True
def is_blacklisted(url: str) -> bool:
return urlparse(url).netloc in BLACKLIST
@@ -340,7 +344,7 @@ def clean(html):
@app.template_filter()
def html2plaintext(body):
return html2text(body)
return H2T.handle(body)
@app.template_filter()