Raw HTML displayed on meeting descriptions (public-facing calendar) - #229
Merged
Merged
Conversation
…ent (#228) Route event.description through HtmlContent, matching how committees/news/legislation descriptions are displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Meeting/event descriptions are authored through
RichTextEditor(wired up inCalendarEventForm.tsxline 95), which stores the field as an HTML string (e.g.<p>Join us in <strong>Union 3408</strong>...</p>), not plain text. The public-facing meetings calendar (/frontend/src/app/meetings/page.tsx→CalendarWidget) renders this field via plain JSX interpolation in the "Full page version" day-detail card —<p className="text-gray-600">{event.description}</p>(/frontend/src/components/calendar/CalendarWidget.tsx, lines 304–306). Because React auto-escapes{event.description}as text rather than markup, the meetings page shows the literal tags (<p>,<strong>, etc.) instead of formatted content.This is inconsistent with the rest of the app: every other place that displays a
RichTextEditor-authored field routes it through theHtmlContentcomponent (/frontend/src/components/content/HtmlContent.tsx), which renders viadangerouslySetInnerHTML. This pattern is used for the equivalentcommittee.descriptionfield (/frontend/src/app/committees/[id]/page.tsxlines 37–38), as well as for news and legislation body content. The meetings calendar's day-detail card is one more place this contract is broken.(The admin Events table at
/frontend/src/app/admin/events/page.tsxdoes not display a description column at all — only title, date/time, location, type, and status — so the admin dashboard grid itself is not affected. The compact calendar widget used on the homepage also omits description entirely. The bug is isolated to the full-size calendar's expanded event card.)Changes:
Closes #228