diff --git a/lib/l10n-en_GB.js b/lib/l10n-en_GB.js
index 315db7e40..f24372c5c 100644
--- a/lib/l10n-en_GB.js
+++ b/lib/l10n-en_GB.js
@@ -21,7 +21,7 @@ export const messages = {
'headers.w3c-state.no-w3c-state-link':
'Cannot find the link of the W3C profile in id="w3c-state" element pointing to "https://www.w3.org/standards/types#xx".',
'headers.w3c-state.wrong-w3c-state-link':
- 'The link for text "${text}" should pointing to W3C profile "${expectedLink}", but the link found in the document is "${linkFound}".',
+ 'The link for text "${text}" should pointing to W3C profile "https://www.w3.org/standards/types/#${hash}", but the link found in the document is "${linkFound}".',
// headers/h2-toc
'headers.h2-toc.not-found':
'There is no table of contents inside a navigation element (<nav id="toc"> … <h2>Table of Contents</h2> … </nav>).',
diff --git a/lib/rules.json b/lib/rules.json
index 92fb0220b..a048cb8a0 100644
--- a/lib/rules.json
+++ b/lib/rules.json
@@ -1220,7 +1220,7 @@
],
"dateState": [
"Recommendation",
- "
If this is a modified Recommendation that was modified in place or is a new edition, the document must include both the original publication date and the modification date. For example:
<p id=\"w3c-state\">W3C Recommendation 7 April 2004, edited in place 19 August2004</p>
"
+ "
If this is a modified Recommendation that was modified in place or is a new edition, the document must include both the original publication date and the modification date. For example:
<p id=\"w3c-state\">W3C Recommendation 7 April 2004, edited in place 19 August2004</p>
"
],
"docIDFormat": true,
"docIDOrder": "Document identifier information must be present in this order:
'This version' - URI to that version
'Latest version' - URI to the latest version. See also the (non-normative) Version Management in W3C Technical Reports for information about \"latest version\" URI and version management.
'History' - URI to the history of the specification
Editor(s)
Feedback - GitHub repository issue links are required in the <dl>after <dt>Feedback:</dt> in the headers (<div class=\"head\">) of the document. Links are expected to be of the form https://github.com/<USER_OR_ORG>/<REPO_NAME>/[issues|labels][/…].)
Errata - URI to an errata document for any errors or issues reported since publication. See also suggestions on errata page structure in the Manual of Style. Note:
Do not put the errata document in TR space as the expectation is that we will not modify document in TR space after publication; see the policy for in-place modification of W3C Technical Reports.
Recommendations with candidate/proposed changes are treated as inline errata, and these documents don't require an errata link.
",
@@ -1577,7 +1577,7 @@
"logo": "The document must include a link to the W3C logo identified below. The URI used to identify the logo must be absolute.
Include this source code: <a href=\"https://www.w3.org/\"><img height=\"48\" width=\"72\" alt=\"W3C\" src=\"https://www.w3.org/StyleSheets/TR/2021/logos/W3C\"/></a>
",
"title": "The document's title must be in the title element and in an h1 element. When calculating text equation, special transformations made to h1 are:
Replace ':<br>' with ': '
Replace '<br>' with ' - '
Extract text from h1, and ignore HTML tags.
",
"versionNumber": "Technical report version information, i.e., version and edition numbers. @{param1}
@{param2}",
"docIDFormat": "Document identifier information must be presented in a dl list, where each dt element marks up an identifier role (\"This Version\", \"Latest Version\", \"History\", etc.) and each dd element includes a link whose link text is the identifier. That dlmust itself be placed in a details element.
Include this source code: <details open><summary>More details about this document</summary><dl>...</dl></details>
",
"docIDOrder": "Document identifier information must be present in this order:
'This version' - URI to that version
'Latest version' - URI to the latest version. See also the (non-normative) Version Management in W3C Technical Reports for information about \"latest version\" URI and version management.
'History' - URI to the history of the specification
Editor(s)
Feedback - GitHub repository issue links are required in the <dl>after <dt>Feedback:</dt> in the headers (<div class=\"head\">) of the document. Links are expected to be of the form https://github.com/<USER_OR_ORG>/<REPO_NAME>/[issues|labels][/…].)
",
"docIDThisVersion": "The syntax of a “this version” URI must be https://www.w3.org/TR/YYYY/@{param1}-shortname-YYYYMMDD/. If the document introduces a new shortname, it must use lowercase letters.",
diff --git a/lib/rules/headers/w3c-state.js b/lib/rules/headers/w3c-state.js
index cc96d64ea..b3f52ab7c 100644
--- a/lib/rules/headers/w3c-state.js
+++ b/lib/rules/headers/w3c-state.js
@@ -55,12 +55,14 @@ export function check(sr, done) {
if (sr.config.longStatus === 'First Public Working Draft') {
hash = 'FPWD';
}
- const expectedLink = `https://www.w3.org/standards/types#${hash}`;
+ const expectedLink = new RegExp(
+ `https://www.w3.org/standards/types/?#${hash}`
+ );
if (!standardLink) {
sr.error(self, 'no-w3c-state-link');
- } else if (standardLink.href !== expectedLink) {
+ } else if (!expectedLink.test(standardLink.href)) {
sr.error(self, 'wrong-w3c-state-link', {
- expectedLink,
+ hash,
linkFound: standardLink.href,
text: sr.norm(standardLink.textContent),
});
diff --git a/test/doc-views/layout/spec.handlebars b/test/doc-views/layout/spec.handlebars
index aa67fc411..7d8887f2c 100644
--- a/test/doc-views/layout/spec.handlebars
+++ b/test/doc-views/layout/spec.handlebars
@@ -36,7 +36,7 @@
{{/if}}