Bug 19852

Summary: Add message text box in circulation for patrons does not accept HTML tags
Product: Koha Reporter: Michael Cabus <michael>
Component: Staff interfaceAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dcook, george, gmcharlt, lisettepalouse+koha, sbcornell, severine.queune
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27524
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: result after adding HTML tags for a patron message

Description Michael Cabus 2017-12-20 17:04:57 UTC
Created attachment 69958 [details]
result after adding HTML tags for a patron message

Hi
  When you add a patron message in circulation.pl, the modal that appears has a text box that does not accept HTML tags.  Some libraries use HTML tags in these messages to link to information in Koha and to format the display of the message (see attached).  Having this modal accept HTML would allow formatting and linking in messages.
Comment 1 Katrin Fischer 2021-06-03 22:57:25 UTC
Verified in master, that HTML is still escaped in messages.
Comment 2 Sarah Cornell 2022-09-21 20:30:47 UTC
I'd like to be able to format report notes so they are more useful for users.  I can use the jQuery workaround from the wiki, but it would be great if it was available without local jQuery.
Comment 3 David Cook 2022-09-23 00:09:43 UTC
What sort of HTML tags to people typically use for these messages?
Comment 4 Lisette Scheer 2022-09-23 00:31:38 UTC
Formatting options, like maybe bold or italics, even links would be nice. 

Also if you could say, add a class as a prepopulated message and use css to displace specific messages differently.
Comment 5 Katrin Fischer 2023-10-01 15:24:34 UTC
Still valid.
Comment 6 David Cook 2023-10-04 00:20:59 UTC
I've been thinking about this topic for some time... and maybe a solution is to create a new Template::Toolkit filter that uses C4::Scrubber/HTML::Scrubber. 

An old version already exists on CPAN: https://metacpan.org/pod/Template::Plugin::Filter::HTMLScrubber

We could either use that one or come up with our own.

The tough part here is the configuration. Deciding how rigid/flexible to make it for long-term maintainability but also end-user usability.