fix(curriculum): allow comma separated declarations (#59347)

Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com>
This commit is contained in:
Lasse Jørgensen
2025-04-10 12:34:50 +02:00
committed by GitHub
parent d3652470ac
commit ec61748cdc

View File

@@ -124,7 +124,7 @@ You should use the correct story format for the first story: `"Once upon a time,
```js
const _initialValues = {}
for (const name of ['adjective', 'noun', 'noun2', 'place', 'verb', 'adjective2']) {
const match = code.match(new RegExp(String.raw`${name}\s*=\s*('|"|${'`'})(?<${name}>.*)\1;?\s*`));
const match = code.match(new RegExp(String.raw`${name}\s*=\s*('|"|${'`'})(?<${name}>.*?)\1(?:,|;|\s|$)`, 'm'));
_initialValues[name] = match ? match.groups[name] : null;
}