From 555c7cc609504fcb8eaaaaa3d7dfb4ff2297e507 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 19 Jan 2018 11:21:44 +0100 Subject: [PATCH] LaTeX-Druck: Unicode-Control-Zeichen und nicht druckbare Zeichen entfernen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Filtert z.B. das »bidirectional left-to-right«-Kontroll-Zeichen raus, an dem sich LaTeX verschluckt. --- SL/Template/LaTeX.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SL/Template/LaTeX.pm b/SL/Template/LaTeX.pm index c85529ced..da0967ba7 100644 --- a/SL/Template/LaTeX.pm +++ b/SL/Template/LaTeX.pm @@ -123,6 +123,9 @@ sub format_string { // $formatters{ $self->{default_content_type} } // $formatters{ text }; + $content =~ s{[^\p{Print}]|\p{Cf}}{}g; + $variable =~ s{[^\p{Print}]|\p{Cf}}{}g; + return $formatter->($self, $content, variable => $variable); } -- 2.20.1