From 69e0114b38e2bf174655d6cc5da63e6f168527cf Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 3 Apr 2014 16:53:23 +0200 Subject: [PATCH] KiviLatex-Template-Plugin: leere Listen entfernen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Das sind Einträge, die im HTML so aussehen: LaTeX schmeißt beim Äquivalent (\begin{itemize} \end{itemize}) Fehler. Kann z.B. via Copy & Paste aus LibreOffice passieren. --- SL/Template/Plugin/KiviLatex.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/SL/Template/Plugin/KiviLatex.pm b/SL/Template/Plugin/KiviLatex.pm index 6683574fe..ca40971ce 100644 --- a/SL/Template/Plugin/KiviLatex.pm +++ b/SL/Template/Plugin/KiviLatex.pm @@ -58,6 +58,7 @@ sub filter_html { $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 '<') { -- 2.20.1