Phalcon 1.3.3
There is a content which has empty first line. If I set it to textarea, empty first line will be lost.
// first line is empty
$content = <<< EOC
contents line2
EOC;
$this->tag->setDefault('test', $content);
echo $this->tag->textArea(array("test"));
Now \Phalcon\Tag::textArea() render like this:
<textarea id="test" name="test">
contents line2</tetarea>
I can see on web browser like this:
----------------------
|contents line2
----------------------
I want to see on web browser like this (first emply line):
----------------------
|
|contents line2
----------------------
I researched HTML specs.
- 4.4 Grouping content — HTML5 https://www.w3.org/TR/html5/grouping-content.html#the-pre-element
In the HTML syntax, a leading newline character immediately following the pre element start tag is stripped.
- 8 The HTML syntax — HTML5 https://www.w3.org/TR/html5/syntax.html#syntax-newlines
A single newline may be placed immediately after the start tag of pre and textarea elements. If the element's contents are intended to start with a newline, two consecutive newlines thus need to be included by the author.
So I hope that \Phalcon\Tag::textArea() will render like this:
<textarea id="test" name="test">
contents line2</tetarea>
What do you think?
Thanks.