[Koha] Koha Escaping HTML characters

Stefano Bargioni bargioni at pusc.it
Wed Oct 23 03:06:30 NZDT 2013


Hi, Sheldon:
I suggest you to use something like

text1 -- text2 -- text3

in your data, and convert strings ' -- ' into '<br/>' or '<p>' while displaying a 500 field in opac pages.
You can do it using Javascript (jQuery) statements, something like this:

var t = $('.contentblock').html();
t = t.replace(/ -- /g,'<p>');
$('.contentblock').html(t);

This works in pages like "http://.../cgi-bin/koha/opac-detail.pl?biblionumber=NNN", where 5xx tags are contained in html tags with class "contentblock".
See http://wiki.koha-community.org/wiki/JQuery_Library for adding jQuery code to your Koha.
HTH. Stefano


> Hi All,
> 
> Our aim is to enter formatted data into the notes field [500 a] such as
> */<div style=""> information </div>/*. The aim is to give the
> reader an easier experience whilst viewing our results page. However, Koha
> is escaping all of the HTML characters that such as < and >. What can I do
> to prevent koha from overriding those characters.
> 
> Regards,
> Sheldon


More information about the Koha mailing list