Resolve @mentions in markdown preview endpoint

Pass dbsession to markdown_to_html so @username mentions are
converted to profile links during live preview, not just on save.
This commit is contained in:
russell@unturf.com 2026-02-01 21:44:43 -05:00
parent 8260897aeb
commit c93647e2b7

View file

@ -56,7 +56,8 @@ def redirect_to_root(request):
def preview_post(request):
"""AJAJ: Accept MarkDown data param, return HTML"""
try:
return markdown_to_html(request.params["data"], request.namespace)
return markdown_to_html(request.params["data"], request.namespace,
dbsession=request.dbsession)
except:
return "we could not create markdown to html preview."