Skip to content

Single quote strings break something about CRLF #72

@ondrejmirtes

Description

@ondrejmirtes

Version: since 3.3.3

This bug report is about this commit: 22e384d

Bug Description

After encoding and decoding a string that contains \r\n, the resulting array isn't equivalent to the previous one.

When I revert the change from 22e384d

Steps To Reproduce

I have a gist that shows before/after: https://gist.github.com/ondrejmirtes/560e8ecb616bce26575a631f4fc86af1/revisions

On line 52 you can see the difference:

Screenshot 2024-09-30 at 11 18 06

Before: ^PHPDoc tag @param has invalid value \\(\r
After: #^PHPDoc tag @param has invalid value \(

Decoding this again with nette/neon results in a different string.

If I re-add again \r to the neon file like this:

#^PHPDoc tag @param has invalid value \(\r

It makes it alright again.

Expected Behavior

Encoding and decoding a string should result in the same string.

Possible Solution

I've opened a PR with a failing test, not sure how to fix it: #71

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions