This commit is contained in:
Aevann1 2021-10-07 07:55:27 +02:00
parent 9ae0b804d6
commit 3201682623
9 changed files with 10 additions and 9 deletions

View file

@ -153,12 +153,13 @@ def api_comment(v):
if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})')
body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body)
body_md = body
options = []
for i in re.finditer('\s*\$\$([^\$\n]+)\$\$\s*', body):
for i in re.finditer('\s*\$\$([^\$\n]+)\$\$\s*', body_md):
options.append(i.group(1))
body = body.replace(i.group(0), "")
body_md = body_md.replace(i.group(0), "")
body_md = CustomRenderer().render(mistletoe.Document(body))
body_md = CustomRenderer().render(mistletoe.Document(body_md))
body_html = sanitize(body_md)
# Run safety filter