Skip to content

fix(ci): add MDX safety check for non-self-closing img tags#620

Merged
mchmarny merged 4 commits into
NVIDIA:mainfrom
pdmack:pdmack/fern-ci-fix4
Apr 20, 2026
Merged

fix(ci): add MDX safety check for non-self-closing img tags#620
mchmarny merged 4 commits into
NVIDIA:mainfrom
pdmack:pdmack/fern-ci-fix4

Conversation

@pdmack
Copy link
Copy Markdown
Contributor

@pdmack pdmack commented Apr 20, 2026

Summary

Add a grep-based MDX safety step to fern-docs-ci.yaml that catches non-self-closing <img> tags before merge.

Motivation / Context

Fixes: #619
Related: N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Build/CI/tooling

Component(s) Affected

  • Docs/examples (docs/, examples/)

Implementation Notes

fern check validates Fern configuration only — it does not parse MDX content. Non-self-closing <img> tags (e.g. <img src="foo.png">) pass fern check but cause fern generate to fail with Unexpected closing tag </p>. The new step greps for this pattern and fails the job with an actionable error message before merge.

Root-caused from a live failure in NVIDIA/topograph#281.

Testing

Step runs on all PRs touching docs/** or fern/**. No existing docs files contain non-self-closing <img> tags.

Risk Assessment

  • Low — Isolated change, well-tested, easy to revert

Rollout notes: N/A

Checklist

  • I did not skip/disable tests to make CI green
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S)

@pdmack pdmack requested a review from a team as a code owner April 20, 2026 17:07
@coderabbitai

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

mchmarny
mchmarny previously approved these changes Apr 20, 2026
coderabbitai[bot]

This comment was marked as resolved.

@pdmack pdmack requested a review from mchmarny April 20, 2026 19:05
pdmack added a commit to pdmack/topograph that referenced this pull request Apr 20, 2026
Extend the grep to cover fern/ and *.mdx in addition to docs/*.md.
Add comments explaining the inline and single-line choices.

Matches the pattern settled on in NVIDIA/NVSentinel#1215 and NVIDIA/aicr#620.

Signed-off-by: Pete MacKinnon <pmackinnon@nvidia.com>
pdmack added a commit to pdmack/topograph that referenced this pull request Apr 20, 2026
Extend the grep to cover fern/ and *.mdx in addition to docs/*.md.
Add comments explaining the inline and single-line choices.

Matches the pattern settled on in NVIDIA/NVSentinel#1215 and NVIDIA/aicr#620.

Signed-off-by: Pete MacKinnon <pmackinnon@nvidia.com>
dmitsh pushed a commit to NVIDIA/topograph that referenced this pull request Apr 20, 2026
Extend the grep to cover fern/ and *.mdx in addition to docs/*.md.
Add comments explaining the inline and single-line choices.

Matches the pattern settled on in NVIDIA/NVSentinel#1215 and NVIDIA/aicr#620.

Signed-off-by: Pete MacKinnon <pmackinnon@nvidia.com>
@mchmarny mchmarny enabled auto-merge (squash) April 20, 2026 19:54
@mchmarny mchmarny merged commit 0a78409 into NVIDIA:main Apr 20, 2026
24 checks passed
@pdmack pdmack deleted the pdmack/fern-ci-fix4 branch May 10, 2026 17:08
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.

[Bug]: fern-docs-ci missing MDX safety check for non-self-closing img tags

2 participants