diff --git a/packages/playwright-core/src/server/injected/yaml.ts b/packages/playwright-core/src/server/injected/yaml.ts index 977591c1cc..e87c6706de 100644 --- a/packages/playwright-core/src/server/injected/yaml.ts +++ b/packages/playwright-core/src/server/injected/yaml.ts @@ -63,7 +63,7 @@ function yamlStringNeedsQuotes(str: string): boolean { return true; // Strings that start with a special indicator character need quotes - if (/^[&*].*/.test(str)) + if (/^[&*\],].*/.test(str)) return true; // Strings containing ':' followed by a space or at the end need quotes diff --git a/tests/page/page-aria-snapshot.spec.ts b/tests/page/page-aria-snapshot.spec.ts index a7937e9be5..6b37438419 100644 --- a/tests/page/page-aria-snapshot.spec.ts +++ b/tests/page/page-aria-snapshot.spec.ts @@ -465,6 +465,12 @@ it('should escape yaml text in text nodes', async ({ page }) => { +