How i can get:
<p>first<br>p</p>
<p>second p</p>
from:
<p>first
p</p>
<p>second p</p>
using HTMLPurifier?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure about the specifics, but since this question has no answers, see if these pointers help you:
If you’re really set on solving this with HTML Purifier, you might be able to write a textnode transformation that does an
nl2brorstr_replaceby writing a class that extendsHTMLPurifier_AttrDef_Text. Pseudocode:Then you’d inject your class into HTML Purifier:
Caveats:
htmlspecialchars()-ed (it’d be sane, really). Then you’re out of luck with that approach. You’d have to find a way to inject a<br />node, instead.HTMLPurifier_AttrDef_Textinstance.See if that helps you at all?
There’s also a thread on the HTML Purifier forum (did you start it? I wouldn’t be surprised) –
nl2br, auto <br /> insertion. If you find a solution, you could post your answer there.