Repository navigation
Conversation
Add remark-gfm so GFM tables render as real tables, style table elements to match the card, keep wide tables readable inside a horizontal scroll container, and drop the linkifyBareUrls regex now that remark-gfm autolinks natively.
|
@binzam is attempting to deploy a commit to the filiksyos' projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
This branch has not been 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.
Summary
The generated
design.mdshown on the design page (/designs/[slug]) contains GFM tables (for example the color palette), but they rendered as a single run of plain text with the pipes and dashes visible.react-markdownonly supports core CommonMark, and tables are a GitHub Flavored Markdown extension.Changes
remark-gfmto enable tables, strikethrough, task lists, and autolink literalstable,thead,tbody,tr,th,td) to match the existing card, with a bordered wrapper, a header background, and zebra rows. GFM column alignment (:---:) is preserved.w-max min-w-full) with a min/max width on cells, so wide tables scroll horizontally inside the wrapper and columns stay readable instead of being squeezedlinkifyBareUrlsregex helper.remark-gfmautolinks bare URLs natively, and the regex could rewrite URLs inside code blocks and table cells. It also used a lookbehind, which older Safari versions don't support.bg/padding) inside<pre>componentsmap to module scope so they keep a stable identity between rendersScreenshots
Before

After

How to see the changes
The preview route and fixture are dev-only, so they are intentionally not part of this PR. To see the fix locally, add the two files below.
pnpm install.lib/mock-design-md.tswith the content below.app/dev/markdown-preview/page.tsxwith the content below. It returns a 404 in production.pnpm devand open http://localhost:3000/dev/markdown-previewlib/mock-design-md.tsapp/dev/markdown-preview/page.tsxWhat to check
code, and inlinecodekeeps the chip styleYou can also open any existing
/designs/<slug>page whosedesign.mdcontains a table, and the prompt view in the reverse flow, which uses the same component.When you're done, remove the test files with
rm -r app/dev lib/mock-design-md.ts.Notes
remark-gfm(added topackage.json)pnpm-lock.yamlis intentionally not included. Regenerating it produced a lot of unrelated churn, so please runpnpm installto update it for the new dependency.PromptMarkdownis also used by the prompt view incomponents/website-reverse-page.tsx, so tables and native autolinking apply there tooreadWebsiteReversedesign_mdstill renders as plain text, check how the generator emits newlines