Additional line breaks in category description in OMP 3.1.1

Hi,

in the category description in OMP 3.1.1., line breaks (<br>) are added to the html code that was entered in Press Settings → Tab “Categories”.

If I change {$description|nl2br|strip_unsafe_html} to {$description|strip_unsafe_html} in catalogCategory.tpl, the text appears as expected on the category page in the frontend.

The line breaks are already visible in the database, however they are also visible in e.g. the about text, which is called {$currentContext->getLocalizedSetting(‘about’)} and without additional line breaks.

categoryDescription

Hi @carola,

It sounds like removing the nl2br filter causes the system to behave as you expect – is that correct? Off the top of my head that’s the correct solution. If you can confirm I’ll get it filed & fixed for the next release.

Regards,
Alec Smecher
Public Knowledge Project Team

It sounds like removing the nl2br filter causes the system to behave as you expect – is that correct?

yes, in my installation (http://bibliothek.edition-romiosini.de/catalog/category/thanassis-valtinos, I tested it and undid the changes again), it does. But I don’t know if removing it has any unwanted side effects.

best,
Carola

Hi @carola,

Yes, looking at the code, that’s the right change. I’ve committed it for the next release: Remove unwanted nl2br https://forum.pkp.sfu.ca/t/additional-line-brea… · pkp/omp@d5df215 · GitHub

Thanks,
Alec Smecher
Public Knowledge Project Team