X-Git-Url: http://wagnertech.de/git?p=kivitendo-erp.git;a=blobdiff_plain;f=SL%2FTemplate%2FPlugin%2FKiviLatex.pm;fp=SL%2FTemplate%2FPlugin%2FKiviLatex.pm;h=920dee49bee42b4c2d260a1dfa872ba758075065;hp=ca40971ce11a8657bf826763249daa4aed657951;hb=b293ff8ad52fc76ba0c44783e3982418114d6b08;hpb=d4925a8b60f04674885e30d9316dc0263f8b9a84 diff --git a/SL/Template/Plugin/KiviLatex.pm b/SL/Template/Plugin/KiviLatex.pm index ca40971ce..920dee49b 100644 --- a/SL/Template/Plugin/KiviLatex.pm +++ b/SL/Template/Plugin/KiviLatex.pm @@ -3,6 +3,8 @@ package SL::Template::Plugin::KiviLatex; use strict; use parent qw( Template::Plugin::Filter ); +use SL::Template::LaTeX; + my $cached_instance; sub new { @@ -55,22 +57,7 @@ my %html_replace = ( sub filter_html { my ($self, $text, $args) = @_; - $text =~ s{ \r+ }{}gx; - $text =~ s{ \n+ }{ }gx; - $text =~ s{ (?:\ |\s)+ }{ }gx; - $text =~ s{ |
    \s*
}{}gx; # Remove lists without items. Can happen with copy & paste from e.g. LibreOffice. - - my @parts = map { - if (substr($_, 0, 1) eq '<') { - s{ +}{}g; - $html_replace{$_} || ''; - - } else { - $::locale->quote_special_chars('Template/LaTeX', HTML::Entities::decode_entities($_)); - } - } split(m{(<.*?>)}x, $text); - - return join('', @parts); + return SL::Template::LaTeX->new->_format_html($text); } sub required_packages_for_html {