|
|
|
@ -217,7 +217,7 @@ sub _parse_text {
|
|
|
|
|
elsif ($match eq "((") { |
|
|
|
|
push @{ $self->{footnotes} }, $self->_parse_text($content); |
|
|
|
|
my $n = scalar @{ $self->{footnotes} }; |
|
|
|
|
push @parts, [a => {href => "#note_$n", class => 'footnote'}, $n]; |
|
|
|
|
push @parts, [fn_ref => {}, $n]; |
|
|
|
|
next; |
|
|
|
|
} |
|
|
|
|
elsif ($match) { die("parser failed, unrecognized inline: $match\n"); } |
|
|
|
@ -296,10 +296,8 @@ sub parse {
|
|
|
|
|
my @fn = @{ $self->{footnotes} }; |
|
|
|
|
my @out = (); |
|
|
|
|
for (my $i = 0; $i <= $#fn; $i++) { |
|
|
|
|
my $name = sprintf "note_%d", $i + 1; |
|
|
|
|
push @out, [li => {}, [a => {name => $name}], $fn[$i]]; |
|
|
|
|
push @tree, [footnote => {number => $i + 1}, $fn[$i]]; |
|
|
|
|
} |
|
|
|
|
push @tree, [ol => {}, @out]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return [div => {}, @tree ]; |
|
|
|
|