[CHROMATIC - Sat Aug 24 19:34:04 2002]:
Show quoted text> Please try the attached patch and see if that cures it. (It works
> with my test case.)
Your patch seems to introduce another bug which stops lists that are
followed by paragraphs from being included in the formatted input.
Different patch and test attached.
Kake
--- lib/Text/WikiFormat.pm~ 2002-09-02 09:49:22.000000000 +0100
+++ lib/Text/WikiFormat.pm 2002-09-02 09:50:32.000000000 +0100
@@ -121,7 +121,7 @@ sub format {
if ($active_list and $active_list ne 'paragraph' or !$line) {
pop @{ $lists{paragraph} } unless $line;
$parsed .= end_list(\%lists, $active_list,
- $tags{$active_list});
+ $tags{$active_list}) if $active_list;
}
next unless $line;
--- /dev/null 2002-07-30 14:27:09.000000000 +0100
+++ t/bugs.t 2002-09-02 09:56:24.000000000 +0100
@@ -0,0 +1,29 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+}
+
+use Test::More tests => 3;
+
+use_ok( 'Text::WikiFormat' );
+
+my $wikitext =<<WIKI;
+
+
+ * unordered
+
+Final paragraph.
+
+WIKI
+
+my $htmltext = eval { Text::WikiFormat::format($wikitext) };
+
+is( $@, '',
+ 'format() should throw no warnings for text starting with newlines' );
+
+like( $htmltext, qr!<li>unordered</li>!,
+ 'ensure that lists followed by paragraphs are included correctly' );