Subject: | Nesting forces ends to previous lists. |
In a nest like the following (where # is ordered and * is unordered):
# =1
# =2
## =2.1
##* =2.1.a
##* =2.1.b
## =2.2
# =3
The generated list looks like this:
1 =1
2 =2
1 =2.1
* =2.1.a
* =2.1.b
1 =2.2
1 =3
The attached patch fixes this so that the generated HTML looks like this:
1 =1
2 =2
1 =2.1
* =2.1.a
* =2.1.b
2 =2.2
3 =3
Subject: | text-wikiformat-nests.diff |
--- /usr/local/share/perl/5.8.7/Text/WikiFormat.pm 2006-07-27 10:06:46.000000000 -0400
+++ lib/Ximbiot/Text/WikiFormat.pm 2006-09-01 15:33:02.000000000 -0400
@@ -131,7 +131,6 @@
if exists $newtags->{blockorder} or exists $newtags->{blocks};
my @blocks = find_blocks( $text, \%tags, $opts );
- @blocks = merge_blocks( \@blocks );
@blocks = nest_blocks( \@blocks );
return process_blocks( \@blocks, \%tags, $opts );
}
@@ -157,7 +156,7 @@
my ($text, $tags, $opts) = @_;
my @blocks;
- for my $line ( split(/\n/, $text) )
+ for my $line ( split(/\r?\n/, $text) )
{
my $block = start_block( $line, $tags, $opts );
push @blocks, $block if $block;
@@ -182,14 +181,6 @@
}
my $marker_removed = length ($line =~ s/$tags->{blocks}{$block}//);
- if ($block eq 'code')
- {
- $level = 0;
- $marker_removed = 1;
-
- # don't remove the indent, but do remove the code indent
- ($line = $text) =~ s/$tags->{blocks}{code}//;
- }
next unless $marker_removed;
--- /usr/local/share/perl/5.8.7/Text/WikiFormat/Blocks.pm 2006-07-27 10:06:46.000000000 -0400
+++ lib/Ximbiot/Text/WikiFormat/Blocks.pm 2006-09-01 15:29:23.000000000 -0400
@@ -120,6 +120,7 @@
{
my ($self, $next_block) = @_;
+ return unless $next_block = $self->merge ($next_block);
return $next_block unless $self->nests() and $next_block->nests();
return $next_block unless $self->level() < $next_block->level();