Fixed output escaping issues

| Q              | A
| -------------- | ---
| Doc fix?       | yes
| New docs?      | no
| Applies to     | all
| Closes tickets | symfony/symfony#2713