Skip to content

fix(plugin-dev): limit frontmatter parsing - #84004

Open
RerankerGuo wants to merge 1 commit into
anthropics:mainfrom
RerankerGuo:fix/parse-frontmatter-boundaries
Open

fix(plugin-dev): limit frontmatter parsing#84004
RerankerGuo wants to merge 1 commit into
anthropics:mainfrom
RerankerGuo:fix/parse-frontmatter-boundaries

Conversation

@RerankerGuo

Copy link
Copy Markdown

Summary

  • parse only the opening YAML frontmatter block
  • reject files without an opening or closing frontmatter marker

Problem

The range-based sed expression restarts at every later --- line. If a settings file's Markdown body contains horizontal rules, text between those rules is appended to FRONTMATTER. A body line such as enabled: false can then produce a second value for a field that is already defined in the actual frontmatter.

Verification

Using a settings fixture with enabled: true in the opening frontmatter and enabled: false between two body horizontal rules:

  • before: querying enabled prints both true and false
  • after: querying enabled prints only true
  • files missing either opening or closing --- return 1 with No frontmatter found
  • bash -n plugins/plugin-dev/skills/plugin-settings/scripts/parse-frontmatter.sh
  • git diff --check

Scope

This preserves the existing simple key: value field parsing. It only corrects which section of the file is treated as frontmatter.

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.

1 participant