mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:11:11 +08:00
FIX: Replace details content with instruction.
This commit is contained in:

committed by
Guo Xiang Tan

parent
6cceb72173
commit
3a1d99577e
@ -31,8 +31,14 @@ after_initialize do
|
||||
end
|
||||
end
|
||||
|
||||
on(:reduce_cooked) do |fragment|
|
||||
fragment.css("details.elided").each(&:remove)
|
||||
on(:reduce_cooked) do |fragment, post|
|
||||
fragment.css("details").each do |el|
|
||||
text = fragment.css("summary").text
|
||||
link = fragment.document.create_element("a")
|
||||
link["href"] = post.url if post
|
||||
link.content = I18n.t("details.excerpt_details")
|
||||
el.replace text + " " + link.to_html
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user