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
|
||||
fragment.css("details").each do |details|
|
||||
summary = details.css("summary")[0]
|
||||
summary.name = "p"
|
||||
details.replace(summary)
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue