Skip to content

Commit

Permalink
Always drop level from series shortTitle
Browse files Browse the repository at this point in the history
Previous update introduced `series.shortTitle` but the level was incorrectly
kept at the end of the series short title in some cases.

Explicit short titles that get set in specs.json also need to be consistent for
the code to generate consistent series short titles.

Note that both issues are correctly detected and reported by the
"has consistent series info" test in `test/index.js`, which makes sure that the
series info is the same for all specs in a series.
  • Loading branch information
tidoust authored and dontcallmedom committed Jan 3, 2022
1 parent a8a98ae commit 97a247a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 10 additions & 2 deletions specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
"https://drafts.css-houdini.org/css-typed-om-2/ delta",
"https://drafts.css-houdini.org/font-metrics-api-1/",
"https://drafts.csswg.org/css-animations-2/ delta",
"https://drafts.csswg.org/css-backgrounds-4/ delta",
{
"url": "https://drafts.csswg.org/css-backgrounds-4/",
"seriesComposition": "delta",
"shortTitle": "CSS Backgrounds 4"
},
"https://drafts.csswg.org/css-env-1/",
"https://drafts.csswg.org/css-extensions-1/",
{
Expand Down Expand Up @@ -418,7 +422,11 @@
"url": "https://www.w3.org/TR/css-cascade-5/",
"shortTitle": "CSS Cascading 5"
},
"https://www.w3.org/TR/css-cascade-6/ delta",
{
"url": "https://www.w3.org/TR/css-cascade-6/",
"seriesComposition": "delta",
"shortTitle": "CSS Cascading 6"
},
"https://www.w3.org/TR/css-color-4/",
"https://www.w3.org/TR/css-color-5/ delta",
"https://www.w3.org/TR/css-color-adjust-1/",
Expand Down
3 changes: 3 additions & 0 deletions src/build-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ Promise.resolve()
spec.shortTitle = computeShortTitle(spec.title);
spec.series.shortTitle = spec.series.shortTitle ?? computeShortTitle(spec.series.title);
}

// Drop level number from series short title
spec.series.shortTitle = spec.series.shortTitle.replace(/ \d+(\.\d+)?$/, '');
return spec;
}))
.then(dolog(`Compute short titles... done`))
Expand Down

0 comments on commit 97a247a

Please sign in to comment.