From 8d2e68ed59a9703047920691825702c035b3e49c Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang Date: Mon, 6 Oct 2025 17:10:58 +0400 Subject: [PATCH 1/4] provide a way to include former editors that that are no longer participating in the group --- lib/rules/headers/editor-participation.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/rules/headers/editor-participation.js b/lib/rules/headers/editor-participation.js index dda4d3c2b..00d498456 100644 --- a/lib/rules/headers/editor-participation.js +++ b/lib/rules/headers/editor-participation.js @@ -9,7 +9,20 @@ 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" with text starting with "(until " + editors.dd.forEach(dd => { + const former = dd.querySelector('span.former'); + if ( + !former || + !sr.norm(former.textContent).toLowercase().startsWith('(until ') + ) { + editorsToCheck.push(parseInt(dd.dataset.editorId, 10)); + } + }); + } const groupUsersPromises = []; groups.forEach(id => { @@ -27,7 +40,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 }); } From 348764cbf18f0c68cf62c7b29a102cdf12ec6b30 Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang Date: Tue, 7 Oct 2025 11:01:13 +0400 Subject: [PATCH 2/4] only check if the rationale for former editors is not empty --- lib/rules/headers/editor-participation.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/rules/headers/editor-participation.js b/lib/rules/headers/editor-participation.js index 00d498456..9b15c7f64 100644 --- a/lib/rules/headers/editor-participation.js +++ b/lib/rules/headers/editor-participation.js @@ -12,13 +12,10 @@ export async function check(sr, done) { const editors = sr.extractHeaders()?.Editor; const editorsToCheck = []; if (editors) { - // only check editors elements that don't have a span with class "former" with text starting with "(until " + // 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).toLowercase().startsWith('(until ') - ) { + if (!former || !sr.norm(former.textContent)) { editorsToCheck.push(parseInt(dd.dataset.editorId, 10)); } }); From 8ffa870721956c6064dc79045082012c7aa15541 Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang Date: Tue, 7 Oct 2025 11:01:28 +0400 Subject: [PATCH 3/4] update documentation --- lib/rules.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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:
  • a link to an interoperability or implementation report if the Director used such a report as part of the decision to advance the specification, or
  • a statement that the Director's decision did not involve such a report.
", "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.

", From e8838314340599a9779c3ea83b8bbf0667fb5f8b Mon Sep 17 00:00:00 2001 From: Denis Ah-Kang Date: Tue, 7 Oct 2025 11:02:52 +0400 Subject: [PATCH 4/4] add tests --- test/data/TR/TRBase.js | 8 ++++++++ test/doc-views/layout/spec.handlebars | 2 +- test/doc-views/specBase.js | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) 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: {