From 63e9f558b0582b25a8d422bc6cea60126500eaa7 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 19 2020 15:29:33 +0000 Subject: when editing the issue's description sent the html of it to the SSE server Then in the JS we can display the nice version of the issue's description live, instead of having to reload the page to see the markdown rendered. Fixes https://pagure.io/pagure/issue/5039 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/query.py b/pagure/lib/query.py index f80927b..9b8b3ec 100644 --- a/pagure/lib/query.py +++ b/pagure/lib/query.py @@ -2190,6 +2190,7 @@ def edit_issue( public=True, with_comments=False ), "priorities": issue.project.priorities, + "content_updated": text2markdown(issue.content), } ), ) diff --git a/pagure/static/issue_ev.js b/pagure/static/issue_ev.js index 6289f2b..83fcca6 100644 --- a/pagure/static/issue_ev.js +++ b/pagure/static/issue_ev.js @@ -264,7 +264,7 @@ update_issue = function(data, _roadmap_url) { } } else if (_f == 'content'){ var field = $('#comment-0').parent().find('.comment_body'); - field.html('

' + data.issue.content + '

'); + field.html('

' + data.content_updated + '

'); } else if (_f == 'milestone'){ var field = $('#milestone_plain'); var _url = _roadmap_url.replace('-123456789', data.issue.milestone);