From e36872408600c1a4c568ff9be9d84713d2561408 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 29 Apr 2025 15:36:35 -0300 Subject: content, data: properly update artistDisplayText -> artistText --- src/common-util/wiki-data.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/common-util/wiki-data.js') diff --git a/src/common-util/wiki-data.js b/src/common-util/wiki-data.js index a4c6b3bd..c993f4ac 100644 --- a/src/common-util/wiki-data.js +++ b/src/common-util/wiki-data.js @@ -60,7 +60,7 @@ export function getKebabCase(name) { // Matches heading details from commentary data in roughly the formats: // // artistReference: (annotation, date) -// artistReference|artistDisplayText: (annotation, date) +// artistReference|artistText: (annotation, date) // // where capturing group "annotation" can be any text at all, except that the // last entry (past a comma or the only content within parentheses), if parsed @@ -83,8 +83,9 @@ export function getKebabCase(name) { // parentheses can be part of the actual annotation content. // // Capturing group "artistReference" is all the characters between and -// (apart from the pipe and "artistDisplayText" text, if present), and is either -// the name of an artist or an "artist:directory"-style reference. +// (apart from the pipe and the "artistText" group, if present), and is either +// the name of one or more artist or "artist:directory"-style references, +// joined by commas, if multiple. // // This regular expression *doesn't* match bodies, which will need to be parsed // out of the original string based on the indices matched using this. @@ -94,7 +95,7 @@ const dateRegex = groupName => String.raw`(?<${groupName}>[a-zA-Z]+ [0-9]{1,2}, [0-9]{4,4}|[0-9]{1,2} [^,]*[0-9]{4,4}|[0-9]{1,4}[-/][0-9]{1,4}[-/][0-9]{1,4})`; const commentaryRegexRaw = - String.raw`^(?.+?)(?:\|(?.+))?:<\/i>(?: \((?(?:.*?(?=,|\)[^)]*$))*?)(?:,? ?(?:(?sometime|throughout|around) )?${dateRegex('date')}(?: ?- ?${dateRegex('secondDate')})?(?: (?captured|accessed) ${dateRegex('accessDate')})?)?\))?`; + String.raw`^(?.+?)(?:\|(?.+))?:<\/i>(?: \((?(?:.*?(?=,|\)[^)]*$))*?)(?:,? ?(?:(?sometime|throughout|around) )?${dateRegex('date')}(?: ?- ?${dateRegex('secondDate')})?(?: (?captured|accessed) ${dateRegex('accessDate')})?)?\))?`; export const commentaryRegexCaseInsensitive = new RegExp(commentaryRegexRaw, 'gmi'); export const commentaryRegexCaseSensitive = -- cgit 1.3.0-6-gf8a5