Canapin
(Coin-coin le Canapin)
February 4, 2023, 10:52pm
4
Hi Proje DEV!
Are you using Topic List Excerpts ?
I believe you need a plugin if you want to override it to keep line breaks.
I think his is what would need to be overridden: discourse/app/controllers/topics_controller.rb at main 路 discourse/discourse 路 GitHub
More specifically, this line:
render_json_dump(post_ids: @topic_view.posts.pluck(:id))
end
def posts
params.require(:topic_id)
params.permit(:post_ids, :post_number, :username_filters, :filter, :include_suggested)
include_suggested = params[:include_suggested] == "true"
options = {
filter_post_number: params[:post_number],
post_ids: params[:post_ids],
asc: ActiveRecord::Type::Boolean.new.deserialize(params[:asc]),
filter: params[:filter],
include_suggested: include_suggested,
include_related: include_suggested,
}
fetch_topic_view(options)
render_json_dump(
I didn鈥檛 try, but this may be useful for this purpose: Override existing Discourse methods in plugins
I鈥檇 be happy to have a look, but I don鈥檛 have a development install right now (and I鈥檓 bad at coding, so hopefully someone more skilled will have a more suitable answer).