Milos Cuculovic
Milos Cuculovic

Reputation: 20223

TinyMCE and br : can't set br as a valid element

I have a paragraph which I am pasting in tinyMCE:

Here is the paragraph:

<p>1 aaaaaaaaaaaaa<br />bbbbbbbbbbbbbb</p>

I have set p and br as valid elements in the tinyMCE but I am loosing the br and I don't know why.

May be because my br is like <br /> and not <br>?

If I will delete completely the valid elements option, I am then getting also the <br />.

Do you know how can I enable the <br /> as a valid element in tinyMCE?

Thank you very much.

Upvotes: 1

Views: 915

Answers (1)

raina77ow
raina77ow

Reputation: 106395

tinyMCE valid_elements option allows to specify wide range of rules to 'normalize' the document: it's powerful, but it's quite strict in its syntax. Particularly speaking, one shouldn't use whitespace as additional separator of the rules.

For example, to restrict valid elements to <p> and <br /> only, this line should be used:

...
valid_elements: 'p,br' // not valid_elements: 'p, br'
...

Upvotes: 1

Related Questions