mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
FIX: malformed <details> should not break email
This commit is contained in:
@ -19,10 +19,15 @@ after_initialize do
|
||||
|
||||
# replace all details with their summary in emails
|
||||
fragment.css("details").each do |details|
|
||||
summary = details.css("summary")[0]
|
||||
summary = details.css("summary")
|
||||
if summary && summary[0]
|
||||
summary = summary[0]
|
||||
if summary && summary.respond_to?(:name)
|
||||
summary.name = "p"
|
||||
details.replace(summary)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user