Skip to content

Problem with yaml parser and line breaks in folded style blocks #9105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
micha149 opened this issue Sep 23, 2013 · 2 comments
Closed

Problem with yaml parser and line breaks in folded style blocks #9105

micha149 opened this issue Sep 23, 2013 · 2 comments

Comments

@micha149
Copy link

I noticed a problem with the yaml parser component in version 2.3.3. The folded style block seem to not correctly parse line breaks which includes indents oder blank lines.

Here is a small example:

small:
    test: >
        <h2>A heading</h2>

        <ul>
            <li>a list</li>
            <li>may be a good example</li>
        </ul>

I would expect a resulting string like:

<h2>A heading</h2><ul><li>a list</li><li>may be a good example</li></ul>

Currently I receive something like that:

<h2>A heading</h2>

<ul>    <li>a list</li>    <li>may be a good example</li></ul>

The parse should not replace the line break and all following white spaces with a space. Lines with no content should be omitted too.

@cordoval
Copy link
Contributor

cordoval commented Dec 7, 2013

I think this is a bug but mostly keep in mind #8562 (comment)
I have seen this usage in symfony-cmf to plug html as a parameter they were using | though. I think all in all you can further process your html with other means and format it without spaces or trim them without problems.

#8562 (comment) points to a larger attempt to support yaml parsing fully patch by patch imo

👶

@xabbuh
Copy link
Member

xabbuh commented Dec 6, 2015

see #16864

fabpot added a commit that referenced this issue Dec 26, 2015
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] fix indented line handling in folded blocks

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9105
| License       | MIT
| Doc PR        |

Commits
-------

756834c [Yaml] fix indented line handling in folded blocks
@fabpot fabpot closed this as completed Dec 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants