[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[perl #9385][PATCH] Pod::HTML problem



Attached is a small patch for Pod::Html (against Pod::Html 1.09_04).

-- 
Renée Bäcker
renee.baecker@smart-websolutions.de

XING: http://www.xing.com/profile/Renee_Baecker
Foo-Magazin: http://foo-magazin.de

--- Html.pm.orig	2008-06-30 12:03:43.000000000 +0200
+++ Html.pm	2008-06-30 12:02:32.000000000 +0200
@@ -308,6 +308,7 @@
     # now convert this file
     my $after_item;             # set to true after an =item
     warn "Converting input file $Podfile\n" if $Verbose;
+    my $is_pre = 0;
     foreach my $i (0..$#poddata){
         $_ = $poddata[$i];
         $Paragraph = $i+1;
@@ -348,7 +349,18 @@
         else {
             next if $Ignore;
             next if @Begin_Stack && $Begin_Stack[-1] ne 'html';
-            print HTML and next if @Begin_Stack && $Begin_Stack[-1] eq 'html';
+
+            if( @Begin_Stack && $Begin_Stack[-1] eq 'html' and /<\/pre>/ ){
+                $is_pre = 0;
+            }
+
+            if( @Begin_Stack && $Begin_Stack[-1] eq 'html' and /<pre>.*?(?<!<\/pre>)/ ){
+                $is_pre = 1;
+            }
+
+            my $nl = $is_pre ? "\n\n" : "\n";
+            print HTML ($_,$nl) and next if @Begin_Stack && $Begin_Stack[-1] eq 'html';
+
             my $text = $_;
 
             # Open tag for definition list as we have something to put in it

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]