feat(rehype): Conditionally expand code tabs in .md with {mdExpandTabs}#17877
Open
s1gr1d wants to merge 4 commits into
Open
feat(rehype): Conditionally expand code tabs in .md with {mdExpandTabs}#17877s1gr1d wants to merge 4 commits into
.md with {mdExpandTabs}#17877s1gr1d wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
sergical
reviewed
May 26, 2026
Member
sergical
left a comment
There was a problem hiding this comment.
My concern is that some pages use tabs as completely different approaches and if the llm knows that it's available, it doesn't mean it knows how to do it. example https://sentry-docs-git-sig-copy-page-all-snippets-conditional.sentry.dev/platforms/javascript/guides/nextjs.md
escaped` typescript
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: "___PUBLIC_DSN___",
// Adds request headers and IP for users
sendDefaultPii: true,
// ___PRODUCT_OPTION_START___ performance
tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1,
// ___PRODUCT_OPTION_END___ performance
// ___PRODUCT_OPTION_START___ session-replay
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
// ___PRODUCT_OPTION_END___ session-replay
// ___PRODUCT_OPTION_START___ logs
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs
integrations: [
// ___PRODUCT_OPTION_START___ session-replay
Sentry.replayIntegration(),
// ___PRODUCT_OPTION_END___ session-replay
],
});
end escaped `
*Also available for: Server, Edge*
also the fact that it's after the block might be confusing to llms since it could be thinking it's related to what's next vs what's before?
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.
DESCRIBE YOUR PR
Improvement of #17745
The generated
.mdfiles are mostly consumed by LLMs. Expanding every tab group floods context with trivial variations (npm/yarn/pnpm, ESM/CJS) that any LLM can infer from a single example.This PR makes tab expansion opt-in via
{mdExpandTabs}:{mdExpandTabs}vs. when to let tabs collapseExample page: https://sentry-docs-git-sig-copy-page-all-snippets-conditional.sentry.dev/platforms/javascript/guides/hono.md
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes: