Preserve explicit YAML document end marker (#18296)

This commit is contained in:
fisker Cheung authored and GitHub committed 2025-11-22 12:23:00 +08:00
1 parent f4289b9d6c
commit 6fac964b40
15 files changed
+497 -35

No files matched your search

@@ -1,5 +1,93 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`block-folded-keep.yml - {"proseWrap":"always"} format 1`] = `
====================================options=====================================
parsers: ["yaml"]
printWidth: 80
proseWrap: "always"
| printWidth
=====================================input======================================
--- >+
ab
...
=====================================output=====================================
---
>+
ab
...
================================================================================
`;
exports[`block-folded-keep.yml format 1`] = `
====================================options=====================================
parsers: ["yaml"]
printWidth: 80
| printWidth
=====================================input======================================
--- >+
ab
...
=====================================output=====================================
---
>+
ab
...
================================================================================
`;
exports[`block-folded-strip.yml - {"proseWrap":"always"} format 1`] = `
====================================options=====================================
parsers: ["yaml"]
printWidth: 80
proseWrap: "always"
| printWidth
=====================================input======================================
--- >-
ab
...
=====================================output=====================================
---
>-
ab
...
================================================================================
`;
exports[`block-folded-strip.yml format 1`] = `
====================================options=====================================
parsers: ["yaml"]
printWidth: 80
| printWidth
=====================================input======================================
--- >-
ab
...
=====================================output=====================================
---
>-
ab
...
================================================================================
`;
exports[`clip.yml - {"proseWrap":"always"} format 1`] = `
====================================options=====================================
parsers: ["yaml"]
@@ -0,0 +1,5 @@
--- >+
ab
...
@@ -0,0 +1,5 @@
--- >-
ab
...
@@ -26,6 +26,48 @@ test
================================================================================
`;
exports[`end-mark.yml format 1`] = `
====================================options=====================================
parsers: ["yaml"]
printWidth: 80
| printWidth
=====================================input======================================
---
key: value
...
xxxxxxxx
=====================================output=====================================
---
key: value
...
xxxxxxxx
================================================================================
`;
exports[`end-mark-2.yml format 1`] = `
====================================options=====================================
parsers: ["yaml"]
printWidth: 80
| printWidth
=====================================input======================================
---
key: value
...
---
xxxxxxxx
=====================================output=====================================
---
key: value
...
---
xxxxxxxx
================================================================================
`;
exports[`separator.yml format 1`] = `
====================================options=====================================
parsers: ["yaml"]
@@ -53,10 +95,11 @@ g
a
---
b
---
...
c
... #
d
...
---
e
...
@@ -0,0 +1,5 @@
---
key: value
...
---
xxxxxxxx
+4
View File
@@ -0,0 +1,4 @@
---
key: value
...
xxxxxxxx
@@ -19,7 +19,7 @@ aaaaa:
---
aaaaa:
bbbbb
---
...
aaaaa: bbbbb
================================================================================
@@ -15,6 +15,7 @@ printWidth: 80
=====================================output=====================================
---
123
...
---
456
@@ -473,7 +473,7 @@ key: value
=====================================output=====================================
---
scalar1
---
...
key: value
================================================================================
@@ -494,7 +494,7 @@ key: value
=====================================output=====================================
---
scalar1
---
...
key: value
================================================================================
@@ -759,7 +759,7 @@ proseWrap: "always"
ab
...
================================================================================
`;
@@ -782,7 +782,7 @@ useTabs: true
ab
...
================================================================================
`;
@@ -802,6 +802,7 @@ proseWrap: "always"
=====================================output=====================================
|-
ab
...
================================================================================
`;
@@ -822,6 +823,7 @@ useTabs: true
=====================================output=====================================
|-
ab
...
================================================================================
`;
@@ -1104,7 +1106,6 @@ a: b
a: b
---
================================================================================
`;
@@ -1124,7 +1125,6 @@ a: b
a: b
---
================================================================================
`;
@@ -1140,6 +1140,7 @@ aaa: bbb
=====================================output=====================================
aaa: bbb
...
================================================================================
`;
@@ -1156,6 +1157,7 @@ aaa: bbb
=====================================output=====================================
aaa: bbb
...
================================================================================
`;
@@ -1653,6 +1655,7 @@ a: |
cd
ef
...
================================================================================
`;
@@ -1679,6 +1682,7 @@ a: |
cd
ef
...
================================================================================
`;
@@ -3148,10 +3152,12 @@ action: grand slam
time: 20:03:20
player: Sammy Sosa
action: strike (miss)
...
---
time: 20:03:47
player: Sammy Sosa
action: grand slam
...
================================================================================
`;
@@ -3179,10 +3185,12 @@ action: grand slam
time: 20:03:20
player: Sammy Sosa
action: strike (miss)
...
---
time: 20:03:47
player: Sammy Sosa
action: grand slam
...
================================================================================
`;
@@ -7611,9 +7619,9 @@ document
=====================================output=====================================
Bare document
---
...
# No document
---
...
|
%!PS-Adobe-2.0 # Not the first line
@@ -7638,9 +7646,9 @@ document
=====================================output=====================================
Bare
document
---
...
# No document
---
...
|
%!PS-Adobe-2.0 # Not the first line
@@ -7665,8 +7673,10 @@ proseWrap: "always"
=====================================output=====================================
---
{ matches %: 20 }
...
---
# Empty
...
================================================================================
`;
@@ -7691,8 +7701,10 @@ useTabs: true
{ ? matches
%
: 20 }
...
---
# Empty
...
================================================================================
`;
@@ -7722,6 +7734,7 @@ proseWrap: "always"
%YAML1.2
---
# Empty
...
================================================================================
`;
@@ -7751,6 +7764,7 @@ useTabs: true
%YAML1.2
---
# Empty
...
================================================================================
`;