我正在创建一个 sticky 应用程序,用户可以通过在文本区域中输入多行文本来添加 sticky .当我在Firebase中保存 sticky 时,它是用我想要可视化的换行符(\n)保存的.
因此,我写了一个过滤器,用<br />
替换这些字符,效果很好
我正在创建一个 sticky 应用程序,用户可以通过在文本区域中输入多行文本来添加 sticky .当我在Firebase中保存 sticky 时,它是用我想要可视化的换行符(\n)保存的.
因此,我写了一个过滤器,用<br />
替换这些字符,效果很好
pre
element.<pre>
元素将在其中包含空格,例如:
This is followed by a newline,
not that you can tell
<br />
<br />
<pre>You can see the newline after me!
Woohoo!</pre>
将导致:
This is followed by a newline, not that you can tell
You can see the newline after me!
Woohoo!
这样,就不需要对换行进行任何过滤.