From 3e8165ac4cd9c36d6b4cbdab6ed0b43ea64cdc98 Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Sat, 28 Dec 2024 22:01:25 +0100 Subject: [PATCH] Improve handling of articles named 'Annexe' --- src/lib/articles.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/articles.ts b/src/lib/articles.ts index dc28d8c..d179b21 100644 --- a/src/lib/articles.ts +++ b/src/lib/articles.ts @@ -117,7 +117,7 @@ function articleNumberSegmentToPriorityAndNumber( [...s].reduce((sum, letter) => sum * 256 + letter.charCodeAt(0), 0), ], [semelBisTerEtcRegExp, (s) => numberBySemelBisTerEtc[s] ?? 9999], - [/^Annexe article$/, () => 1], + [/^Annexe/, () => 1], ] as Array<[RegExp, (s: string) => number]> ).entries()) { if (regExp.test(segment)) { @@ -142,7 +142,7 @@ function splitArticleNumber(articleNumber: string): string[] { .filter((segment) => segment !== "") .map((segment) => segment.replace(/^1er$/, "1")) if (annexe) { - segments.push("Annexe article") + segments.push("Annexe") } return segments.reduce((segments: string[], segment: string) => { if (/^[A-Z]{2,3}$/.test(segment)) {