From acdfb8fd3c831954525407e6002ee75a5a9bf60a Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Sun, 19 Dec 2021 18:36:01 +0100 Subject: [PATCH] Add message `url` Closes GH-117. Reviewed-by: Titus Wormer --- lib/factory.js | 4 +++- test.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/factory.js b/lib/factory.js index 701eb4b..d008c6b 100644 --- a/lib/factory.js +++ b/lib/factory.js @@ -29,6 +29,8 @@ import {convert} from 'unist-util-is' const own = {}.hasOwnProperty +const url = 'https://github.com/retextjs/retext-equality#readme' + const word = convert('WordNode') const whiteSpace = convert('WhiteSpaceNode') const punctuation = convert('PunctuationNode') @@ -256,7 +258,7 @@ export function factory(patterns, lang) { match.nodes[0], [source, pattern.id].join(':') ), - {actual, expected, note: pattern.note} + {actual, expected, note: pattern.note, url} ) } } diff --git a/test.js b/test.js index 4b363f9..0ec70c9 100644 --- a/test.js +++ b/test.js @@ -39,7 +39,8 @@ test('retext-equality', (t) => { 'person with a disability', 'people with disabilities' ], - note: 'Assumes/implies that a person with a disability is deficient or inferior to others. When possible, specify the functional ability or its restriction. (source: https://ncdj.org/style-guide/)' + note: 'Assumes/implies that a person with a disability is deficient or inferior to others. When possible, specify the functional ability or its restriction. (source: https://ncdj.org/style-guide/)', + url: 'https://github.com/retextjs/retext-equality#readme' }, 'should emit a message' )