fixed implementation of UGC content uploader

This commit is contained in:
2026-08-03 18:57:39 -05:00
parent 39e31d3980
commit 473b3c811b
40 changed files with 4137 additions and 87 deletions
+14
View File
@@ -0,0 +1,14 @@
from markdown_it import MarkdownIt
_markdown = MarkdownIt('js-default', {'html': False, 'breaks': True})
def render_markdown(text):
"""Render markdown text to safe HTML.
Raw HTML is escaped and dangerous link schemes (javascript:, data:,
vbscript:) are rejected by markdown-it with html=False.
"""
if not text:
return ''
return _markdown.render(text).rstrip('\n')