x2.
x2.

Reputation: 9668

TinyMCE - Stop formatting inside pre tag

When i add plain text inside pre tag it's formatted( space changed to &nbsp; line-break to <br /> and so on). When i add it in html view - all spaces and line-breaks are deleting too. It seems to me unnecessary.

How can i stop TinyMCE doing this, save original formatting inside <pre> block?

Upvotes: 1

Views: 1354

Answers (2)

David Bond
David Bond

Reputation: 308

This is a TinyMCE bug.

I have raised an issue here: https://github.com/tinymce/tinymce/issues/9576

Upvotes: 0

Thariama
Thariama

Reputation: 50832

It is formatted depending on your browser. You won't be able to change that- and if you are you shouldn't do it. In Firefox the br-element is necessary to be able to click inside the html element, so is the &nbsp;.

Spaces added in html view at the end or beginning of a html-element get removed (trimmed out) by default - that is correct btw.

Upvotes: -1

Related Questions