如何通过twig处理FB-api中的新行字符

时间:2015-05-30 06:51:30

标签: symfony twig

我目前正在研究symfony2框架。在我的一个twig文件中



Play



  我想替换" \ n"这样facebook就会将其视为一个新行字符。

如果我保持原样而不是像这样渲染:

" message":"第一行

所以,它给出了错误而没有考虑第二行。

如何解决这个问题??

1 个答案:

答案 0 :(得分:0)

哦!!

错误已解决!!

<div id='sample'>
    <div style="padding-bottom: 5px;">Select some of this text and copy it to clipboard using ctrl+c or right-click+copy.</div>
  
</div>
<div >The content of the clipboard is: <span id="result"></span></div>