Skip to content

fix(s2-docs): fix YAML frontmatter syntax errors and improve validation#700

Merged
GarthDB merged 1 commit intomainfrom
fix/yaml-frontmatter-validation
Feb 12, 2026
Merged

fix(s2-docs): fix YAML frontmatter syntax errors and improve validation#700
GarthDB merged 1 commit intomainfrom
fix/yaml-frontmatter-validation

Conversation

@GarthDB
Copy link
Member

@GarthDB GarthDB commented Feb 12, 2026

Problem

After publishing docs/s2-docs to main, GitHub displays YAML frontmatter errors on 86 markdown files. The error shown is:

Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 10 column 22

The root cause was that our YAML validation was incomplete - it only checked for specific formatting issues but never actually parsed the YAML to verify it was syntactically valid.

Changes

1. Enhanced YAML Validation

  • Added js-yaml dependency to tools/s2-docs-transformer
  • Updated validation test to actually parse YAML using yaml.load()
  • This now catches YAML syntax errors before other formatting checks

2. Fixed YAML Frontmatter Issues

  • Improperly indented field names: Fields like related_components: and parent_category: were indented as if they were part of list items, causing syntax errors
  • Escaped underscores: Field names had \_ instead of _

3. Enhanced Fix Script

  • Added logic to detect and fix improperly indented field names
  • Improved escaped underscore detection to handle all cases

Files Fixed

  • 86 markdown files in docs/s2-docs/ with YAML frontmatter issues

Testing

  • All tests pass ✅
  • pnpm --filter @adobe/s2-docs-transformer test now validates actual YAML parsing
  • Verified action-group.md and other files now have valid YAML

Example Fix

Before:

tags:

- components-actions
  related\_components:
- action-button

After:

tags:

- components-actions
related_components:
- action-button

- Add js-yaml dependency to actually parse YAML and catch syntax errors
- Fix improperly indented field names (related_components, parent_category)
- Fix escaped underscores in field names
- Update validation to catch YAML parsing errors before other checks
- Fixed 86 markdown files with YAML frontmatter issues
@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2026

⚠️ No Changeset found

Latest commit: 191fccf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@GarthDB
Copy link
Member Author

GarthDB commented Feb 12, 2026

Run report for 191fccf4

Total time: 7.1ms | Comparison time: 0s | Estimated loss: 7.1ms (100.0% slower)

Action Time Status Info
🟩 SyncWorkspace 7ms Passed
Touched files
docs/s2-docs/components/actions/action-bar.md
docs/s2-docs/components/actions/action-button.md
docs/s2-docs/components/actions/action-group.md
docs/s2-docs/components/actions/button-group.md
docs/s2-docs/components/actions/button.md
docs/s2-docs/components/actions/close-button.md
docs/s2-docs/components/actions/link.md
docs/s2-docs/components/actions/list-view.md
docs/s2-docs/components/actions/menu.md
docs/s2-docs/components/containers/cards.md
docs/s2-docs/components/containers/divider.md
docs/s2-docs/components/containers/popover.md
docs/s2-docs/components/containers/standard-panel.md
docs/s2-docs/components/containers/table.md
docs/s2-docs/components/feedback/alert-banner.md
docs/s2-docs/components/feedback/alert-dialog.md
docs/s2-docs/components/feedback/coach-indicator.md
docs/s2-docs/components/feedback/coach-mark.md
docs/s2-docs/components/feedback/contextual-help.md
docs/s2-docs/components/feedback/illustrated-message.md
docs/s2-docs/components/feedback/in-line-alert.md
docs/s2-docs/components/feedback/standard-dialog.md
docs/s2-docs/components/feedback/takeover-dialog.md
docs/s2-docs/components/feedback/toast.md
docs/s2-docs/components/feedback/tooltip.md
docs/s2-docs/components/inputs/calendar.md
docs/s2-docs/components/inputs/checkbox-group.md
docs/s2-docs/components/inputs/checkbox.md
docs/s2-docs/components/inputs/color-area.md
docs/s2-docs/components/inputs/color-handle-and-loupe.md
docs/s2-docs/components/inputs/color-handle.md
docs/s2-docs/components/inputs/color-slider.md
docs/s2-docs/components/inputs/color-wheel.md
docs/s2-docs/components/inputs/combo-box.md
docs/s2-docs/components/inputs/date-picker.md
docs/s2-docs/components/inputs/drop-zone.md
docs/s2-docs/components/inputs/field-label.md
docs/s2-docs/components/inputs/help-text.md
docs/s2-docs/components/inputs/number-field.md
docs/s2-docs/components/inputs/picker.md
docs/s2-docs/components/inputs/radio-button.md
docs/s2-docs/components/inputs/radio-group.md
docs/s2-docs/components/inputs/rating.md
docs/s2-docs/components/inputs/search-field.md
docs/s2-docs/components/inputs/segmented-control.md
docs/s2-docs/components/inputs/select-box.md
docs/s2-docs/components/inputs/slider.md
docs/s2-docs/components/inputs/swatch-group.md
docs/s2-docs/components/inputs/swatch.md
docs/s2-docs/components/inputs/switch.md
docs/s2-docs/components/inputs/tag-field.md
docs/s2-docs/components/inputs/tag-group.md
docs/s2-docs/components/inputs/tag.md
docs/s2-docs/components/inputs/text-area.md
docs/s2-docs/components/inputs/text-field.md
docs/s2-docs/components/inputs/thumbnail.md
docs/s2-docs/components/navigation/accordion.md
docs/s2-docs/components/navigation/breadcrumbs.md
docs/s2-docs/components/navigation/side-navigation.md
docs/s2-docs/components/navigation/tabs.md
docs/s2-docs/components/navigation/tree-view.md
docs/s2-docs/components/status/avatar-group.md
docs/s2-docs/components/status/avatar.md
docs/s2-docs/components/status/badge.md
docs/s2-docs/components/status/meter.md
docs/s2-docs/components/status/progress-bar.md
docs/s2-docs/components/status/progress-circle.md
docs/s2-docs/components/status/status-light.md
docs/s2-docs/components/status/steplist.md
docs/s2-docs/designing/app-frame-content-area.md
docs/s2-docs/designing/app-frame-creating-bluelines.md
docs/s2-docs/designing/app-frame-header.md
docs/s2-docs/designing/app-frame-overview.md
docs/s2-docs/designing/app-frame-side-navigation.md
docs/s2-docs/designing/background-layers.md
docs/s2-docs/designing/colors.md
docs/s2-docs/designing/containers.md
docs/s2-docs/designing/grays.md
docs/s2-docs/designing/illustrations.md
docs/s2-docs/designing/object-styles.md
docs/s2-docs/designing/typography-fundamentals.md
docs/s2-docs/designing/using-icons.md
docs/s2-docs/developing/developer-overview.md
docs/s2-docs/fundamentals/introduction.md
docs/s2-docs/support/faqs.md
docs/s2-docs/support/resources.md
pnpm-lock.yaml
tools/s2-docs-transformer/package.json
tools/s2-docs-transformer/scripts/fix-yaml-frontmatter.js
tools/s2-docs-transformer/test/yaml-frontmatter.test.js

@GarthDB GarthDB merged commit 910ea21 into main Feb 12, 2026
4 checks passed
@GarthDB GarthDB deleted the fix/yaml-frontmatter-validation branch February 12, 2026 20:46
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