diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 45d9fc930..8f67f6563 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -8,6 +8,7 @@ - fixed #11450: How to lock yourself out of your WebGUI site... - fixed #11402: Survey TAP module requirements - fixed #11453: fileUpload.pl does not handle files with spaces, overwriting + - fixed #11458: Use packed template removes wanted whitespace 7.8.13 - fixed #11418: confusing typ-o in gotcha diff --git a/lib/WebGUI/Asset/Snippet.pm b/lib/WebGUI/Asset/Snippet.pm index 1b8314837..fc8bf3213 100644 --- a/lib/WebGUI/Asset/Snippet.pm +++ b/lib/WebGUI/Asset/Snippet.pm @@ -243,7 +243,6 @@ sub packSnippet { if ( $self->get('mimeType') eq "text/html" ) { HTML::Packer::minify( \$packed, { remove_comments => 1, - remove_newlines => 1, do_javascript => "shrink", do_stylesheet => "minify", } ); diff --git a/lib/WebGUI/Asset/Template.pm b/lib/WebGUI/Asset/Template.pm index 8fb6b2b1c..04082a2ec 100644 --- a/lib/WebGUI/Asset/Template.pm +++ b/lib/WebGUI/Asset/Template.pm @@ -510,7 +510,6 @@ sub packTemplate { my $packed = $template; HTML::Packer::minify( \$packed, { remove_comments => 1, - remove_newlines => 1, do_javascript => "shrink", do_stylesheet => "minify", } ); diff --git a/t/Macro/EditableToggle.t b/t/Macro/EditableToggle.t index 29fb31462..c990bea52 100644 --- a/t/Macro/EditableToggle.t +++ b/t/Macro/EditableToggle.t @@ -237,8 +237,8 @@ sub simpleHTMLParser { sub simpleTextParser { my ($text) = @_; - my ($url) = $text =~ /HREF=(.+?)(LABEL|\Z)/; - my ($label) = $text =~ /LABEL=(.+?)(HREF|\Z)/; + my ($url) = $text =~ /HREF=(.+?)(\n?LABEL|\Z)/; + my ($label) = $text =~ /LABEL=(.+?)(\n?HREF|\Z)/; return ($url, $label); } diff --git a/t/Macro/GroupAdd.t b/t/Macro/GroupAdd.t index 582be72ba..8e9bcd6c8 100644 --- a/t/Macro/GroupAdd.t +++ b/t/Macro/GroupAdd.t @@ -19,6 +19,7 @@ use Data::Dumper; use Test::More; # increment this value for each test you create use HTML::TokeParser; +use JSON qw/from_json/; my $session = WebGUI::Test->session; @@ -157,13 +158,13 @@ sub setupTest { my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"GroupAdd test"}); my $properties = { - title => 'GroupAdd test template', + title => 'GroupAdd test template', className => 'WebGUI::Asset::Template', - url => 'groupadd-test', + url => 'groupadd-test', namespace => 'Macro/GroupAdd', - template => "HREF=\nLABEL=", - # '1234567890123456789012' - id => 'GroupAdd001100Template', + template => qq|{"HREF":"",\n"LABEL":""}|, + # '1234567890123456789012' + id => 'GroupAdd001100Template', usePacked => 1, }; my $asset = $defaultNode->addChild($properties, $properties->{id}); @@ -187,8 +188,8 @@ sub simpleHTMLParser { sub simpleTextParser { my ($text) = @_; - my ($url) = $text =~ /HREF=(.+?)(LABEL|\Z)/; - my ($label) = $text =~ /LABEL=(.+?)(HREF|\Z)/; + my $json_data = from_json($text); + my ($url, $label) = @{ $json_data }{qw/HREF LABEL/}; return ($url, $label); } diff --git a/t/Macro/GroupDelete.t b/t/Macro/GroupDelete.t index 6e3b48cc1..eb3803a80 100644 --- a/t/Macro/GroupDelete.t +++ b/t/Macro/GroupDelete.t @@ -187,8 +187,8 @@ sub simpleHTMLParser { sub simpleTextParser { my ($text) = @_; - my ($url) = $text =~ /HREF=(.+?)(LABEL|\Z)/; - my ($label) = $text =~ /LABEL=(.+?)(HREF|\Z)/; + my ($url) = $text =~ /HREF=(.+?)(\n?LABEL|\Z)/; + my ($label) = $text =~ /LABEL=(.+?)(\n?HREF|\Z)/; return ($url, $label); } diff --git a/t/Macro/H_homeLink.t b/t/Macro/H_homeLink.t index 61e0be123..951996d67 100644 --- a/t/Macro/H_homeLink.t +++ b/t/Macro/H_homeLink.t @@ -121,8 +121,8 @@ sub simpleHTMLParser { sub simpleTextParser { my ($text) = @_; - my ($url) = $text =~ /HREF=(.+?)(LABEL|\Z)/; - my ($label) = $text =~ /LABEL=(.+?)(HREF|\Z)/; + my ($url) = $text =~ /HREF=(.+?)(\n?LABEL|\Z)/; + my ($label) = $text =~ /LABEL=(.+?)(\n?HREF|\Z)/; return ($url, $label); } diff --git a/t/Macro/LoginToggle.t b/t/Macro/LoginToggle.t index dde519766..c5940941a 100644 --- a/t/Macro/LoginToggle.t +++ b/t/Macro/LoginToggle.t @@ -170,8 +170,8 @@ sub simpleHTMLParser { sub simpleTextParser { my ($text) = @_; - my ($url) = $text =~ /HREF=(.+?)(LABEL|\Z)/; - my ($label) = $text =~ /LABEL=(.+?)(HREF|\Z)/; + my ($url) = $text =~ /HREF=(.+?)(\n?LABEL|\Z)/; + my ($label) = $text =~ /LABEL=(.+?)(\n?HREF|\Z)/; return ($url, $label); } diff --git a/t/Macro/a_account.t b/t/Macro/a_account.t index 772948e6f..ad9154357 100644 --- a/t/Macro/a_account.t +++ b/t/Macro/a_account.t @@ -116,8 +116,8 @@ sub simpleHTMLParser { sub simpleTextParser { my ($text) = @_; - my ($url) = $text =~ /HREF=(.+?)(LABEL|\Z)/; - my ($label) = $text =~ /LABEL=(.+?)(HREF|\Z)/; + my ($url) = $text =~ /HREF=(.+?)(\n?LABEL|\Z)/; + my ($label) = $text =~ /LABEL=(.+?)(\n?HREF|\Z)/; return ($url, $label); } diff --git a/t/Macro/r_printable.t b/t/Macro/r_printable.t index b0aa4e518..adf721d57 100644 --- a/t/Macro/r_printable.t +++ b/t/Macro/r_printable.t @@ -144,8 +144,8 @@ sub simpleHTMLParser { sub simpleTextParser { my ($text) = @_; - my ($url) = $text =~ /HREF=(.+?)(LABEL|\Z)/; - my ($label) = $text =~ /LABEL=(.+?)(HREF|\Z)/; + my ($url) = $text =~ /HREF=(.+?)(\n?LABEL|\Z)/; + my ($label) = $text =~ /LABEL=(.+?)(\n?HREF|\Z)/; return ($url, $label); }