Repository navigation
Remove the stray spaces line breaks put into the Chinese copy - #39
Merged
Merged
Conversation
JSX trims each line of a text block and joins the lines with one space. The
Chinese copy is wrapped across lines all over the course, so it rendered with
spaces between Chinese characters and after full-width punctuation: 1434 of
them on the fifteen Chinese pages ("算。 建议", "一章一个结构, 看见它").
- 1910 line breaks inside JSX text are joined where the site's convention has
no space: between Han characters, after full-width punctuation or a Chinese
ellipsis, before full-width punctuation, before "(" or a curly quote after
Han, after half-width , : ; ? ! before Han, and after the ")" of a Chinese
parenthetical. Breaks next to Latin letters, digits, expressions such as
O(1), "——" and math operators keep their space, as the convention asks
("第 3 章", "O(1) 随机访问").
- 37 spaces written after full-width punctuation are removed: a leading
space inside a bold label after a full stop ("。<b> 暴力:</b>"), one
{" "}, and spaces after "……". Three spaces around bold terms in the graph
chapter are removed to match the rest of the course.
- Only whitespace changes, apart from the one {" "}: every edited file is
identical to the original with whitespace stripped.
The fifteen Chinese pages now show 7 such spaces, all intended (around
formulas such as "地址 = 首地址", mapping arrows, a step label and the atlas
title). test/unit/zh-copy-spacing.test.ts scans every TSX file with the same
rules and fails on a new stray break or space; it fails on the previous
tree. CLAUDE.md states the rule under the language convention.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 9, 2026
This branch was successfully deployed
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
A defect found during the audit, outside its numbered findings.
JSX trims each line of a text block and joins the lines with one space. The Chinese copy is wrapped across source lines throughout the course, so it rendered with spaces between Chinese characters and after full-width punctuation. There were 1434 such spaces on the 15 Chinese pages, for example "算。 建议", "一章一个结构, 看见它" and "个、大小一致、 从 0 开始".
Changes
The site's convention keeps a space between Chinese and Latin letters, digits or expressions ("第 3 章", "O(1) 随机访问"), around "——" and around math operators, and nowhere else. The changes follow that rule.
1910 line breaks joined. A script that walks the TypeScript syntax tree touches only JSX text and JSX attribute strings, never code snippets or comments. It joins a line break when it sits:
, : ; ? !before Han;Breaks next to Latin letters, digits, expressions, "——" or operators keep their space.
37 spaces written after full-width punctuation removed. These are:
。<b> 暴力:</b>);{" "};The English branches need those spaces and are untouched; the rule only fires with Chinese on both sides.
3 spaces around bold terms in the graph chapter, to match the rest of the course (
只对<b>有向无环图</b>成立).Whitespace only. Apart from that one
{" "}, the diff changes nothing but whitespace: every edited file equals the original with whitespace stripped.A regression test.
test/unit/zh-copy-spacing.test.tsscans every TSX file with the same rules and fails on a new stray break or space. It fails onmain.CLAUDE.md states the rule under the language convention.
Result
The 15 Chinese pages, with every problem expanded, now show 7 such spaces. All 7 are intended:
Test plan
main: identical except one removed{" "}.mainand on this branch.test/unit/zh-copy-spacing.test.tspasses here and fails onmain.npm run typecheck,npm test(104 passed),npm run build,npx playwright test(55 passed).🤖 Generated with Claude Code