Annoucements HTML stripped

Hi there,

OJS 3 here! :slight_smile:
it seems that the html of the announcements is stripped. I think in the database is ok as image below but on public announcement page theres no html at all. Can you please help? No < p > < br/ > etc…

thanks

Hi @Timoteo_Rodrigues,

does the html used match the allowed html tags in your configuration in config.inc.php

; Allowed HTML tags for fields that permit restricted HTML.
; Use e.g. "img[src,alt],p" to allow "src" and "alt" attributes to the "img"
; tag, and also to permit the "p" paragraph tag. Unspecified attributes will be
; stripped.
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"

I tested a default instance and the markup of the announcements was fine.
The only thing which die not work while creating/editing the announcement (and any other field with html) was the button “insert tag” it said “no tags are available”. But I was able to use the predefined tags or enter my own via the source code option.

Hope this helps

Claudia Jürgen

3 Likes

hello @cjuergen,

my config still had the old allowed_html → ("< a > < em > < strong > < cite > (…)")
just copied your allowed html example and it’s perfect. Thank you very much Claudia.

Cheers
Timóteo

1 Like

Hi @cjuergen,

My announcements seem to strip target="_blank" even though the config.inc.php has this line:
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”

This happens whether I put it in the source code or use the popup box to set Target to New Window.

This is a new installation of OJS 3.0.0. Is there something I need to adjust?

Thanks, Alice

See this thread:

Thanks for the links. I just added: $config->set('HTML.TargetBlank', true);
to public_html/lib/pkp/classes/core/PKPString.inc.php and that has fixed it.

Alice

We tried Alice’s solution, but nothing happened:

Here is what is in our allowed HTML line

Do you know if this problem will be automatically fixed in the 3.0.1 release on Friday?

Hi @jaskoog,

Your allowed_html syntax is wrong; look at the example in config.TEMPLATE.inc.php.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

We made the adjustment in the config.inc.php file. We changed the top line to look like the bottom line. It works. I’m not sure why it was had the < > signs originally.

Thank you