Skip to content

[YAML] Line breaks in folded blocks are handled incorrectly #15477

@teohhanhui

Description

@teohhanhui

Test:

diff --git a/src/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml b/src/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml
index 7a54f16..962e021 100644
--- a/src/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml
+++ b/src/Symfony/Component/Yaml/Tests/Fixtures/sfTests.yml
@@ -51,9 +51,9 @@ php: |
       '~',
     )
 ---
-test: Empty lines in folded blocks
+test: Empty lines in literal blocks
 brief: >
-  Empty lines in folded blocks
+  Empty lines in literal blocks
 yaml: |
   foo:
     bar: |
@@ -65,6 +65,19 @@ yaml: |
 php: |
   array('foo' => array('bar' => "foo\n\n\n  \nbar\n"))
 ---
+test: Empty lines in folded blocks
+brief: >
+  Empty lines in folded blocks
+yaml: |
+  foo:
+    bar: >
+
+      foo
+
+      bar
+php: |
+  array('foo' => array('bar' => "\nfoo\nbar\n"))
+---
 test: IP addresses
 brief: >
   IP addresses

Refer to YAML 1.2 spec or even YAML 1.0 spec

(Also, what you were calling "folded blocks" are actually "literal blocks")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy