From b645c537cd3383c3a16982b6e4ce4463cdf629c3 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Tue, 1 Oct 2024 13:24:09 -0400 Subject: [PATCH] Re-simplify title logic for other understanding docs --- 11ty/CustomLiquid.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/11ty/CustomLiquid.ts b/11ty/CustomLiquid.ts index 39e641a477..eaf4a8ba61 100644 --- a/11ty/CustomLiquid.ts +++ b/11ty/CustomLiquid.ts @@ -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)