I was thinking this is PHx question but since it’s for Jot I decided to post it here.
In jot-message the code shows this:
<div class="jot-message">[+comment.content:wordwrap:esc:nl2br+]</div>
I understand "nl2br = Converts new lines to breaks."
What can I do to use ’<p>’ instead?
I don’t see there is a string in PHx modifiers.
Thanks!
You would need to do a
custom PHx modifier and replace the nl2br modifier in Jot templates with yours.
EDIT: for example, create a snippet "phx:nl2p":
<?php
return nl2br(str_replace('<p></p>', '', '<p>' . preg_replace('#([\r\n]\s*?[\r\n]){2,}#', '</p>$0<p>', $output) . '</p>'));
?>
That should modify:
Paragraph1
Paragraph2
line1
line2
to:
<p>Paragraph1</p>
<p>Paragraph2<br/>
line1<br/>
line2<br/></p>
The code is from
nl2br php manual page.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."