Index: TML2HTML.pm =================================================================== --- TML2HTML.pm (revision 5733) +++ TML2HTML.pm (working copy) @@ -343,6 +343,7 @@ # line-oriented stuff. my $inList = 0; # True when within a list type my $inTable = 0; # True when within a table type + my $hadTable = 0; my %table = (); my $inParagraph = 1; # True when within a P my @result = ('

'); @@ -356,6 +357,10 @@ $inParagraph = 0; $this->_addListItem( \@result, '', '', '' ) if $inList; $inList = 0; + unless ( $hadTable ) { + $hadTable = 1; + push( @result, '

' ) + } push( @result, _processTableRow( $1, $inTable, \%table ) ); $inTable = 1; next; @@ -373,6 +378,8 @@ $inList = 0; push( @result, '

' ) if $inParagraph; $inParagraph = 0; + push( @result, '
' ) if $hadTable; + $hadTable = 0; my ( $indicator, $heading ) = ( $1, $2 ); my $class = 'TML'; if ( $heading =~ s/$Foswiki::regex{headerPatternNoTOC}//o ) { @@ -393,6 +400,8 @@ # Blank line push( @result, '

' ) if $inParagraph; $inParagraph = 0; + push( @result, '' ) if $hadTable; + $hadTable = 0; $line = '

'; $this->_addListItem( \@result, '', '', '' ) if $inList; $inList = 0; @@ -406,6 +415,8 @@ # Definition list push( @result, '

' ) if $inParagraph; $inParagraph = 0; + push( @result, '' ) if $hadTable; + $hadTable = 0; $this->_addListItem( \@result, 'dl', 'dd', $1, '' ); $inList = 1; @@ -415,6 +426,8 @@ # Definition list push( @result, '

' ) if $inParagraph; $inParagraph = 0; + push( @result, '' ) if $hadTable; + $hadTable = 0; $this->_addListItem( \@result, 'dl', 'dd', $1, '' ); $inList = 1; @@ -424,6 +437,8 @@ # Unnumbered list push( @result, '

' ) if $inParagraph; $inParagraph = 0; + push( @result, '' ) if $hadTable; + $hadTable = 0; $this->_addListItem( \@result, 'ul', 'li', $1, '' ); $inList = 1; @@ -433,6 +448,8 @@ # Numbered list push( @result, '

' ) if $inParagraph; $inParagraph = 0; + push( @result, '' ) if $hadTable; + $hadTable = 0; my $ot = $3; $ot =~ s/^(.).*/$1/; if ( $ot !~ /^\d$/ ) {