FIX: email preview content not updated in second local date
This commit is contained in:
parent
f38caf30fb
commit
2502a3f780
|
@ -33,10 +33,7 @@ function addLocalDate(buffer, matches, state) {
|
||||||
];
|
];
|
||||||
|
|
||||||
if (config.time) {
|
if (config.time) {
|
||||||
token.attrs.push([
|
token.attrs.push(["data-time", state.md.utils.escapeHtml(config.time)]);
|
||||||
"data-time",
|
|
||||||
state.md.utils.escapeHtml(config.time)
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let dateTime;
|
let dateTime;
|
||||||
|
|
|
@ -50,11 +50,12 @@ after_initialize do
|
||||||
end
|
end
|
||||||
|
|
||||||
on(:reduce_cooked) do |fragment|
|
on(:reduce_cooked) do |fragment|
|
||||||
container = fragment.css(".discourse-local-date").first
|
fragment.css(".discourse-local-date").each do |container|
|
||||||
|
|
||||||
if container && container.attributes["data-email-preview"]
|
if container.attributes["data-email-preview"]
|
||||||
preview = container.attributes["data-email-preview"].value
|
preview = container.attributes["data-email-preview"].value
|
||||||
container.content = preview
|
container.content = preview
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue