IE10在< textarea> -tag中显示额外的行有问题。在分析问题时,我们发现它与PHP DOMDocument(XML)中的转义有关。
这是一个过程:
代码示例:
<?php
$dom = new DOMDocument('1.0', 'utf-8');
$root = $dom->createElement('root');
$dom->appendChild($root);
$text = $dom->createTextNode("first\r\nsecond");
$root->appendChild($text);
echo $dom->saveXML();
?>
这将打印
...
first [\r]
second
...
这是两次回车!不应该“createTextNode”将任何换行/回车输入标准化为仅仅是因为它是XML规范http://www.w3.org/TR/REC-xml/#sec-line-ends所要求的吗?或者至少坚持使用“&amp;#13; \ n”,IE 10可能只能识别一个新行?
感谢您的任何建议!
[编辑:抱歉帖子不会显示“&amp;#13;”]
菲利克斯