sdf
This commit is contained in:
parent
ae5f9bb36a
commit
0c2f4c1910
2 changed files with 10 additions and 3 deletions
|
@ -5,14 +5,13 @@ from flask import g
|
|||
from .markdown import *
|
||||
from .sanitize import *
|
||||
from .const import *
|
||||
from mistletoe.html_renderer import HTMLRenderer
|
||||
|
||||
def create_comment(text, autojanny=False):
|
||||
if autojanny: author_id = AUTOJANNY_ID
|
||||
else: author_id = NOTIFICATIONS_ID
|
||||
|
||||
text = text.replace('r/', 'r\/').replace('u/', 'u\/')
|
||||
text_html = sanitize(HTMLRenderer().render(mistletoe.Document(text)))
|
||||
text_html = sanitize(Renderer2().render(mistletoe.Document(text)))
|
||||
new_comment = Comment(author_id=author_id,
|
||||
parent_submission=None,
|
||||
distinguish_level=6,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue