|
|
@ -233,14 +233,15 @@ sub parse { |
|
|
|
$linenum++; |
|
|
|
$linenum++; |
|
|
|
|
|
|
|
|
|
|
|
if ($mode =~ m!block/(file|code|nowiki)!o) { |
|
|
|
if ($mode =~ m!block/(file|code|nowiki)!o) { |
|
|
|
|
|
|
|
my $tag = $1; |
|
|
|
$buf ||= []; |
|
|
|
$buf ||= []; |
|
|
|
if ($line =~ m{^\s*</$1>}o) { |
|
|
|
if ($line =~ m{^\s*</$tag>}o) { |
|
|
|
$buf = join("\n", @{ $buf }); |
|
|
|
$buf = join("\n", @{ $buf }); |
|
|
|
if ($1 eq 'file') { |
|
|
|
if ($tag eq 'file') { |
|
|
|
my $dt = [dt => {}, $attrs->{file}]; |
|
|
|
my $dt = [dt => {}, $attrs->{file}]; |
|
|
|
my $dd = [dt => {}, [pre => {class => $attrs->{class}}, $buf]]; |
|
|
|
my $dd = [dt => {}, [pre => {class => $attrs->{class}}, $buf]]; |
|
|
|
push @tree, [dl => {class => 'file'}, [$dt, $dd]]; |
|
|
|
push @tree, [dl => {class => 'file'}, [$dt, $dd]]; |
|
|
|
} elsif ($1 eq 'nowiki') { |
|
|
|
} elsif ($tag eq 'nowiki') { |
|
|
|
push @tree, [pre => {}, $buf]; |
|
|
|
push @tree, [pre => {}, $buf]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
push @tree, [code => {class => $attrs->{class}}, $buf]; |
|
|
|
push @tree, [code => {class => $attrs->{class}}, $buf]; |
|
|
|