fix(lint): resolve all 10 YAML blocking errors; support multi-doc YAML streams#7160
Merged
jstirnaman merged 7 commits intomasterfrom May 1, 2026
Merged
fix(lint): resolve all 10 YAML blocking errors; support multi-doc YAML streams#7160jstirnaman merged 7 commits intomasterfrom
jstirnaman merged 7 commits intomasterfrom
Conversation
…eams
Validator change:
scripts/lib/codeblock-validators/yaml.mjs — switch yaml.load to
yaml.loadAll so YAML streams (multiple documents separated by ---)
parse cleanly. Kubernetes manifests, InfluxDB template manifests,
and similar tools commonly emit multi-doc streams; rejecting them
forced authors to relabel the fence and lose syntax highlighting.
Content fixes (yaml fence preserved):
content/influxdb3/clustered/reference/release-notes/clustered.md
- Line 148 fence relabeled yaml → diff (the block is a literal
diff with + prefixes, not yaml).
- Line 823 (now 823): replaced bare `...` ellipsis with
`# ... fields elided ...` comment so indentation stays valid.
- Line 1747 (now ~1747): replaced bare `....` and inner `...`
ellipses with structured `# ... fields elided ...` comments.
content/influxdb3/enterprise/admin/clustering.md
- Three node-config blocks (Small / Medium / Large cluster) had
`mode:` defined per node, producing "duplicated mapping key"
errors because each block was one YAML document. Added `---`
between node configs so each becomes its own document in the
stream — matches author intent (per-node configs side by side)
and parses cleanly.
content/kapacitor/v1/reference/event_handlers/alerta.md
- Genuine YAML bug: `correlate: 'event1', 'event2'` is invalid
syntax, and the very next `correlate:` line was a duplicate
key. Fixed to `correlate: ['event1', 'event2']` and removed
the duplicate line that incorrectly assigned service names to
the correlate key.
Test coverage: 59/59 lint-codeblocks tests still pass; multi-doc
support is exercised implicitly by the now-passing real content.
Contributor
Vale Style Check Results
Warnings (9)
✅ Check passed |
Contributor
|
3 tasks
… comments Per review feedback on #7160, the legacy admin-section example block contained `- ...` and bare `...` lines used as ellipsis. While the current YAML parser accepts them (they parse as the string '...'), they are misleading: a copy-paste of the example would be invalid as actual config. Replaced with explicit YAML comments that name what was elided. Also normalized the leading comment from `## ...snip` to a properly descriptive YAML comment for consistency.
Contributor
Author
|
Merging this to fix the YAML. I'll continue working on diff syntax highlighting in #7178 |
jstirnaman
added a commit
that referenced
this pull request
May 1, 2026
…ontent (#7178) * fix(lint): resolve all 10 YAML blocking errors; support multi-doc streams Validator change: scripts/lib/codeblock-validators/yaml.mjs — switch yaml.load to yaml.loadAll so YAML streams (multiple documents separated by ---) parse cleanly. Kubernetes manifests, InfluxDB template manifests, and similar tools commonly emit multi-doc streams; rejecting them forced authors to relabel the fence and lose syntax highlighting. Content fixes (yaml fence preserved): content/influxdb3/clustered/reference/release-notes/clustered.md - Line 148 fence relabeled yaml → diff (the block is a literal diff with + prefixes, not yaml). - Line 823 (now 823): replaced bare `...` ellipsis with `# ... fields elided ...` comment so indentation stays valid. - Line 1747 (now ~1747): replaced bare `....` and inner `...` ellipses with structured `# ... fields elided ...` comments. content/influxdb3/enterprise/admin/clustering.md - Three node-config blocks (Small / Medium / Large cluster) had `mode:` defined per node, producing "duplicated mapping key" errors because each block was one YAML document. Added `---` between node configs so each becomes its own document in the stream — matches author intent (per-node configs side by side) and parses cleanly. content/kapacitor/v1/reference/event_handlers/alerta.md - Genuine YAML bug: `correlate: 'event1', 'event2'` is invalid syntax, and the very next `correlate:` line was a duplicate key. Fixed to `correlate: ['event1', 'event2']` and removed the duplicate line that incorrectly assigned service names to the correlate key. Test coverage: 59/59 lint-codeblocks tests still pass; multi-doc support is exercised implicitly by the now-passing real content. * fix(clustered/release-notes): replace bare ellipsis placeholders with comments Per review feedback on #7160, the legacy admin-section example block contained `- ...` and bare `...` lines used as ellipsis. While the current YAML parser accepts them (they parse as the string '...'), they are misleading: a copy-paste of the example would be invalid as actual config. Replaced with explicit YAML comments that name what was elided. Also normalized the leading comment from `## ...snip` to a properly descriptive YAML comment for consistency. * fix(syntax-highlighting): extend diff highlight to overflowing line content The .gi (and .gd) classes used `display: block`, which sizes the highlighted span to the parent's visible width. When a diff line horizontally overflows the code-block container, the text continues to the right of the visible area but the green/red background does not — the right-hand portion of the line renders without any highlight, which is what the user reported on a clustered release-notes diff fence. Switch to `display: inline-block` + `min-width: 100%`. inline-block lets the element grow with content (so it covers the full overflow width); min-width: 100% keeps the highlight at least as wide as the visible container for short lines. The combined behavior is the standard pattern for line-level diff highlights in pre/code blocks. * fix(syntax-highlighting): stack diff lines and align highlight colors with palette The previous `display: inline-block` on `.gi`/`.gd` swallowed the trailing newline inside each chroma diff-line span, collapsing every diff line onto a single inline row. Switch to `display: block` + `width: max-content` + `min-width: 100%`: block restores per-line stacking, max-content lets the highlight grow with content past the visible area, and min-width keeps short lines tinted to the right edge. Replace the hard-coded green/red with palette variables ($gr-rainforest/$gr-viridian, $r-curacao/$r-ruby) and lower the tint opacity for better readability against the article background. * test(diff-fence): add render-regression fixtures and assertions Add four diff fence fixtures to content/example.md (subtractive only, subtractive with overflow, subtractive with context, mixed additions and deletions) and matching Cypress assertions in render-regression.cy.js. Tests guard against the regression fixed in the prior commit: - per-row stacking (sibling .gd spans must have distinct top offsets) - display: block on .gd/.gi - width: max-content (.gd offsetWidth exceeds parent clientWidth on overflowing lines) - context lines remain untinted Also extend assertHasHighlightedCodeBlock's selector to include language-diff so the existing /example/ smoke test covers the new fixtures. * fix: resolve code review findings for PR #7178 - Apply Prettier formatting to multi-line .toArray() chain in render-regression.cy.js (was unstaged)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all 10 YAML blocking errors flagged by `yarn lint-codeblocks` against `content/`. Keeps the `yaml` fence label everywhere it makes sense.
Validator change
Content fixes (yaml fence preserved unless the block is genuinely not yaml)
Verification
Test plan