diff --git a/tools/mdx-lint/mdx-lint.mjs b/tools/mdx-lint/mdx-lint.mjs index 659a548..0505904 100644 --- a/tools/mdx-lint/mdx-lint.mjs +++ b/tools/mdx-lint/mdx-lint.mjs @@ -175,8 +175,12 @@ function validateTree(tree) { case "html": fail(node, "contains raw HTML"); break; - case "link": + // Embedded images make the registry's MDX renderer emit a , which its HTML validator rejects. case "image": + case "imageReference": + fail(node, "contains an embedded image; connector docs must not embed images"); + break; + case "link": case "definition": validateUrlNode(node); break; diff --git a/tools/mdx-lint/testdata/shared-mdx-validation.json b/tools/mdx-lint/testdata/shared-mdx-validation.json index 1651673..fb8626d 100644 --- a/tools/mdx-lint/testdata/shared-mdx-validation.json +++ b/tools/mdx-lint/testdata/shared-mdx-validation.json @@ -96,5 +96,17 @@ "valid": false, "errorContains": "dangerous URL scheme", "content": "[link](javascript:alert(1))\n" + }, + { + "name": "reject markdown embedded image", + "valid": false, + "errorContains": "must not embed images", + "content": "![diagram](./images/diagram.png)\n" + }, + { + "name": "reject markdown image reference", + "valid": false, + "errorContains": "must not embed images", + "content": "![diagram][ref]\n\n[ref]: ./images/diagram.png\n" } ]