symfony/Yaml — pull request #5 by thephpdeveloper (2013-04-13 17:04:48+00:00)
Title: fixed document start bug

According to the [YAML 1.2 specs](http://www.yaml.org/spec/1.2/spec.html) section **2.2 Structures**, the Examples 2.7 and 2.8 show that the document start `---` and end `...` can have content (such as whitespaces and comments) before and after respectively.

The current implementation of `cleanup()` does not clean up the document start marker `---` if the marker is placed after comments. As a result, the Parser will throw an exception.

However, in this hotfix, I've changed the regular expression in the `cleanup()` process such that as long as that line contains `---` or `...` only, we remove it.

If the markers are not used, then the usage is not affected.