Skip to content

fix(docs/ci): self-close img tags and add MDX safety check to CI#282

Merged
dmitsh merged 1 commit into
NVIDIA:mainfrom
pdmack:fix/mdx-img-self-closing
Apr 20, 2026
Merged

fix(docs/ci): self-close img tags and add MDX safety check to CI#282
dmitsh merged 1 commit into
NVIDIA:mainfrom
pdmack:fix/mdx-img-self-closing

Conversation

@pdmack

@pdmack pdmack commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Description

docs/architecture.md:11 had a non-self-closing <img> tag, causing an MDX parse error at fern generate time. fern check does not validate MDX content so this slipped through CI.

Two-part fix:

  • Self-close the <img> tag in architecture.md
  • Add a Check MDX safety step to fern-docs-ci.yml that greps for non-self-closing <img> tags and fails CI before merge — so this class of error can't recur undetected

Fixes #281

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.
  • All commits are signed off per DCO (git commit -s).

docs/architecture.md:11 had a non-self-closing <img> tag, causing a
parse error in fern generate. fern check does not catch MDX content
errors, so add an explicit grep step to fern-docs-ci.yml that fails
CI on any non-self-closing <img> tag in docs/.

Fixes NVIDIA#281

Signed-off-by: Pete MacKinnon <[email protected]>
@pdmack pdmack requested a review from dmitsh as a code owner April 20, 2026 16:47
@copy-pr-bot

copy-pr-bot Bot commented Apr 20, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@greptile-apps

greptile-apps Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a non-self-closing <img> tag in docs/architecture.md that caused an MDX parse error during fern generate, and adds a CI guard step to catch this class of issue before merge. The approach follows the existing shell-check pattern already present in the workflow.

Confidence Score: 5/5

Safe to merge; the doc fix is correct and the only finding is a minor P2 false-positive risk in the CI grep.

Both changes are small and correct. The single P2 comment about grep matching inside code blocks is speculative (no current docs trigger it) and does not affect correctness of the primary fix.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/fern-docs-ci.yml Adds a "Check MDX safety" CI step using grep to detect non-self-closing img tags; minor false-positive risk from code blocks and limited to .md (not .mdx) files.
docs/architecture.md Converts the bare img tag on line 11 to a self-closing form (/>), resolving the MDX parse error.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Push to docs/** or fern/**] --> B[Check markdown filename conventions]
    B --> C[Setup Node.js + Install Fern CLI]
    C --> D{Check MDX safety\ngrep non-self-closing img tags}
    D -- found --> E[❌ CI fails with error annotation]
    D -- clean --> F[fern check]
    F --> G[Check links - lychee offline]
    G --> H[✅ CI passes]
Loading

Reviews (1): Last reviewed commit: "fix(docs/ci): self-close img tags and ad..." | Re-trigger Greptile

@dmitsh dmitsh merged commit eae94e0 into NVIDIA:main Apr 20, 2026
1 check passed

- name: Check MDX safety
run: |
BAD=$(grep -rn '<img\b[^>]*[^/]>' docs/ --include="*.md" || true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Grep will match inside fenced code blocks

The raw grep approach doesn't distinguish between live MDX content and examples inside backtick fences or <code> blocks. A doc that demonstrates the wrong pattern (e.g., `<img src="x">`) would cause a spurious CI failure. Excluding code-fence lines with a two-step pipe keeps the check accurate:

Suggested change
BAD=$(grep -rn '<img\b[^>]*[^/]>' docs/ --include="*.md" || true)
BAD=$(grep -rn '<img\b[^>]*[^/]>' docs/ --include="*.md" | grep -v '^\s*```\|^\s*`' || true)

Also worth noting: the --include="*.md" glob would miss any .mdx files added in the future; consider adding --include="*.mdx" as well.

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.

[BUG]: non-self-closing <img> tags in docs cause MDX parse errors

2 participants