Bugzilla – Attachment 158604 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: Replace regex with wrap for non-html based notices
Bug-34704-Replace-regex-with-wrap-for-non-html-bas.patch (text/plain), 1.42 KB, created by
Martin Renvoize (ashimema)
on 2023-11-07 14:45:06 UTC
(
hide
)
Description:
Bug 34704: Replace regex with wrap for non-html based notices
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-11-07 14:45:06 UTC
Size:
1.42 KB
patch
obsolete
>From e7708b68a6556221d25ac43121d56afbce57e080 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >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 <pre>. >--- > 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 <br/> as output is html >+ ## Wrap non-html based notice in <pre> to retain formatting > foreach my $message (@all_messages) { >- local $_ = $message->{'content'}; >- s/^\s*\n/<br \/>/gm; >- s/\r//g; >- $message->{'content'} = $_; >+ if ( $message->{'content_type'} !~ m/html/io ) { >+ $message->{'content'} = '<pre>'.$message->{'content'}.'</pre>'; >+ } > } > > $html_filenames = print_notices({ >-- >2.41.0
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