Podcasts sort with a leading "A" or "An" set aside too (#481)
A Question of Science files under Q, as The Rest Is Science does under R. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RqkrVAJFkEgz9cXG3jG1Zy
This commit is contained in:
@@ -4,10 +4,11 @@
|
||||
const $ = <T extends HTMLElement = HTMLElement>(s: string, r: ParentNode = document): T => r.querySelector<T>(s)!;
|
||||
const $$ = <T extends HTMLElement = HTMLElement>(s: string, r: ParentNode = document): T[] => [...r.querySelectorAll<T>(s)];
|
||||
/// What went wrong, from whatever a catch caught: the page throws Errors, but a catch cannot know.
|
||||
/// Two names in the order a shelf files them: a leading "The" aside, so The Rest Is Science is under
|
||||
/// R (#481), with case and accents aside and 2 before 10.
|
||||
/// Two names in the order a shelf files them: a leading "The", "A" or "An" aside, so The Rest Is
|
||||
/// Science is under R (#481), with case and accents aside and 2 before 10.
|
||||
const ARTICLE=/^(the|an?)\s+/i;
|
||||
const nameOrder = (a: string, b: string): number =>
|
||||
a.replace(/^the\s+/i,'').localeCompare(b.replace(/^the\s+/i,''),undefined,{sensitivity:'base',numeric:true});
|
||||
a.replace(ARTICLE,'').localeCompare(b.replace(ARTICLE,''),undefined,{sensitivity:'base',numeric:true});
|
||||
const why = (e: unknown): string => e instanceof Error ? e.message : String(e);
|
||||
/// A row that opens a feed, a place or a show (the feed list, the Directory): a link to a screen
|
||||
/// reader, named by what it shows, the open one marked current. Not a button, whose contents a
|
||||
|
||||
Reference in New Issue
Block a user