Skip to content

Commit fed845e

Browse files
authored
Statement stability: allow both document and specification wordings (#1956)
1 parent ee81584 commit fed845e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/rules/sotd/stability.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async function findSW(candidates, sr) {
1919
wanted = `(${sr.config.longStatus}s are not endorsed by W3C nor its Members|This ${sr.config.longStatus} is endorsed by the ${groups}, but is not endorsed by W3C itself nor its Members).`;
2020
} else if (sr.config.longStatus === 'Statement') {
2121
wanted =
22-
'A W3C Statement is a specification that, after extensive consensus-building, is endorsed by W3C and its Members.';
22+
'A W3C Statement is a (specification|document) that, after extensive consensus-building, is endorsed by W3C and its Members.';
2323
} else if (sr.config.longStatus === 'Discontinued Draft') {
2424
wanted =
2525
'Publication as a Discontinued Draft implies that this document is no longer intended to advance or to be maintained. It is inappropriate to cite this document as other than abandoned work.';
@@ -58,16 +58,18 @@ async function findSW(candidates, sr) {
5858
}${cryType ? CRY_INTRO : ''}`;
5959
}
6060

61+
const wantedRE = new RegExp(wanted);
62+
6163
// TODO: better some
6264
Array.prototype.some.call(candidates, p => {
6365
const text = sr.norm(p.textContent);
64-
if (text.match(wanted)) {
66+
if (text.match(wantedRE)) {
6567
sw = p;
6668
return true;
6769
}
6870
return false;
6971
});
70-
return { sw, expected: wanted };
72+
return { sw, expected: wantedRE };
7173
}
7274

7375
const self = {

0 commit comments

Comments
 (0)