mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 05:01:14 +08:00
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:
@ -140,7 +140,20 @@ function closeBuffer(buffer, state, text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function setup(helper) {
|
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) => {
|
helper.registerOptions((opts, siteSettings) => {
|
||||||
opts.datesEmailFormat = siteSettings.discourse_local_dates_email_format;
|
opts.datesEmailFormat = siteSettings.discourse_local_dates_email_format;
|
||||||
|
Reference in New Issue
Block a user