projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c4ce237
)
LaTeX-Escaping von HTML: Newlines am Ende entfernen
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Thu, 17 Apr 2014 13:02:56 +0000
(15:02 +0200)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Thu, 17 Apr 2014 13:06:24 +0000
(15:06 +0200)
SL/Template/LaTeX.pm
patch
|
blob
|
history
diff --git
a/SL/Template/LaTeX.pm
b/SL/Template/LaTeX.pm
index
6eb331d
..
c76b82a
100644
(file)
--- 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{ (?: <br/?> )+$ }{}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 = (