fix(website): support CRLF frontmatter - #1552
Open
Doar999 wants to merge 1 commit into
Open
Conversation
Normalize line endings before parsing homepage and benchmark frontmatter, and recognize existing CRLF frontmatter during content generation. Add regression coverage for both locales and preserve invalid-content errors. Refs oceanbase#1499.
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.
PR title
fix(website): support CRLF frontmatter
Which issue or RFC does this PR close?
Closes #1499.
Rationale for this change
Windows checkouts with
core.autocrlf=trueproduce valid CRLF Markdown that the homepage and benchmark loaders reject as missing frontmatter. The loaders assume LF when checking the opening delimiter and slicing the YAML. The content generation script also mistakes existing CRLF frontmatter for an absent header and can prepend a second header.What changes are included in this PR?
tsxdependency and Node test runner.Are there any user-facing changes?
Homepages and benchmark pages load from CRLF checkouts, and content generation preserves existing CRLF frontmatter. This is a compatibility fix with no new API, configuration, dependencies, or persisted-format changes. Source Markdown files are not rewritten.
How was this change tested?
Validation was performed on Windows against commit
60044739, based on upstream393c08b5.pnpm --dir website testpassed all six tests.pnpm --dir website lintpassed.website/, a focused TypeScript check passed:node node_modules/typescript/bin/tsc --ignoreConfig --noEmit --strict --skipLibCheck --esModuleInterop --module esnext --moduleResolution bundler --target ES2022 --types node tests/content.test.ts.next buildcompleted, including its full TypeScript check and generation of 699 static pages. Both localized homepages and benchmark pages were exported.scripts/redirect-docs.tsfollowed byscripts/verify-static-export.tsthroughtsxpassed verification of 779 public pages and their internal links.git diff --checkanduv lock --checkpassed.ty-checkhook described below.Validation limitations:
pnpm --dir website buildfailed at the source-link validation gate with 704 errors across 164 files. An independent minimal fixture reproduced the Windows scanner defect described in bug(windows): documentation link checks report existing routes as missing #1500:(group)/api/page.tsxwas indexed as/(group)/apiinstead of/api. The successful separate Next build and export verification do not constitute a passing full build command.ty-checkhook reported seven Windows-specific diagnostics in unchangedartifact_processing.pyandtest_artifact_processing.pyfiles, involvingPipeConnectionversusConnectionandos.WNOHANG. This PR does not modify those files.AI usage statement
OpenAI Codex(GPT-6)assisted with issue and branch inspection, reproduction, implementation, regression tests, and validation. Maintainer review is still required.