From 4c15ad658d59d7f63d27fe61dc102ecd4c22a03d Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 7 Nov 2023 22:31:31 +0000 Subject: [PATCH] Bug 34704: Remove regex for adding additional line breaks to print templates This makes sure that we don't change the line breaking for either HTML nor plain text print notices. For plain text, the
 is used to keep the line breaks as defined
in the notices template.
For HTML we require on the line breaks added by block elements in the
HTML notice, not adding any additional ones like before.
This gives the full control of the formatting to the notice editor.

To test:
* Make sure your patron doesn't have an email address
* Make sure to check the hold filled notice in messaging preferences
* Place a old on any item
* Checkin the item
* Confirm hold
* Verify notices tab shows the Hold (print) notice
* ./misc/cronjobs/gather_print_notices.pl ./ --html
* Verify the generated file has the HTML output wrapped in pre.
* Reformat the HOLD print notice to be HTML by setting the checkbox.
  Mmake sure to add some empty lines for (they should not print later)
  and some 
,

,

- They should be reflected in the notice later. * Repeat test. * All should be well :) Signed-off-by: Matt Blenkinsop Signed-off-by: Lucas Gass Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- misc/cronjobs/gather_print_notices.pl | 8 -------- 1 file changed, 8 deletions(-) diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl index 9e4cd44f0a..7df736354f 100755 --- a/misc/cronjobs/gather_print_notices.pl +++ b/misc/cronjobs/gather_print_notices.pl @@ -106,14 +106,6 @@ $ods_filenames = print_notices({ }) if $ods; if ( $html ) { - ## carriage return replaced by
as output is html - foreach my $message (@all_messages) { - local $_ = $message->{'content'}; - s/\n/
/g; - s/\r//g; - $message->{'content'} = $_; - } - $html_filenames = print_notices({ messages => \@all_messages, split => $split, -- 2.20.1