fix: render dates in quotes with long text

This commit is contained in:
trisua 2025-07-02 22:41:10 -04:00
parent b493b2ade8
commit ee2f7c7cbb

View file

@ -163,7 +163,7 @@ media_theme_pref();
}
});
self.define("clean_poll_date_codes", ({ $ }) => {
self.define("clean_poll_date_codes", async ({ $ }) => {
for (const element of Array.from(
document.querySelectorAll(".poll_date"),
)) {
@ -183,7 +183,7 @@ media_theme_pref();
element.setAttribute("title", then.toLocaleString());
const pretty =
$.rel_date(then)
(await $.rel_date(then))
.replaceAll(" minutes ago", "m")
.replaceAll(" minute ago", "m")
.replaceAll(" hours ago", "h")
@ -409,9 +409,13 @@ media_theme_pref();
}
});
self.define("hooks::long", (_, element, full_text) => {
self.define("hooks::long", ({ $ }, element, full_text) => {
element.classList.remove("hook:long.hidden_text");
element.innerHTML = full_text;
$.clean_date_codes();
$.clean_poll_date_codes();
$.link_filter();
});
self.define("hooks::long_text.init", (_) => {