fix spec and simplify code
This commit is contained in:
parent
9a5aa39740
commit
d57a17879a
|
@ -13,9 +13,12 @@ enabled_site_setting :discourse_local_dates_enabled
|
|||
|
||||
after_initialize do
|
||||
on(:reduce_cooked) do |fragment|
|
||||
container = fragment.children[0].children[0]
|
||||
preview = container.attributes["data-email-preview"].value
|
||||
container.content = preview
|
||||
container = fragment.css(".discourse-local-date").first
|
||||
|
||||
if container
|
||||
preview = container.attributes["data-email-preview"].value
|
||||
container.content = preview
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue