Skip to content

Reject embedded images in connector docs MDX lint#101

Merged
gontzess merged 1 commit into
mainfrom
gontzess/mdx-lint-ban-embedded-images
Jul 1, 2026
Merged

Reject embedded images in connector docs MDX lint#101
gontzess merged 1 commit into
mainfrom
gontzess/mdx-lint-ban-embedded-images

Conversation

@gontzess

@gontzess gontzess commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Why

Connector docs (docs/connector.mdx) are compiled to HTML by the registry's React MDX renderer. An embedded image makes React emit a <link rel="preload"> tag, and the registry's server-side HTML validator blocks link as a disallowed tag — so the docs-publish cron returns a 400 and wedges. It is also against team convention for connector docs to embed repo-local images. Rejecting embedded images at lint time catches this statically and fast, with no rendering.

What this changes

  • The shared MDX linter now rejects the markdown image (![alt](url)) and imageReference (![alt][ref]) mdast node types. The image node was previously only URL-checked alongside link/definition; it is now failed outright.
  • JSX <img> was already rejected (not in the allowed component/element sets), so this closes the remaining markdown-syntax gap.
  • Added test fixtures for both an embedded image and an image reference.

All 32 tests pass.

@gontzess
gontzess requested a review from a team July 1, 2026 15:27
@gontzess
gontzess merged commit e8c2e04 into main Jul 1, 2026
2 checks passed
@gontzess
gontzess deleted the gontzess/mdx-lint-ban-embedded-images branch July 1, 2026 17:15
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.

2 participants