[Bug 36333] New: Remove all empty lines from template's output
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36333 Bug ID: 36333 Summary: Remove all empty lines from template's output Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Templates Assignee: jonathan.druart@gmail.com Reporter: jonathan.druart@gmail.com QA Contact: testopia@bugs.koha-community.org We have tried global TT CHOMP (see bug 20657) but it's not trivial and will introduce a lot of side-effects. I would like to reduce the number of empty lines in a more secure way. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36333 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36333 --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 163242 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163242&action=edit Bug 36333: Remove empty lines from template's output This patch removes empty lines (containing only whitespaces) from the output. It does not have the intented result, we don't gain much in term of size. However the source is way cleaner and easier to read. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36333 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36333 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163242|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 163279 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163279&action=edit Bug 36333: Remove empty lines from template's output This patch removes empty lines (containing only whitespaces) from the output. It does not have the intented result, we don't gain much in term of size. However the source is way cleaner and easier to read. Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36333 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Text to go in the| |This removes extra blank release notes| |lines from the HTML page | |source for OPAC and staff | |interface pages. The HTML | |page source should now be | |more compact, which should | |make it easier to read. | | | |(The extra blank lines are | |caused by the way HTML | |output is generated by the | |Template Toolkit - it | |includes whitespace | |anywhere there is a | |template tag.) --- Comment #3 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. View the page source for some OPAC and staff interface pages (for example: home pages for staff interface and OPC, and the details page for a record). 2. Notice that there are a lot of empty lines. 3. Apply the patch. 4. Repeat step 1. 5. Now notice that the JTML page source is much more compact, with minimal extra blank lines. Some examples: - OPAC home page: before - 944 lines; after - 398 lines - OPAC detail page (262 - Programming perl): before - 2487 lines; after - 1285 lines - Staff interface home page: before - 1326 lines; after - 706 lines - Staff detail page (262 - Programming perl): before - 2754 lines; after - 1837 lines Example source for staff interface home page ============================================ Before ~~~~~~ <!DOCTYPE html> <!-- TEMPLATE FILE: intranet-main.tt --> <html lang="en"> <head> <title>Koha staff interface</title> <link href="/intranet-tmpl/prog/css/mainpage_23.1200007.css" type="text/css" rel="stylesheet"> After ~~~~~ <!DOCTYPE html> <!-- TEMPLATE FILE: intranet-main.tt --> <html lang="en"> <head> <title>Koha staff interface</title> <link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/css/mainpage_23.1200007.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="csrf-token" content="2d7ba25b9f496ed95c17a4329ad494e72ed7fff2,3a063148798d7315f4ba188017bd48dad177740b,1710535727"> <meta name="generator" content="Koha 23.12.00" /> <style id="antiClickjack">body{display:none !important;}</style> <link rel="shortcut icon" href="/intranet-tmpl/prog/img/favicon.ico" type="image/x-icon" /> <link type="text/css" rel="stylesheet" href="/intranet-tmpl/lib/jquery/jquery-ui-1.13.2.min_23.1200007.css"> <link type="text/css" rel="stylesheet" href="/intranet-tmpl/lib/bootstrap/bootstrap.min_23.1200007.css"> <link href="/intranet-tmpl/lib/bootstrap/bootstrap-theme.min_23.1200007.css" type="text/css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="/intranet-tmpl/lib/fontawesome/css/fontawesome.min_23.1200007.css"> <link href="/intranet-tmpl/lib/fontawesome/css/brands.min_23.1200007.css" type="text/css" rel="stylesheet"> <link href="/intranet-tmpl/lib/fontawesome/css/solid.min_23.1200007.css" type="text/css" rel="stylesheet"> <link type="text/css" rel="stylesheet" href="/intranet-tmpl/lib/datatables/datatables.min_23.1200007.css"> <link href="/intranet-tmpl/prog/css/print_23.1200007.css" type="text/css" rel="stylesheet" media="print"> <link type="text/css" rel="stylesheet" href="/intranet-tmpl/prog/css/staff-global_23.1200007.css"> <!-- local colors --> <script type="module"> import { APIClient } from '/intranet-tmpl/prog/js/fetch/api-client.js'; window.APIClient = APIClient; </script> <script> var Koha = {}; var CAN_user_parameters_manage_column_config = 1; </script> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36333 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #4 from David Cook <dcook@prosentient.com.au> --- I don't know about this. Surely this would accidentally remove empty lines in unexpected ways? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36333 --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to David Cook from comment #4)
I don't know about this. Surely this would accidentally remove empty lines in unexpected ways?
Maybe, I didn't find any. Did you? I guess it's an hard code to anticipate. We can push and see. Revert will be trivial if needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36333 --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to David Cook from comment #4)
I don't know about this. Surely this would accidentally remove empty lines in unexpected ways?
Maybe, I didn't find any. Did you? I guess it's an hard one to anticipate. We can push and see. Revert will be trivial if needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36333 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Status|Signed Off |Failed QA --- Comment #7 from Nick Clemens <nick@bywatersolutions.com> --- It silently removes blank lines from notices and sysprefs :-( -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org