]> wagnertech.de Git - mfinanz.git/commitdiff
HTML zu LaTeX: gewisse kaputte Konstrukte vom CKEditor entfernen
authorMoritz Bunkus <m.bunkus@linet.de>
Tue, 23 Feb 2021 11:16:58 +0000 (12:16 +0100)
committerMoritz Bunkus <m.bunkus@linet.de>
Tue, 23 Feb 2021 11:16:58 +0000 (12:16 +0100)
Dazu gehören leere Listen <ul></ul> oder Paragraphen mit
Zeilenumbrüchen und non-breakable spaces <p><br><br>&nbsp;</p>

SL/Template/LaTeX.pm

index bc03eb3bb06cd90c60bba71d97b43806e4901796..293db2e18c5bbb58cb495563026aa3c18134867d 100644 (file)
@@ -83,6 +83,8 @@ sub _format_html {
   $content =~ s{ (?:\&nbsp;|\s)+ }{ }gx;
   $content =~ s{ (?:\&nbsp;|\s)+$ }{}gx;
   $content =~ s{ (?: <br/?> )+$ }{}gx;
+  $content =~ s{ <ul>\s*</ul> | <ol>\s*</ol> }{}igx;
+  $content =~ s{ (?: <p>\s*</p>\s* )+ \Z }{}imgx;
 
   my @parts = grep { $_ } map {
     if (substr($_, 0, 1) eq '<') {