fix: inline standalone <code> tag breaking fr/kr/jp/pt builds - #25828
Open
akashreddy-nr wants to merge 2 commits into
Open
akashreddy-nr wants to merge 2 commits into
akashreddy-nr wants to merge 2 commits into
Conversation
Same fix as #25827 (targeting main), now applied to develop. The translation bot reflowed inline <code>@claude fix</code> onto its own line with blank lines around it. In MDX v1 a blank line before a JSX tag inside a table cell makes remark parse it as block-level, so <code>'s children compile to a <p> node instead of a string — CodeBlock.js calls children.trim() which throws on a non-string child and crashes "Building static HTML" for that page. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Hi @akashreddy-nr 👋 Thanks for your pull request! Your PR is in a queue, and a writer will take a look soon. We generally publish small edits within one business day, and larger edits within three days. Please ensure the propsed changes look good by building it first in your local environment. Refer to this contribution guide to get the site up and running in your local. If you really require a preview url, reach out to one of the writers and they will generate one for you. |
Machine translation vendors split paragraphs around inline elements like <code> into three siblings: <p>before</p> <code/> <p>after</p>. The deserializer then emits blank lines around the <code>, making it block-level. CodeBlock's children.trim() throws on a non-string child (a <p> node) and crashes Gatsby's "Building static HTML" for that page. Root cause: after rehype2remark, the <td> (deserialized as a mdxJsxFlowElement) has children [paragraph, mdxJsxTextElement, paragraph] as siblings. remark-stringify treats the mdxJsxTextElement as flow-level and adds surrounding blank lines. Fix: add a mergeInlineJsxIntoParagraphs remark plugin that runs after rehype2remark and collapses any run of paragraphs/mdxJsxTextElements that are siblings into a single paragraph, preventing the blank-line output. Confirmed by reproduce test: serialize→vendor-split→deserialize now produces inline <code> without surrounding newlines. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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
Develop-side counterpart to #25827 (which targets
main).The translation bot reflowed inline
<code>@claude fix</code>onto its own line with blank lines around it in all four locale translations ofdocs/vulnerability-management/agent/overview.mdx. In MDX v1, a blank line before a JSX tag inside a table cell makes remark parse it as block-level —<code>'s children compile to a<p>node instead of a string, andCodeBlock.jscallschildren.trim()which throws on a non-string child, crashing "Building static HTML" for that page.Files changed (4):
src/i18n/content/fr/docs/vulnerability-management/agent/overview.mdxsrc/i18n/content/jp/docs/vulnerability-management/agent/overview.mdxsrc/i18n/content/kr/docs/vulnerability-management/agent/overview.mdxsrc/i18n/content/pt/docs/vulnerability-management/agent/overview.mdxFix
Inlined the
<code>tag back onto the same prose line where it belongs.🤖 Generated with Claude Code