FIX: email preview content not updated in second local date

This commit is contained in:
Vinoth Kannan 2018-10-12 03:56:35 +05:30
parent f38caf30fb
commit 2502a3f780
2 changed files with 6 additions and 8 deletions

View File

@ -33,10 +33,7 @@ function addLocalDate(buffer, matches, state) {
];
if (config.time) {
token.attrs.push([
"data-time",
state.md.utils.escapeHtml(config.time)
]);
token.attrs.push(["data-time", state.md.utils.escapeHtml(config.time)]);
}
let dateTime;

View File

@ -50,11 +50,12 @@ after_initialize do
end
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"]
preview = container.attributes["data-email-preview"].value
container.content = preview
if container.attributes["data-email-preview"]
preview = container.attributes["data-email-preview"].value
container.content = preview
end
end
end
end