From: Moritz Bunkus Date: Thu, 17 Apr 2014 13:02:56 +0000 (+0200) Subject: LaTeX-Escaping von HTML: Newlines am Ende entfernen X-Git-Tag: release-3.2.0beta~467^2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=cbf105b2340879d2381b81148f2cbfe16dfdffbf;p=kivitendo-erp.git LaTeX-Escaping von HTML: Newlines am Ende entfernen --- diff --git a/SL/Template/LaTeX.pm b/SL/Template/LaTeX.pm index 6eb331d60..c76b82a62 100644 --- a/SL/Template/LaTeX.pm +++ b/SL/Template/LaTeX.pm @@ -72,8 +72,10 @@ sub _format_html { $content =~ s{ \r+ }{}gx; $content =~ s{ \n+ }{ }gx; $content =~ s{ (?:\ |\s)+ }{ }gx; + $content =~ s{ (?:\ |\s)+$ }{}gx; + $content =~ s{ (?:
)+$ }{}gx; - my @parts = map { + my @parts = grep { $_ } map { if (substr($_, 0, 1) eq '<') { s{ +}{}g; $html_replace{$_} || ''; @@ -83,7 +85,10 @@ sub _format_html { } } split(m{(<.*?>)}x, $content); - return join('', @parts); + $content = join '', @parts; + $content =~ s{ (?: [\n\s] | \\newline )+$ }{}gx; + + return $content; } my %formatters = (