Skip to content

html: drift guard between css_props.go Values strings and the doc generator's glossary #278

@carlos7ags

Description

@carlos7ags

Background

PR #273 added a Value-form glossary to `docs/CSS_SUPPORT.md` that defines the angle-bracket placeholders (``, ``, ``, etc.) used in per-property tables.

The glossary is hardcoded in `RenderCSSPropertiesMarkdown` (`html/css_props_doc.go`). The placeholders consumed in per-property tables come from each entry's `Values []string` field in `cssProperties` (`html/css_props.go`).

Nothing currently forces the two to stay in sync. A contributor adding a new property whose Values reference a placeholder not in the glossary (e.g. ``, ``) would silently produce a doc that uses an undefined placeholder.

Suggested fix

A unit test that:

  1. Walks every `cssProperties` entry and extracts every `<...>` token from each `Values` string.
  2. Walks the glossary section of `RenderCSSPropertiesMarkdown` output and extracts the defined placeholders.
  3. Asserts every placeholder used in `Values` is either defined in the glossary OR is a self-explanatory shorthand component (e.g. `` mapping 1:1 onto a sibling property name).

Could also accept an explicit allowlist of "obvious" placeholders to keep the test small.

Scope

Defensive. Surfaced during review of PR #273. Not blocking that PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions