Skip to content

Conversation

@tiankaima
Copy link
Member

Motivation

  • The previous approach using remark-ins/remark-mark caused the comment preview rendering to break in this environment, so a safer in-tree transformation was required to restore previews.
  • Keep comment previews resilient while still supporting ++insert++ and ==mark== inline syntaxes.

Description

  • Removed the incompatible remark-ins and remark-mark packages and updated the lockfile and package.json to reflect their removal.
  • Added an in-repo rehype transform rehypeInsMark in src/components/comments/comment-markdown.tsx that turns ++...++ into <ins> and ==...== into <mark> at the HAST stage.
  • Registered rehypeInsMark in the rehypePlugins list used by ReactMarkdown and ensured ins/mark are allowed in the custom sanitize schema.
  • Kept and adjusted the existing markdown pipeline (including remarkGfm, remarkMath, remarkSupersub, remarkDirective, and remarkEmoji) and left the MarkdownErrorBoundary fallback to avoid full-page crashes.

Testing

  • Ran bun remove remark-ins remark-mark, which completed successfully and updated the lockfile. (success)
  • Started the dev server with bun dev (launching next dev) and requested GET /comments/guide, which returned 200 OK indicating the page served. (success)
  • Executed a Playwright script that navigated to /comments/guide and produced the screenshot artifact artifacts/markdown-ins-mark-fixed.png, confirming the comment preview renders; unrelated TLS/font download warnings and an Auth MissingSecret error causing GET /api/auth/session 500 were observed but did not block the preview render. (warnings present, page render succeeded)

Codex Task

@vercel
Copy link

vercel bot commented Jan 30, 2026

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

Project Deployment Actions Updated (UTC)
server-nextjs Ready Ready Preview, Comment Jan 30, 2026 1:02pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants