From e7708b68a6556221d25ac43121d56afbce57e080 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 7 Nov 2023 14:42:08 +0000 Subject: [PATCH] Bug 34704: Replace regex with wrap for non-html based notices If a notice is marked as HTML in the template editor we don't want to add any additional HTML markup. If a notice is not marked as HTML in the template editor, then it is assumed the notice is plaintext and thus includes formatting and so for an html output the content should be wrapped in
.
---
 misc/cronjobs/gather_print_notices.pl | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl
index 779750355e9..3ace61d7b2c 100755
--- a/misc/cronjobs/gather_print_notices.pl
+++ b/misc/cronjobs/gather_print_notices.pl
@@ -106,12 +106,11 @@ $ods_filenames = print_notices({
 }) if $ods;
 
 if ( $html ) {
-    ## carriage return replaced by 
as output is html + ## Wrap non-html based notice in
 to retain formatting
     foreach my $message (@all_messages) {
-        local $_ = $message->{'content'};
-        s/^\s*\n/
/gm; - s/\r//g; - $message->{'content'} = $_; + if ( $message->{'content_type'} !~ m/html/io ) { + $message->{'content'} = '
'.$message->{'content'}.'
'; + } } $html_filenames = print_notices({ -- 2.41.0