Skip to content

fix(website): support CRLF frontmatter - #1552

Open
Doar999 wants to merge 1 commit into
oceanbase:masterfrom
Doar999:codex/fix-frontmatter-crlf
Open

fix(website): support CRLF frontmatter#1552
Doar999 wants to merge 1 commit into
oceanbase:masterfrom
Doar999:codex/fix-frontmatter-crlf

Conversation

@Doar999

@Doar999 Doar999 commented Sep 10, 2026

Copy link
Copy Markdown

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=true produce 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?

  • Normalize CRLF to LF in memory before locating and parsing homepage and benchmark frontmatter.
  • Recognize both LF and CRLF opening delimiters when preparing RFC and development documents, preserving documents that already have frontmatter.
  • Add six regression tests covering English and Chinese homepage and benchmark content, equivalent LF/CRLF/mixed line endings, and errors for absent frontmatter, an absent closing delimiter, malformed YAML, and missing page content.
  • Run the website tests as part of the existing build command, using the existing tsx dependency 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 upstream 393c08b5.

  • Before the fix, all six regression tests failed; after the fix, pnpm --dir website test passed all six tests.
  • pnpm --dir website lint passed.
  • From 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.
  • The content generation stage completed. Four existing CRLF-frontmatter documents across English/Chinese RFC and development content were preserved unchanged in the generated output.
  • A separate next build completed, including its full TypeScript check and generation of 699 static pages. Both localized homepages and benchmark pages were exported.
  • Running scripts/redirect-docs.ts followed by scripts/verify-static-export.ts through tsx passed verification of 779 public pages and their internal links.
  • git diff --check and uv lock --check passed.
  • Pre-commit checks for the five changed files passed except for the repository-wide ty-check hook described below.

Validation limitations:

  • pnpm --dir website build failed 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.tsx was indexed as /(group)/api instead of /api. The successful separate Next build and export verification do not constitute a passing full build command.
  • The repository-wide Python ty-check hook reported seven Windows-specific diagnostics in unchanged artifact_processing.py and test_artifact_processing.py files, involving PipeConnection versus Connection and os.WNOHANG. This PR does not modify those files.
  • The Python unit/e2e suites, OpenAPI contract tests, and tox matrix were not run for this website-only change.

AI usage statement

OpenAI Codex(GPT-6)assisted with issue and branch inspection, reproduction, implementation, regression tests, and validation. Maintainer review is still required.

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.
@CLAassistant

CLAassistant commented Sep 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

bug(windows): website homepage rejects CRLF frontmatter

2 participants