From 47f31730f7c4a9f8f15a1c8468b388dd80df2e75 Mon Sep 17 00:00:00 2001 From: riyadhafraa <49757212-riyadhafraa@users.noreply.replit.com> Date: Wed, 20 May 2026 11:16:31 +0000 Subject: [PATCH] Remove HTML from meeting notification subjects Strip HTML tags from meeting subjects using a helper function in `executive-meeting-scheduler.ts` to ensure plain text display in push notifications. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: ec660c7b-c476-4440-8578-eef124542d3b Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/IO8TMSC Replit-Helium-Checkpoint-Created: true --- .../src/lib/executive-meeting-scheduler.ts | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/artifacts/api-server/src/lib/executive-meeting-scheduler.ts b/artifacts/api-server/src/lib/executive-meeting-scheduler.ts index 8a45d09c..7a6b0410 100644 --- a/artifacts/api-server/src/lib/executive-meeting-scheduler.ts +++ b/artifacts/api-server/src/lib/executive-meeting-scheduler.ts @@ -20,6 +20,29 @@ function pad2(n: number): string { return String(n).padStart(2, "0"); } +/** + * Reduce a rich-text snippet (Tiptap HTML) to plain text safe for a + * push-notification body. Meeting titles are stored as rich text so the + * scheduler can't just shove them into the payload — iOS shows the raw + * `
…
` markup verbatim on the lock + * screen otherwise. + */ +function stripHtmlToPlainText(input: string | null | undefined): string { + if (!input) return ""; + // Drop tags, collapse whitespace, decode the handful of named + // entities Tiptap emits. Anything more (full HTML parser) would + // pull a dependency for zero benefit on a 1-line notification. + const noTags = input.replace(/<[^>]*>/g, " "); + const decoded = noTags + .replace(/ /g, " ") + .replace(/&/g, "&") + .replace(/</g, "<") + .replace(/>/g, ">") + .replace(/"/g, '"') + .replace(/'/g, "'"); + return decoded.replace(/\s+/g, " ").trim(); +} + function dateKey(d: Date): string { return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`; } @@ -125,8 +148,14 @@ async function tickOnce(): Promise