FIX: correctly defines data-attributes used by local-dates (#14418)

This was previously relying on data-* being allowed by other initialisers which could cause bugs if local dates ends up being used in other contexts.
This commit is contained in:
Joffrey JAFFEUX 2021-09-22 16:49:45 +02:00 committed by GitHub
parent a4cef67e14
commit e28a2735bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 1 deletions

View File

@ -140,7 +140,20 @@ function closeBuffer(buffer, state, text) {
}
export function setup(helper) {
helper.allowList(["span.discourse-local-date", "span[aria-label]"]);
helper.allowList([
"span.discourse-local-date",
"span[aria-label]",
"span[data-date]",
"span[data-time]",
"span[data-format]",
"span[data-countdown]",
"span[data-calendar]",
"span[data-displayed-timezone]",
"span[data-timezone]",
"span[data-timezones]",
"span[data-recurring]",
"span[data-email-preview]",
]);
helper.registerOptions((opts, siteSettings) => {
opts.datesEmailFormat = siteSettings.discourse_local_dates_email_format;