|
|
@ -237,17 +237,11 @@ sub parse { |
|
|
|
$level = 7 - $level; # invert |
|
|
|
$level = 7 - $level; # invert |
|
|
|
push @tree, ["h$level" => {}, $+{header}]; |
|
|
|
push @tree, ["h$level" => {}, $+{header}]; |
|
|
|
} elsif ($text =~ m/\G$rx->{codeblock}/cgi) { |
|
|
|
} elsif ($text =~ m/\G$rx->{codeblock}/cgi) { |
|
|
|
if ($+{tag} eq 'file' and $+{filename}) { |
|
|
|
my $attrs = {}; |
|
|
|
my $attrs = $+{syntax} ? {class => $+{syntax}} : {}; |
|
|
|
$attrs->{type} = $+{tag}; |
|
|
|
my $dt = [dt => {}, $+{filename}]; |
|
|
|
$attrs->{file} = $+{filename} if $+{filename}; |
|
|
|
my $dd = [dt => {}, [pre => $attrs, $+{block}]]; |
|
|
|
$attrs->{syntax} = $+{syntax} if $+{syntax}; |
|
|
|
push @tree, [dl => {class => 'file'}, [$dt, $dd]]; |
|
|
|
push @tree, [codeblock => $attrs, $+{block}]; |
|
|
|
} elsif ($+{tag} eq 'file') { |
|
|
|
|
|
|
|
push @tree, [pre => {class => 'file'}, $+{block}]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
my $attrs = $+{syntax} ? {class => $+{syntax}} : {}; |
|
|
|
|
|
|
|
push @tree, [code => $attrs, [pre => {}, $+{block}]]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} elsif ($text =~ m/\G$rx->{table}/cgi) { |
|
|
|
} elsif ($text =~ m/\G$rx->{table}/cgi) { |
|
|
|
my $lines = $+{table}; |
|
|
|
my $lines = $+{table}; |
|
|
|
chomp $lines; |
|
|
|
chomp $lines; |
|
|
|