Skip to content

Commit 97a247a

Browse files
tidoustdontcallmedom
authored andcommitted
Always drop level from series shortTitle
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.
1 parent a8a98ae commit 97a247a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Diff for: specs.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626
"https://drafts.css-houdini.org/css-typed-om-2/ delta",
2727
"https://drafts.css-houdini.org/font-metrics-api-1/",
2828
"https://drafts.csswg.org/css-animations-2/ delta",
29-
"https://drafts.csswg.org/css-backgrounds-4/ delta",
29+
{
30+
"url": "https://drafts.csswg.org/css-backgrounds-4/",
31+
"seriesComposition": "delta",
32+
"shortTitle": "CSS Backgrounds 4"
33+
},
3034
"https://drafts.csswg.org/css-env-1/",
3135
"https://drafts.csswg.org/css-extensions-1/",
3236
{
@@ -418,7 +422,11 @@
418422
"url": "https://www.w3.org/TR/css-cascade-5/",
419423
"shortTitle": "CSS Cascading 5"
420424
},
421-
"https://www.w3.org/TR/css-cascade-6/ delta",
425+
{
426+
"url": "https://www.w3.org/TR/css-cascade-6/",
427+
"seriesComposition": "delta",
428+
"shortTitle": "CSS Cascading 6"
429+
},
422430
"https://www.w3.org/TR/css-color-4/",
423431
"https://www.w3.org/TR/css-color-5/ delta",
424432
"https://www.w3.org/TR/css-color-adjust-1/",

Diff for: src/build-index.js

+3
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ Promise.resolve()
177177
spec.shortTitle = computeShortTitle(spec.title);
178178
spec.series.shortTitle = spec.series.shortTitle ?? computeShortTitle(spec.series.title);
179179
}
180+
181+
// Drop level number from series short title
182+
spec.series.shortTitle = spec.series.shortTitle.replace(/ \d+(\.\d+)?$/, '');
180183
return spec;
181184
}))
182185
.then(dolog(`Compute short titles... done`))

0 commit comments

Comments
 (0)