diff --git a/assets/javascripts/discourse/initializers/extend-for-solved-button.js.es6 b/assets/javascripts/discourse/initializers/extend-for-solved-button.js.es6 index ed068d7..296052b 100644 --- a/assets/javascripts/discourse/initializers/extend-for-solved-button.js.es6 +++ b/assets/javascripts/discourse/initializers/extend-for-solved-button.js.es6 @@ -4,6 +4,7 @@ import TopicStatus from 'discourse/views/topic-status'; import { popupAjaxError } from 'discourse/lib/ajax-error'; import { withPluginApi } from 'discourse/lib/plugin-api'; import { ajax } from 'discourse/lib/ajax'; +import PostCooked from 'discourse/widgets/post-cooked' function clearAccepted(topic) { const posts = topic.get('postStream.posts'); @@ -46,7 +47,8 @@ function acceptPost(post) { topic.set('accepted_answer', { username: post.get('username'), - post_number: post.get('post_number') + post_number: post.get('post_number'), + excerpt: post.get('cooked') }); ajax("/solution/accept", { @@ -153,7 +155,24 @@ function initializeWithApi(api) { if (postModel) { const topic = postModel.get('topic'); if (topic.get('accepted_answer')) { - return dec.rawHtml(`
${topic.get('acceptedAnswerHtml')}
`); + var rawhtml = ` +