diff --git a/www/src/utils/portal-presentation.ts b/www/src/utils/portal-presentation.ts index 2d8cd91..bd494fb 100644 --- a/www/src/utils/portal-presentation.ts +++ b/www/src/utils/portal-presentation.ts @@ -1,8 +1,13 @@ /** Translate a narrow presentation vocabulary; never copy arbitrary classes/styles. */ -export function portalLinkPresentation(classes: string[], background: string, protocol: string): string | undefined { +export function portalLinkPresentation(classes: string[], background: string, protocol: string, label = ''): string | undefined { if (protocol === 'mailto:' || protocol === 'tel:') return 'portal-contact-link'; + // The legacy portal's operational lineup-report anchors are styled by HubSpot + // rules that do not survive the sanitized render. Recognize their visible + // label, not arbitrary source classes, CSS, destinations or executable markup. + const lineupReport = /\b(?:daily|monthly)\s+lineup\s+report\b/i.test(label.replace(/\s+/g, ' ').trim()); if (classes.some((name) => ['hs-button', 'content-button', 'portal-resource-button'].includes(name)) || - ['rgb(255, 189, 89)', 'rgb(255, 145, 77)', '#ffbd59', '#ff914d'].includes(background.toLowerCase())) { + ['rgb(255, 189, 89)', 'rgb(255, 145, 77)', '#ffbd59', '#ff914d'].includes(background.toLowerCase()) || + lineupReport) { return 'portal-resource-button'; } return undefined;