diff --git a/lib/check/validate.js b/lib/check/validate.js index a1b086d..71baa9e 100644 --- a/lib/check/validate.js +++ b/lib/check/validate.js @@ -127,6 +127,11 @@ function warn(ctx, reference) { let index = -1 while (++index < reference.nodes.length) { - reference.file.message(reason, reference.nodes[index], origin) + const message = reference.file.message( + reason, + reference.nodes[index], + origin + ) + message.url = 'https://github.com/remarkjs/remark-validate-links#readme' } } diff --git a/test/index.js b/test/index.js index 4169343..de50db3 100644 --- a/test/index.js +++ b/test/index.js @@ -41,6 +41,17 @@ test('remark-validate-links', async (t) => { ], 'should work on the API' ) + t.deepEqual( + vfile.messages.map((message) => message.url), + [ + 'https://github.com/remarkjs/remark-validate-links#readme', + 'https://github.com/remarkjs/remark-validate-links#readme', + 'https://github.com/remarkjs/remark-validate-links#readme', + 'https://github.com/remarkjs/remark-validate-links#readme', + 'https://github.com/remarkjs/remark-validate-links#readme' + ], + 'should add message urls' + ) const file = await remark() .use(links)