mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 11:19:51 +00:00
FIX: malformed <details> should not break email
This commit is contained in:
parent
3f9ed76dad
commit
672d6924ec
@ -19,9 +19,14 @@ after_initialize do
|
|||||||
|
|
||||||
# replace all details with their summary in emails
|
# replace all details with their summary in emails
|
||||||
fragment.css("details").each do |details|
|
fragment.css("details").each do |details|
|
||||||
summary = details.css("summary")[0]
|
summary = details.css("summary")
|
||||||
summary.name = "p"
|
if summary && summary[0]
|
||||||
details.replace(summary)
|
summary = summary[0]
|
||||||
|
if summary && summary.respond_to?(:name)
|
||||||
|
summary.name = "p"
|
||||||
|
details.replace(summary)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user