This commit is contained in:
2026-05-16 21:17:48 +02:00
parent 19301082f0
commit b5d81ed71c

View File

@@ -6902,7 +6902,13 @@ document.addEventListener("DOMContentLoaded", function () {
if (userPrefEl && window['motd_dismissed']) showPref = false; if (userPrefEl && window['motd_dismissed']) showPref = false;
if (typeof marked !== 'undefined') { if (typeof marked !== 'undefined') {
const rendered = marked.parseInline(escHTML(motd || '').replace(/\\/g, '\\\\').replace(/_/g, '\\_')); let mdSafe = escHTML(motd || '');
const bs = String.fromCharCode(92);
// Fix the shruggie specifically since markdown eats it
// Match ¯\_(ツ)_/¯ or ¯_(ツ)_/¯
const pattern = new RegExp('¯' + bs + bs + '?_\\(ツ\\)_/¯', 'g');
mdSafe = mdSafe.replace(pattern, '¯' + bs + bs + bs + '_(ツ)' + bs + '_/¯');
const rendered = marked.parseInline(mdSafe);
displays.forEach((display, i) => { displays.forEach((display, i) => {
if (display) { if (display) {
if (dataStores[i]) dataStores[i].innerText = motd; if (dataStores[i]) dataStores[i].innerText = motd;