« get me outta code hell

sort: le la l' - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-01-10 16:14:25 -0400
committer(quasar) nebula <qznebula@protonmail.com>2026-01-10 16:14:38 -0400
commitc7916fd1c6206e666655c24595c9610f577e2071 (patch)
treef4ef509f20abd98b5f801eaf8fe7bb05ab051d69 /src
parent5c3317f02e32291f20d6f1257e290dcec6bbba06 (diff)
sort: le la l'
Diffstat (limited to 'src')
-rw-r--r--src/common-util/sort.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/common-util/sort.js b/src/common-util/sort.js
index bbe4e551..b87ef500 100644
--- a/src/common-util/sort.js
+++ b/src/common-util/sort.js
@@ -45,11 +45,14 @@ export function normalizeName(s) {
     )
     .trim();
 
-  // Discard anything that isn't a letter, number, or space.
-  s = s.replace(/[^\p{Letter}\p{Number} ]/gu, '').trim();
+  // Discard anything that isn't a letter, number, space, or apostrophe.
+  s = s.replace(/[^\p{Letter}\p{Number} ']/gu, '').trim();
 
-  // Remove common English (only, for now) prefixes.
-  s = s.replace(/^(?:an?|the) /i, '');
+  // Remove common articles.
+  s = s.replace(/^(?:an?|the|le|la|l') /i, '');
+
+  // Discard apostrophes.
+  s = s.replace(/'/g, '').trim();
 
   return s;
 }