projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Konfigurierbares Angebotsgültigkeits-Intervall hinzugefügt
[kivitendo-erp.git]
/
SL
/
Template
/
LaTeX.pm
diff --git
a/SL/Template/LaTeX.pm
b/SL/Template/LaTeX.pm
index
4bb4ce6
..
c76b82a
100644
(file)
--- a/
SL/Template/LaTeX.pm
+++ b/
SL/Template/LaTeX.pm
@@
-71,9
+71,11
@@
sub _format_html {
$content =~ s{ \r+ }{}gx;
$content =~ s{ \n+ }{ }gx;
$content =~ s{ \r+ }{}gx;
$content =~ s{ \n+ }{ }gx;
- $content =~ s{ \s+ }{ }gx;
+ $content =~ s{ (?:\ |\s)+ }{ }gx;
+ $content =~ s{ (?:\ |\s)+$ }{}gx;
+ $content =~ s{ (?: <br/?> )+$ }{}gx;
- my @parts = map {
+ my @parts =
grep { $_ }
map {
if (substr($_, 0, 1) eq '<') {
s{ +}{}g;
$html_replace{$_} || '';
if (substr($_, 0, 1) eq '<') {
s{ +}{}g;
$html_replace{$_} || '';
@@
-83,7
+85,10
@@
sub _format_html {
}
} split(m{(<.*?>)}x, $content);
}
} split(m{(<.*?>)}x, $content);
- return join('', @parts);
+ $content = join '', @parts;
+ $content =~ s{ (?: [\n\s] | \\newline )+$ }{}gx;
+
+ return $content;
}
my %formatters = (
}
my %formatters = (
@@
-589,7
+594,7
@@
sub parse_and_create_pdf {
my $error;
eval {
my $error;
eval {
- my $template = SL::Template::LaTeX->new(
$template_file_name, $local_form, \%::myconfig, $::lx_office_conf{paths}->{userspath}
);
+ my $template = SL::Template::LaTeX->new(
file_name => $template_file_name, form => $local_form
);
my $result = $template->parse($tex_fh) && $template->convert_to_pdf;
die $template->{error} unless $result;
my $result = $template->parse($tex_fh) && $template->convert_to_pdf;
die $template->{error} unless $result;