Skip to content

[repo-assist] Fix front-matter parsing truncating values containing colons - #1275

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/fix-frontmatter-colon-parsing-8675d58a68a34d11
Draft

[repo-assist] Fix front-matter parsing truncating values containing colons#1275
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/fix-frontmatter-colon-parsing-8675d58a68a34d11

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary (Task 5 — Coding Improvement)

FrontMatterFile.ParseFromLines in src/FSharp.Formatting.Common/Templating.fs parses YAML-like front matter (category, categoryindex, index) by splitting each line on : and keeping only the first two segments. Any additional : characters in a value were silently discarded — e.g. a title: field containing a colon (title: F#: An Introduction) would be captured as just "F#".

While title isn't currently consumed by this parser, the same bug would silently corrupt any future or custom front-matter field containing a colon, and this exact fix was previously implemented (and reviewed positively) in a since-closed PR (#1105) whose other, unrelated changes (nested navigation categories) ran into merge conflicts. This PR extracts just the safe, isolated colon-parsing fix plus regression tests, so it doesn't get lost.

Change

  • FrontMatterFile.ParseFromLines: instead of first :: second :: _ -> Some(first, second), now joins all parts after the first : with String.Join(":", rest), preserving the full value.
  • Added two unit tests in tests/FSharp.Literate.Tests/DocContentTests.fs:
    • Regression test confirming colons in values are preserved.
    • Confirms None is still returned when required fields (category/categoryindex/index) are missing.
  • Added a RELEASE_NOTES.md entry under [Unreleased] / Fixed.

Test Status

  • dotnet build FSharp.Formatting.sln --configuration Release — Build succeeded, 0 warnings, 0 errors.
  • dotnet test tests/FSharp.Literate.Tests/FSharp.Literate.Tests.fsproj --configuration Release --no-build — all 145 tests passed (2 new).
  • ✅ Formatted with dotnet fantomas.

Trade-offs

  • Minimal, surgical change limited to the parsing helper and its tests; no behavior change for existing well-formed front matter without colons in values.

Generated by Repo Assist

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@ae8d551f07c7ed7619f8c58c7bb4c3ac89395d38

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants