[OJS 3] Lost of text formatting?

I have noticed on system wide issue that all formatting is lost on messages (Discussions), imported reviewers forms , emails etc, all formatting I have send or done are lost even new lines are removed, the result is this:

Can someone recommend me how to fix it as it is quite an issue? Especially when reviewers answers are imported and entries are mixed in one paragraph. And with “Add discussions” I have specifically bolded some parts and paragraphs and this is also lost after it is sent).

Here is a shot:

Hi,

anyone see the same issue or a fix on that? @asmecher ?

Hi,

It could be that this is not related, but check your config.inc.php settings for:
allowed_html = "a[href|target|title],em,strong,cite,code,ul,ol,li[class],dl,dt,dd,b,i,u,img[src|alt],sup,sub,br,p"

Do you have that or this:
allowed_html = "<a href|target> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <b> <i> <u> <img src|alt> <sup> <sub> <br> <p>"

I will check, which of these 2 should I have or both are ok?

Hi,

The first one is the format used in OJS3. The second one is the old format used in OJS2.

I have this in my file:

; tags for fields that permit restricted HTML.
; For PHP 5.0.5 and greater, allowed attributes must be specified individually
; e.g. <img src|alt> to allow "src" and "alt" attributes. Unspecified
; attributes will be stripped. For PHP below 5.0.5 attributes may not be
; specified in this way.
allowed_html = "<a href|target> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <b> <i> <u> <img src|alt> <sup> <sub> <br> <p>"

Ok, so that could be the reason to your problems, because OJS3 is using a different format:

This probably is from OJS2 upgrade since they required config file to be keept from the old one?
So How to fix it, should I just replace the

allowed_html = "<a href|target> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <b> <i> <u> <img src|alt> <sup> <sub> <br> <p>"

with

allowed_html = "a[href|target|title],em,strong,cite,code,ul,ol,li[class],dl,dt,dd,b,i,u,img[src|alt],sup,sub,br,p"

1 Like

I guess so. I actually have to find out as well when exactly should that setting be changed, before upgrading from 2.0 to 3.0 or right after that? @asmecher?

1 Like

Hi @ajnyga,

That filter is applied before data is displayed, not when data is saved to the database, so the time of changing the setting isn’t important. Either way is fine.

Regards,
Alec Smecher
Public Knowledge Project Team

2 Likes

Thanks vebaev.
The upgrade from 2.x to 3 does not support the new ojs3 allowed_html. This helped me for now with my upgrade.