From 8ff3d7ed83b45817bce192945884c6f813343557 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 1 Jun 2026 23:36:39 -0300 Subject: data: AAAAAAAAAAAAAAAA sort dates nicely, sort name detail --- src/common-util/sort.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/common-util/sort.js') diff --git a/src/common-util/sort.js b/src/common-util/sort.js index b87ef500..d89fa4cc 100644 --- a/src/common-util/sort.js +++ b/src/common-util/sort.js @@ -40,11 +40,15 @@ export function normalizeName(s) { // punctuation, with a single typical space, then trim the ends. s = s .replace( - /[\p{Separator}\p{Dash_Punctuation}\p{Connector_Punctuation}]+/gu, + /[/\p{Separator}\p{Dash_Punctuation}\p{Connector_Punctuation}]+/gu, ' ' ) .trim(); + // Zero-prefix sequences of digits (bounded by only select characters), + // so lesser-value numbers precede greater. + s = s.replace(/(?<=[ ({\[<]|^)\d+(?=[ )}\]>]|$)/g, match => match.padStart(5, '0')); + // Discard anything that isn't a letter, number, space, or apostrophe. s = s.replace(/[^\p{Letter}\p{Number} ']/gu, '').trim(); -- cgit 1.3.0-6-gf8a5