From 772fa56b4484b9d0199e8f0e0e74b3d6ec7d0dd6 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Mon, 4 Sep 2023 11:47:50 +0000 Subject: [PATCH] Bug 34704: Fix regex This patch amends a regex check to stop
tags from being added to every line of html template Test plan: 1) This is easy to see using a regex checking tool. In your browser go to regex101.com 2) In the "Test string", copy and paste the text from the comment in the bug 3) In the regular expression field, enter 's/\n/
/g' 4) Observe that the output has a
tag inserted after every html element and it is now one line of text 5) Replace the regular expression with '^\s*\n' 6) The output should now be formatted correctly with no
tags --- misc/cronjobs/gather_print_notices.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl index c1c26ce627..d296934c03 100755 --- a/misc/cronjobs/gather_print_notices.pl +++ b/misc/cronjobs/gather_print_notices.pl @@ -109,7 +109,7 @@ if ( $html ) { ## carriage return replaced by
as output is html foreach my $message (@all_messages) { local $_ = $message->{'content'}; - s/\n/
/g; + s/^\s*\n/
/g; s/\r//g; $message->{'content'} = $_; } -- 2.37.1 (Apple Git-137.1)