chore: escape more yaml values (#33686)
This commit is contained in:
Родитель
7f7b440c72
Коммит
b40889d1a8
|
@ -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
|
||||
|
|
|
@ -464,6 +464,12 @@ it('should escape yaml text in text nodes', async ({ page }) => {
|
|||
<details>
|
||||
<summary>one: <a href="#">link1</a> "two <a href="#">link2</a> 'three <a href="#">link3</a> \`four</summary>
|
||||
</details>
|
||||
<ul>
|
||||
<a href="#">one</a>,<a href="#">two</a>
|
||||
(<a href="#">three</a>)
|
||||
{<a href="#">four</a>}
|
||||
[<a href="#">five</a>]
|
||||
</ul>
|
||||
`);
|
||||
|
||||
await checkAndMatchSnapshot(page.locator('body'), `
|
||||
|
@ -475,6 +481,17 @@ it('should escape yaml text in text nodes', async ({ page }) => {
|
|||
- text: "'three"
|
||||
- link "link3"
|
||||
- text: "\`four"
|
||||
- list:
|
||||
- link "one"
|
||||
- text: ","
|
||||
- link "two"
|
||||
- text: (
|
||||
- link "three"
|
||||
- text: ") {"
|
||||
- link "four"
|
||||
- text: "} ["
|
||||
- link "five"
|
||||
- text: "]"
|
||||
`);
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче