mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
SubredditRules: Send rendered markdown in api responses.
In the create and update endpoints, send the rendered description markdown in the response. We don’t have client-side markdown rendering, so this is necessary for the rules page to be fully ajax-y.
This commit is contained in:
@@ -5045,6 +5045,11 @@ class ApiController(RedditController):
|
||||
|
||||
SubredditRules.create(c.site, short_name, description)
|
||||
ModAction.create(c.site, c.user, 'createrule', details=short_name)
|
||||
|
||||
if description:
|
||||
description_html = safemarkdown(description, wrap=False)
|
||||
form._send_data(description_html=description_html)
|
||||
|
||||
form.refresh()
|
||||
|
||||
@require_oauth2_scope("modconfig")
|
||||
@@ -5072,6 +5077,11 @@ class ApiController(RedditController):
|
||||
SubredditRules.update(c.site, old_short_name, short_name,
|
||||
description)
|
||||
ModAction.create(c.site, c.user, 'editrule', details=short_name)
|
||||
|
||||
if description:
|
||||
description_html = safemarkdown(description, wrap=False)
|
||||
form._send_data(description_html=description_html)
|
||||
|
||||
form.refresh()
|
||||
|
||||
@require_oauth2_scope("modconfig")
|
||||
|
||||
Reference in New Issue
Block a user