Browse Source

* fix warning

master
Zubrikhin Alexey 10 years ago
parent
commit
465309ee72
  1. 7
      lib/Text/Dokuwiki/Parser.pm

7
lib/Text/Dokuwiki/Parser.pm

@ -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];

Loading…
Cancel
Save