yannicuLar
yannicuLar

Reputation: 3133

How to configure Primefaces p:editor to enforce paragraphs

Hi I'm using p:editor from primefaces (v.4.0) Is there any way to setup the editor, so that every new line will be include in a <p></p> element ?

So far I've noticed that new lines are currently inserted with <br /> or <div> or nothing at all (plain text), depending on the selected font style, or the client's browser!

Upvotes: 2

Views: 1620

Answers (1)

Hatem Alimam
Hatem Alimam

Reputation: 10058

PrimeFaces uses CLEditor, and in that editor the line break is produced automatically by the Browser not CLEditor, because the iframe is in designMode.

In IE <p> is included unless a <div> was started. On all the others it's <div>.

You should provide that consistency in the back-end, by replacing each <div> with <p>

Read more:

Upvotes: 4

Related Questions