fix(aria): escape leading dash in property values (#34227)
This commit is contained in:
parent
d2af88c1fe
commit
9514f0fb9d
|
|
@ -58,8 +58,8 @@ function yamlStringNeedsQuotes(str: string): boolean {
|
||||||
if (/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(str))
|
if (/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/.test(str))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Strings starting with '-' followed by a space need quotes
|
// Strings starting with '-' need quotes
|
||||||
if (/^-\s/.test(str))
|
if (/^-/.test(str))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Strings containing ':' or '\n' followed by a space or at the end need quotes
|
// Strings containing ':' or '\n' followed by a space or at the end need quotes
|
||||||
|
|
|
||||||
|
|
@ -555,6 +555,7 @@ it('should escape special yaml values', async ({ page }) => {
|
||||||
<a href="#">null</a>NULL
|
<a href="#">null</a>NULL
|
||||||
<a href="#">123</a>123
|
<a href="#">123</a>123
|
||||||
<a href="#">-1.2</a>-1.2
|
<a href="#">-1.2</a>-1.2
|
||||||
|
<a href="#">-</a>-
|
||||||
<input type=text value="555">
|
<input type=text value="555">
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
|
@ -573,6 +574,8 @@ it('should escape special yaml values', async ({ page }) => {
|
||||||
- text: "123"
|
- text: "123"
|
||||||
- link "-1.2"
|
- link "-1.2"
|
||||||
- text: "-1.2"
|
- text: "-1.2"
|
||||||
|
- link "-"
|
||||||
|
- text: "-"
|
||||||
- textbox: "555"
|
- textbox: "555"
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue