fix(website): restore syntax highlighting for nested code blocks - #1660
Open
unrevised6419 wants to merge 1 commit into
Open
fix(website): restore syntax highlighting for nested code blocks#1660unrevised6419 wants to merge 1 commit into
unrevised6419 wants to merge 1 commit into
Conversation
Fenced code blocks nested inside a list item rendered as unhighlighted raw text. fumadocs-core 16.7.15 returned 'skip' from the rehypeCode visitor for every unmatched element, so unist-util-visit never descended into wrapper elements such as <ol>, <li> or <blockquote>, and the <pre> inside them was never passed to shiki. Only top-level fences were highlighted. Upstream fixed this in fumadocs-core 16.7.16, so bump fumadocs-core and fumadocs-ui to that version. The enums guide had been dedented in 3b2a8da to work around the bug. Restore the code blocks to their list items now that nesting renders correctly, keeping the explicit 1-4 numbering from that commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZmyJ26NCkhQgaa1xQbCEq
|
|
@unrevised6419 is attempting to deploy a commit to the Michael Hayes' projects Team on Vercel. A member of the Team first needs to authorize it. |
@pothos/core
@pothos/plugin-add-graphql
@pothos/plugin-complexity
@pothos/plugin-dataloader
@pothos/plugin-directives
@pothos/plugin-drizzle
@pothos/plugin-errors
@pothos/plugin-example
@pothos/plugin-federation
@pothos/plugin-grafast
@pothos/plugin-mocks
@pothos/plugin-prisma
@pothos/plugin-prisma-utils
@pothos/plugin-relay
@pothos/plugin-scope-auth
@pothos/plugin-simple-objects
@pothos/plugin-smart-subscriptions
@pothos/plugin-sub-graph
@pothos/plugin-tracing
@pothos/plugin-validation
@pothos/plugin-with-input
@pothos/plugin-zod
@pothos/tracing-newrelic
@pothos/tracing-opentelemetry
@pothos/tracing-sentry
@pothos/tracing-xray
commit: |
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.
Problem
Fenced code blocks nested inside a list item render as unhighlighted raw text on the docs site, while top-level fences highlight fine. Example: the two
typescriptblocks underwriting-plugins.mdx→global-types.ts.The rendered HTML for a nested block is
<code class="language-typescript">declare global {…}</code>— no shiki token spans.Cause
fumadocs-core@16.7.15(the pinned version), inrehypeShikiFromHighlighter:"skip"on a non-matching element stopsunist-util-visitfrom descending into its children, so the first<ol>,<ul>,<li>,<blockquote>or<td>hides its<pre>from the highlighter.Upstream fixed this in
9cf33e9b1by returningundefinedfor unmatched elements, first released infumadocs-core@16.7.16. 16.7.15 is the last broken release.Changes
fumadocs-coreandfumadocs-ui16.7.15→16.7.16.website/content/docs/guide/enums.mdxback under their list items. They were dedented in 3b2a8da to work around this bug; the explicit1.–4.numbering from that commit is kept.No source or plugin changes — website only.
Verification
Dev server on a clean
.next, rendered HTML inspected for<code class="language-*">(unhighlighted) versusclass="line"(shiki output):guide/enumsguide/writing-pluginsplugins/errorsBefore the bump,
writing-pluginsanderrorseach had 2 raw blocks. A full scan ofwebsite/contentfound only those 4 indented fences, so nothing else was affected.Upstream follow-up
Nothing guarded this behaviour in fumadocs after the fix landed, so a regression test is proposed upstream in fuma-nama/fumadocs#3525 (test-only).
🤖 Generated with Claude Code
https://claude.ai/code/session_019ZmyJ26NCkhQgaa1xQbCEq