Support d'apostrophe dans les noms

v2: simple escape seulement
This commit is contained in:
Vincent Vandemeulebrouck 2024-12-18 17:36:47 +01:00
parent 1dfab01c4b
commit 016e4463bd

View File

@ -496,9 +496,9 @@ export class RdDStatBlockParser {
let namePersonnage = "Importé"
if (statString.includes(", né")) {
// Name is all string before first comma ','
namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\'\\-\\s\\d]+),", 'giu'));
namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\'\\-\\s\\d]+),", 'giu'));
} else {
namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\'\\-\\s\\d]+)\\s+TAILLE", 'giu'));
namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\'\\-\\s\\d]+)\\s+TAILLE", 'giu'));
}
if (namePersonnage?.value) {
return Misc.upperFirst(namePersonnage?.value.toLowerCase());