Skip to content

Commit

Permalink
Re-simplify title logic for other understanding docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kfranqueiro committed Oct 1, 2024
1 parent 6873aef commit d6bfbc5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions 11ty/CustomLiquid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,9 @@ export class CustomLiquid extends Liquid {
`Understanding ${type} ${scope.guideline.num}: ${scope.guideline.name}${titleSuffix}`
);
} else {
// Update WCAG version in title and top-level heading in other understanding docs
const wcagPattern = /WCAG 2(?:\.\d)?( |$)/;
const wcagReplacement = `WCAG ${scope.versionDecimal}$1`;
$title.text($title.text().replace(wcagPattern, wcagReplacement) + titleSuffix);
const $h1 = $("h1");
$h1.text($h1.text().replace(wcagPattern, wcagReplacement));
$title.text(
$title.text().replace(/WCAG 2( |$)/, `WCAG ${scope.versionDecimal}$1`) + titleSuffix
);
}

// Remove Techniques section from obsolete SCs (e.g. Parsing in 2.2)
Expand Down

0 comments on commit d6bfbc5

Please sign in to comment.