Bugzilla – Attachment 155503 Details for
Bug 34704
Print templates are formatted incorrectly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34704: Fix regex
Bug-34704-Fix-regex.patch (text/plain), 1.41 KB, created by
Lucas Gass (lukeg)
on 2023-09-11 16:25:43 UTC
(
hide
)
Description:
Bug 34704: Fix regex
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-09-11 16:25:43 UTC
Size:
1.41 KB
patch
obsolete
>From cb24190343337c0c19c6c783ba2a9d4ce7553035 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Mon, 4 Sep 2023 11:47:50 +0000 >Subject: [PATCH] Bug 34704: Fix regex > >This patch amends a regex check to stop <br /> 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/<br \/>/g' >4) Observe that the output has a <br /> 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 <br /> tags > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > 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 <br/> as output is html > foreach my $message (@all_messages) { > local $_ = $message->{'content'}; >- s/\n/<br \/>/g; >+ s/^\s*\n/<br \/>/g; > s/\r//g; > $message->{'content'} = $_; > } >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34704
:
155196
|
155503
|
156229
|
156230
|
157303
|
158602
|
158603
|
158604
|
158637
|
158643