Do not remove newlines from Templates (or Snippets) since HTML::Packer does not handle newlines with H::T syntax. Fixes bug #11458
This commit is contained in:
parent
17067470e9
commit
d0884afb59
10 changed files with 21 additions and 21 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
} );
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
} );
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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=<tmpl_var group.url>\nLABEL=<tmpl_var group.text>",
|
||||
# '1234567890123456789012'
|
||||
id => 'GroupAdd001100Template',
|
||||
template => qq|{"HREF":"<tmpl_var group.url>",\n"LABEL":"<tmpl_var group.text>"}|,
|
||||
# '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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue