|
|
@ -200,25 +200,22 @@ sub _parse_text { |
|
|
|
$line = substr($after, $endpos + 2); |
|
|
|
$line = substr($after, $endpos + 2); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
my %attrs; |
|
|
|
my ($tag, %attrs); |
|
|
|
if ($match eq "//") { %attrs = ('font-style' => 'italic'); } |
|
|
|
if ($match eq "//") { $tag = 'i'; } |
|
|
|
elsif ($match eq "**") { %attrs = ('font-weight' => 'bold'); } |
|
|
|
elsif ($match eq "**") { $tag = 'b'; } |
|
|
|
elsif ($match eq "''") { %attrs = ('font-family' => 'monospace'); } |
|
|
|
elsif ($match eq "__") { $tag = 'u'; } # should be rendered as <span style=""> |
|
|
|
elsif ($match eq "__") { %attrs = ('text-decoration' => 'underline'); } |
|
|
|
elsif ($match eq "''") { $tag = 'code'; } |
|
|
|
elsif ($match eq "{{") { push @parts, $self->_parse_include($content); next; } |
|
|
|
elsif ($match eq "{{") { push @parts, $self->_parse_include($content); next; } |
|
|
|
elsif ($match eq "[[") { push @parts, $self->_parse_link($content); next; } |
|
|
|
elsif ($match eq "[[") { push @parts, $self->_parse_link($content); next; } |
|
|
|
elsif ($match eq "((") { |
|
|
|
elsif ($match eq "((") { |
|
|
|
push @{ $self->{footnotes} }, $self->_parse_text($content); |
|
|
|
push @{ $self->{footnotes} }, $self->_parse_text($content); |
|
|
|
my $n = scalar @{ $self->{footnotes} }; |
|
|
|
my $n = scalar @{ $self->{footnotes} }; |
|
|
|
push @parts, [sup => {}, [a => {href => "#note_$n"}, $n]]; |
|
|
|
push @parts, [a => {href => "#note_$n", class => 'footnote'}, $n]; |
|
|
|
next; |
|
|
|
next; |
|
|
|
} |
|
|
|
} |
|
|
|
elsif ($match) { die("unrecognized inline: $match\n"); } |
|
|
|
elsif ($match) { die("parser failed, unrecognized inline: $match\n"); } |
|
|
|
|
|
|
|
|
|
|
|
if (%attrs) { |
|
|
|
push @parts, [$tag => \%attrs, $self->_parse_text($content)]; |
|
|
|
push @parts, [span => \%attrs, $self->_parse_text($content)]; |
|
|
|
|
|
|
|
next; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return @parts; |
|
|
|
return @parts; |
|
|
|