From b923e85bf08631e4fbf5324b38ce31816b9f62b1 Mon Sep 17 00:00:00 2001 From: jennyliang Date: Mon, 17 Apr 2023 13:33:35 +0800 Subject: [PATCH 1/3] change note tempate --- src/w3c/templates/sotd.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/w3c/templates/sotd.js b/src/w3c/templates/sotd.js index 37d15ee024..8c4cbe2fe3 100644 --- a/src/w3c/templates/sotd.js +++ b/src/w3c/templates/sotd.js @@ -253,9 +253,11 @@ function renderNotRec(conf) {

`; break; case "DNOTE": - case "NOTE": endorsement = html`${conf.textStatus}s are not endorsed by W3C nor its Members.`; + case "NOTE": + endorsement = html`This ${conf.textStatus} is endorsed by ${conf.wgHTML}, but is not endorsed by W3C itself nor its Members.`; + break; } return html`

${endorsement} ${statusExplanation}

From d585e17baa8875f2c60b8171bb161c88445ffe2b Mon Sep 17 00:00:00 2001 From: jennyliang Date: Mon, 17 Apr 2023 13:52:09 +0800 Subject: [PATCH 2/3] fix lint --- src/w3c/templates/sotd.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/w3c/templates/sotd.js b/src/w3c/templates/sotd.js index 8c4cbe2fe3..b2ad92dfca 100644 --- a/src/w3c/templates/sotd.js +++ b/src/w3c/templates/sotd.js @@ -255,9 +255,12 @@ function renderNotRec(conf) { case "DNOTE": endorsement = html`${conf.textStatus}s are not endorsed by W3C nor its Members.`; + break; case "NOTE": - endorsement = html`This ${conf.textStatus} is endorsed by ${conf.wgHTML}, but is not endorsed by W3C itself nor its Members.`; - + endorsement = html`This ${conf.textStatus} is endorsed by ${conf.wgHTML}, + but is not endorsed by + W3C itself nor its + Members.`; break; } return html`

${endorsement} ${statusExplanation}

From 2fb0c3332abf399831bd9891f3bee5a8681af41d Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Mon, 17 Apr 2023 15:06:47 +0530 Subject: [PATCH 3/3] prevent `wgHTML` from being "moved" --- src/w3c/headers.js | 7 ------- src/w3c/templates/sotd.js | 18 ++++++++++++++---- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/w3c/headers.js b/src/w3c/headers.js index ba9413a084..c9a7e3f76f 100644 --- a/src/w3c/headers.js +++ b/src/w3c/headers.js @@ -548,10 +548,6 @@ export async function run(conf) { } if (Array.isArray(conf.wg)) { conf.multipleWGs = conf.wg.length > 1; - conf.wgHTML = htmlJoinAnd(conf.wg, (wg, idx) => { - return html`the ${wg}`; - }); - conf.wgPatentHTML = htmlJoinAnd(conf.wg, (wg, i) => { return html`a ${conf.wg}`; - } } if (conf.isPR && !conf.crEnd) { const msg = docLink`${"[specStatus]"} is "PR" but no ${"[crEnd]"} is specified in the ${"[respecConfig]"} (needed to indicate end of previous CR).`; diff --git a/src/w3c/templates/sotd.js b/src/w3c/templates/sotd.js index b2ad92dfca..c3e373a490 100644 --- a/src/w3c/templates/sotd.js +++ b/src/w3c/templates/sotd.js @@ -1,5 +1,5 @@ // @ts-check -import { W3CDate, getIntlData } from "../../core/utils.js"; +import { W3CDate, getIntlData, htmlJoinAnd } from "../../core/utils.js"; import { html } from "../../core/import-maps.js"; import { status2track } from "../headers.js"; const localizationStrings = { @@ -257,8 +257,8 @@ function renderNotRec(conf) { W3C nor its Members.`; break; case "NOTE": - endorsement = html`This ${conf.textStatus} is endorsed by ${conf.wgHTML}, - but is not endorsed by + endorsement = html`This ${conf.textStatus} is endorsed by + ${getWgHTML(conf)}, but is not endorsed by W3C itself nor its Members.`; break; @@ -497,11 +497,21 @@ function linkToWorkingGroup(conf) { >` : ""; return html`

- This document was published by ${conf.wgHTML} as + This document was published by ${getWgHTML(conf)} as ${prefix(conf.longStatus)}${track}. ${changes}

`; } +function getWgHTML(conf) { + if (Array.isArray(conf.wg)) { + return htmlJoinAnd(conf.wg, (wg, idx) => { + return html`the ${wg}`; + }); + } else if (conf.wg) { + return html`the ${conf.wg}`; + } +} + export function linkToCommunity(conf, opts) { if (!conf.github && !conf.wgPublicList) { return;