Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我在 pre 标记中添加纯文本时,它会被格式化(空格更改为 换行符<br />等等)。当我在 html 视图中添加它时 - 所有空格和换行符也会被删除。在我看来这是不必要的。
<br />
我怎样才能阻止 TinyMCE 这样做,将原始格式保存在<pre>块内?
<pre>
它的格式取决于您的浏览器。你将无法改变这一点——如果你是,你不应该这样做。在 Firefox 中,br- 元素是能够在 html 元素内单击所必需的, .
br
默认情况下,在 html 元素的末尾或开头添加到 html 视图中的空格会被删除(修剪掉) - 这是正确的顺便说一句。