Skip to content

fix: inline standalone <code> tag breaking fr/kr/jp/pt builds - #25828

Open
akashreddy-nr wants to merge 2 commits into
developfrom
fix/inline-code-tag-all-locales-develop
Open

akashreddy-nr wants to merge 2 commits into
developfrom
fix/inline-code-tag-all-locales-develop

Conversation

@akashreddy-nr

Copy link
Copy Markdown
Contributor

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 of docs/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, and CodeBlock.js calls children.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.mdx
  • src/i18n/content/jp/docs/vulnerability-management/agent/overview.mdx
  • src/i18n/content/kr/docs/vulnerability-management/agent/overview.mdx
  • src/i18n/content/pt/docs/vulnerability-management/agent/overview.mdx

Fix

Inlined the <code> tag back onto the same prose line where it belongs.

🤖 Generated with Claude Code

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>
@github-actions

Copy link
Copy Markdown
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>
@akashreddy-nr
akashreddy-nr requested a review from a team as a code owner September 23, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant