[events] Strip inline markdown from extracted descriptions - #77
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
dj013
force-pushed
the
fix/plain-text-event-descriptions
branch
from
August 11, 2026 17:32
d43f086 to
b75a0d8
Compare
duxi90
approved these changes
Aug 11, 2026
This branch was successfully deployed
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.
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_boundis 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—parseEventFilestrips the excerpt (and frontmatterdescription) before truncating, which also fixes the half-cut links.lib/event-validation.test.ts— a new suite walks every event throughgetAllEventsServer()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 nodesince events-server's barefsimport doesn't resolve under jsdom.walkthroughto the project dictionary — it arrived in CONTRIBUTING.md with [seo] Speaker registry, performer and offers.validFrom in structured data #75 andpnpm spellhas been failing onmainsince.