Closed nlemoine closed 8 years ago
Text property do save line breaks in the database, so maybe a filter och a function when you get the value would solve this, maybe papi_nl2br
would solve this. I don't a setting is necessary for this.
Love that you find bugs and contribute new things to Papi :)
Text property do save line breaks in the database
Sure it does but it saves text plain line breaks such as \r
\n
that won't show up on the HTML front end.
The setting I had in mind is about converting into HTML line breaks with nl2br
. Something like:
[
'allow_html' => false,
'nl2br' => true,
]
It's ok if you think it's not necessary, I'll keep my filter on ;)
Hm, yeah maybe it's a good idea. We could add it to 3.0.0, can you do a PR and try to add some tests to it?
Thanks for considering this feature. I'll do a PR today or tomorrow.
I also noticed a small bug. I'll open a new issue about it.
@nlemoine any update about this?
Sorry, holidays, changed computer and a bit of work. I will submit a PR this week.
Would you agree to add a "convert line breaks to br" setting on this property? Very handy when using textarea and prevent adding a filter manually to achieve this.
I'll submit a PR if you're ok with this feature.