Normalize standalone CustomContent indentation in JA output#26
Open
qiancai wants to merge 2 commits intopingcap:mainfrom
Open
Normalize standalone CustomContent indentation in JA output#26qiancai wants to merge 2 commits intopingcap:mainfrom
qiancai wants to merge 2 commits intopingcap:mainfrom
Conversation
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
This PR adds a small post-serialization normalization step for standalone
CustomContentlines in Japanese translation output.Root Cause
After PR #24, Japanese translation output could restore
CustomContentmarkers as standalone raw HTML lines inside list contexts. When those lines were serialized back to Markdown, they could end up with one or more extra leading spaces. Inwebsite-docs, that extra indentation was enough to break MDX list parsing and trigger build errors such as:Expected corresponding JSX closing tag for <CustomContent>The docs-side hotfix in pingcap/docs PR #22716 confirmed the immediate failure mode: changing those standalone
CustomContentlines from 5 or 6 leading spaces back to 4 fixed the build.What Changed
normalizeStandaloneCustomContentIndentation()to normalize standalone<CustomContent ...>/</CustomContent>lines after Markdown serialization.tidb-cloud/configure-external-storage-access.mdsystem-variables.mdCustomContent, fenced code examples, and already-correct nested indentation stay unchanged.Why This Is Small On Purpose
This PR does not change the translation semantics of
CustomContent, the placeholder flow for links, or the broader Markdown/MDX parsing model. It only normalizes the final serialized indentation for standaloneCustomContentlines, matching the docs-side hotfix while keeping the translator change narrowly scoped.Validation
Passed:
Also checked:
node --test markdown-translator/test/*.test.jsThe full suite still has existing failures in
GithubMentions.test.json the current upstream main branch. Those failures predate this PR and are unrelated to theCustomContentindentation change.