gfd
This commit is contained in:
parent
335d09a0f2
commit
c3d5b1a53c
1 changed files with 2 additions and 5 deletions
|
@ -9,9 +9,7 @@ from files.routes.front import comment_idlist
|
||||||
from pusher_push_notifications import PushNotifications
|
from pusher_push_notifications import PushNotifications
|
||||||
from flask import *
|
from flask import *
|
||||||
from files.__main__ import app, limiter
|
from files.__main__ import app, limiter
|
||||||
from mistune import Markdown
|
|
||||||
|
|
||||||
markdown = Markdown()
|
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
site = environ.get("DOMAIN").strip()
|
||||||
|
|
||||||
|
@ -152,7 +150,7 @@ def api_comment(v):
|
||||||
|
|
||||||
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE):
|
for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE):
|
||||||
if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'})')
|
if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'})')
|
||||||
# body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body)
|
body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body)
|
||||||
|
|
||||||
body_md = body
|
body_md = body
|
||||||
options = []
|
options = []
|
||||||
|
@ -160,8 +158,7 @@ def api_comment(v):
|
||||||
options.append(i.group(1))
|
options.append(i.group(1))
|
||||||
body_md = body_md.replace(i.group(0), "")
|
body_md = body_md.replace(i.group(0), "")
|
||||||
|
|
||||||
body_md = markdown(body_md)
|
body_md = CustomRenderer().render(mistletoe.Document(body_md))
|
||||||
print('mistune')
|
|
||||||
body_html = sanitize(body_md)
|
body_html = sanitize(body_md)
|
||||||
|
|
||||||
bans = filter_comment_html(body_html)
|
bans = filter_comment_html(body_html)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue