diff --git a/lib/rules.json b/lib/rules.json index eb53dc69c..3c1b64dcf 100644 --- a/lib/rules.json +++ b/lib/rules.json @@ -1400,7 +1400,7 @@ "docIDDate": "The title page date and the date at the end of the \"This Version\" URI must match.", "docIDLatestVersion": "The syntax of a “latest version” URI must be https://www.w3.org/TR/shortname/.", "docIDHistory": "The syntax of a “history” URI must be https://www.w3.org/standards/history/shortname/, and consistent with the shortname mentioned in 'Latest Version'. Note: If there's a shortname change it must be specified using the following data attribute data-previous-shortname='previous-shortname' on the <a> element.", - "editorSection": "The editors'/authors' names must be listed, with attribute data-editor-id=\"@@\". Affiliations and email addresses are optional; email addresses are not recommended. The affiliation of Invited Experts must always be \"W3C Invited Expert\" whether they are affiliated with another organization or not. If an editor/author is acknowledged in an earlier version of this document and the individual's affiliation has since changed, list the individual using the notation \"<name>, <affiliation> (until DD Month YYYY)\". If the list of authors is very long (e.g., the entire Working Group), identify the authors in the acknowledgments section, linked from the head of the document. Distinguish any contributors from authors in the acknowledgments section.
Note: Editors must be participating in the group producing the document at the time of its publication.", + "editorSection": "The editors'/authors' names must be listed, with attribute data-editor-id=\"@@\". Affiliations and email addresses are optional; email addresses are not recommended. The affiliation of Invited Experts must always be \"W3C Invited Expert\" whether they are affiliated with another organization or not. If an editor/author is acknowledged in an earlier version of this document and the individual's affiliation has since changed, list the individual using the notation \"<name>, <affiliation> (until DD Month YYYY)\". If the list of authors is very long (e.g., the entire Working Group), identify the authors in the acknowledgments section, linked from the head of the document. Distinguish any contributors from authors in the acknowledgments section.
Note: Editors must be participating in the group producing the document at the time of its publication. If an editor left the group before publication, they can still be listed but the rationale must be provided in a <span class=\"former\"> element next to the name of the editor.", "altRepresentations": "Authors may provide links to alternative (non-normative) representations or packages for the document. For instance:

<p>This document is also available in these non-normative formats: <a href=\"@{param1}-shortname-20180101.html\">single HTML file</a>, <a href=\"@{param1}-shortname-20180101.tgz\">gzipped tar file of HTML</a>.</p>

", "implReport": "It must include either: ", "translation": "There must be a link to a translations page. The recommended markup is:

<p>See also <a href=\"https://www.w3.org/Translations/?technology=shortname\"><strong>translations</strong></a>.</p>

See suggestions on translations in the manual of style.

", diff --git a/lib/rules/headers/editor-participation.js b/lib/rules/headers/editor-participation.js index dda4d3c2b..9b15c7f64 100644 --- a/lib/rules/headers/editor-participation.js +++ b/lib/rules/headers/editor-participation.js @@ -9,7 +9,17 @@ export const name = self.name; export async function check(sr, done) { const groups = await sr.getDelivererIDs(); - const editors = await sr.getEditorIDs(); + const editors = sr.extractHeaders()?.Editor; + const editorsToCheck = []; + if (editors) { + // only check editors elements that don't have a span with class "former" + editors.dd.forEach(dd => { + const former = dd.querySelector('span.former'); + if (!former || !sr.norm(former.textContent)) { + editorsToCheck.push(parseInt(dd.dataset.editorId, 10)); + } + }); + } const groupUsersPromises = []; groups.forEach(id => { @@ -27,7 +37,7 @@ export async function check(sr, done) { const userIds = (await Promise.all(groupUsersPromises)).flat(); - editors.forEach(id => { + editorsToCheck.forEach(id => { if (!userIds.includes(id)) { sr.error(self, 'not-participating', { id }); } diff --git a/test/data/TR/TRBase.js b/test/data/TR/TRBase.js index 1ad15122a..8ee394e9d 100644 --- a/test/data/TR/TRBase.js +++ b/test/data/TR/TRBase.js @@ -40,6 +40,14 @@ export const rules = { data: 'noEditorParticipation', errors: ['headers.editor-participation.not-participating'], }, + { + data: 'formerEditorParticipation', + errors: [], + }, + { + data: 'formerEditorParticipationNoRationale', + errors: ['headers.editor-participation.not-participating'], + }, ], }, style: { diff --git a/test/doc-views/layout/spec.handlebars b/test/doc-views/layout/spec.handlebars index 19b5fdb8e..9fe5abc1d 100644 --- a/test/doc-views/layout/spec.handlebars +++ b/test/doc-views/layout/spec.handlebars @@ -102,7 +102,7 @@
George Herald (WebFoo)
{{#if dl.editor2.show}} -
John Doe (WebFoo) +
John Doe (WebFoo){{{dl.editor2.former}}}
{{/if}} {{/if}} diff --git a/test/doc-views/specBase.js b/test/doc-views/specBase.js index 5ef413e6a..4fbb672ee 100644 --- a/test/doc-views/specBase.js +++ b/test/doc-views/specBase.js @@ -626,6 +626,28 @@ export function buildCommonViewData(base) { }, }, }, + formerEditorParticipation: { + ...base, + dl: { + ...base.dl, + editor2: { + show: true, + id: '3440', + former: ' (until January 2020)', + }, + }, + }, + formerEditorParticipationNoRationale: { + ...base, + dl: { + ...base.dl, + editor2: { + show: true, + id: '3440', + former: ' ', + }, + }, + }, }, shortname: { shortnameLowercaseFP: {