\s includes newlines; match only space characters instead

This commit is contained in:
ewin 2025-07-28 19:07:56 -04:00
parent 466991d2a1
commit 107fa221c9
Signed by: erin
SSH key fingerprint: SHA256:swjoHhREbZPbWe+gyJNi24d4NAxJSyUIm3fpZj4z3wc

View file

@ -8,21 +8,21 @@ import {diff} from './util.mjs';
* Matches an empty `id-edb` infobox parameter which can just have a value
* inserted after it.
*/
const existingEmptyEDBIDParameter = /^(\s*\|\s*id-edb\s*=)\s*$/m;
const existingEmptyEDBIDParameter = /^( *\| *id-edb *=) *$/m;
/**
* Matches an `id-gt` infobox parameter above which we can insert an `id-edb`
* parameter. Whitespace in capture groups so the inserted parameter can use the
* exact same formatting.
*/
const existingGTIDParameter = /^(\s*)\|(\s*)id-gt(\s*)=(\s*).*$/m;
const existingGTIDParameter = /^( *)\|( *)id-gt( *)=( *).*$/m;
/**
* Matches a `release` infobox parameter below which we can insert an `id-edb`
* parameter. Whitespace in capture groups so the inserted parameter can use the
* exact same formatting.
*/
const existingReleaseParameter = /^(\s*)\|(\s*)release(\s*)=(\s*).*$/m;
const existingReleaseParameter = /^( *)\|( *)release( *)=( *).*$/m;
/**
* Inserts the `id-edb` item infobox parameter into the given page contents.