Skip to content

[events] Strip inline markdown from extracted descriptions - #77

Merged
duxi90 merged 1 commit into
mainfrom
fix/plain-text-event-descriptions
Aug 11, 2026
Merged

duxi90 merged 1 commit into
mainfrom
fix/plain-text-event-descriptions

Conversation

@dj013

@dj013 dj013 commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Event descriptions are excerpted from the first body paragraph but consumed as plain text everywhere — cards, the event page description box, <meta> descriptions, OpenGraph, JSON-LD — so inline markdown survived verbatim. Ten events were affected: "C++ Serbia Beer Wednesday" rendered with literal asterisks on the events list, seven events showed raw [text](url) link syntax, and the 200-character truncation could cut a link in half, leaving ([subroutines](<ht... in the Korutine excerpt.

Rendering the excerpt through ReactMarkdown would fix only the UI, not the meta tags and structured data, so the markup comes off at the source instead:

  • lib/strip-markdown.ts — stripInlineMarkdown() reduces links and images to their text, bares autolinks, and drops emphasis/code/strikethrough markers. Intraword underscores survive (lower_bound is an identifier, not emphasis), and angle-bracketed link destinations with parentheses in the URL are handled. Inline constructs only — block-level markdown never reaches the extractor.
  • lib/events-server.ts — parseEventFile strips the excerpt (and frontmatter description) before truncating, which also fixes the half-cut links.
  • lib/event-validation.test.ts — a new suite walks every event through getAllEventsServer() and fails when a description still carries markup, so a new markdown construct in an event body surfaces in CI rather than on the site. The file gets @vitest-environment node since events-server's bare fs import doesn't resolve under jsdom.
  • Drive-by: adds walkthrough to the project dictionary — it arrived in CONTRIBUTING.md with [seo] Speaker registry, performer and offers.validFrom in structured data #75 and pnpm spell has been failing on main since.

@vercel

vercel Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cppserbia-org-website Ready Ready Preview, v0 Aug 11, 2026 5:33pm

Request Review

Event descriptions are excerpted from the first body paragraph but consumed
as plain text everywhere — cards, the event page, <meta> descriptions,
OpenGraph, JSON-LD — so markdown survived verbatim: "**C++ Serbia Beer
Wednesday**" rendered with literal asterisks on the events list, and seven
events showed raw "[text](url)" link syntax. Truncation made it worse by
cutting links in half, leaving "([subroutines](<ht..." in the Korutine
excerpt.

Rendering the excerpt as markdown would fix only the UI, not the meta tags,
so the markup comes off at the source instead: a stripInlineMarkdown pass in
parseEventFile reduces links and images to their text and drops emphasis,
code and strikethrough markers, before the 200-character cut. Frontmatter
descriptions go through the same pass. Intraword underscores survive —
lower_bound is an identifier, not emphasis.

A validation test now walks every event through getAllEventsServer and fails
when a description still carries markup, so new markdown constructs in event
bodies surface in CI rather than on the site. That file gets an explicit
node environment: it now imports events-server, whose bare `fs` import the
default jsdom environment can't resolve.

Also adds "walkthrough" to the project dictionary — it arrived in
CONTRIBUTING.md with #75 and pnpm spell has been failing on main since.
@duxi90
duxi90 merged commit 5332f41 into main Aug 11, 2026
4 checks passed
@duxi90
duxi90 deleted the fix/plain-text-event-descriptions branch August 11, 2026 18:02

This branch was successfully deployed

1 active deployment
Preview — b75a0d86 Deployed Aug 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants