mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:21:18 +08:00
DEV: Correctly tag heredocs (#16061)
This allows text editors to use correct syntax coloring for the heredoc sections. Heredoc tag names we use: languages: SQL, JS, RUBY, LUA, HTML, CSS, SCSS, SH, HBS, XML, YAML/YML, MF, ICS other: MD, TEXT/TXT, RAW, EMAIL
This commit is contained in:
@ -45,14 +45,14 @@ class PostsController < ApplicationController
|
||||
opts[:limit] = MARKDOWN_TOPIC_PAGE_SIZE
|
||||
topic_view = TopicView.new(params[:topic_id], current_user, opts)
|
||||
content = topic_view.posts.map do |p|
|
||||
<<~HEREDOC
|
||||
<<~MD
|
||||
#{p.user.username} | #{p.updated_at} | ##{p.post_number}
|
||||
|
||||
#{p.raw}
|
||||
|
||||
-------------------------
|
||||
|
||||
HEREDOC
|
||||
MD
|
||||
end
|
||||
render plain: content.join
|
||||
end
|
||||
|
Reference in New Issue
Block a user