statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

[BUG] When texarea field is saved with a starting space, there is a ParseException #2382

Closed Neophen closed 5 years ago

Neophen commented 5 years ago

Describe the bug If the text has a starting space it breaks the parsing for e.g.:

description: |
<space><space><space>PURPOSE:
<space><space>The John and Sharon Cady Blom 

Where is an actual space.

When type: textarea is saved with a starting space this exception is thrown:

ParseException in Parser.php line 444:
Unable to parse at line 4 (near " The Frieda Wall Endowed Scholarship will be established in 2013 to provide financial aid to students").

To Reproduce

  1. create a fieldset with type: textarea
  2. save an entry with a starting space (you can copy paste text bellow):
    PURPOSE:
    The John and Sharon Cady Blom 
  3. note the parse exception.

Expected behavior the parser should not break.

Environment details (please complete the following information):

jasonvarga commented 5 years ago

This seems to be an issue with the Symfony YAML parser. Although I'm not sure what the correct behavior should be.

Do you actually need that space? What if we just trimmed off extra space? That would fix the error but you'd lose the space if it was intentional.

jackmcdade commented 5 years ago

This issue has been inactive and in need of more information for a while now. Feel free to reopen and we'd be more than happy to take another look if you have more info that can help!

Neophen commented 5 years ago

Yeah it's ok i'm now trimming the spaces :)