|
|
@ -117,4 +117,28 @@ sub codeblock { |
|
|
|
return $out; |
|
|
|
return $out; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub table { |
|
|
|
|
|
|
|
my ($self, $attrs, $content) = @_; |
|
|
|
|
|
|
|
return $content . "\n"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub tr { |
|
|
|
|
|
|
|
my ($self, $attrs, $content) = @_; |
|
|
|
|
|
|
|
return "|" . $content . "\n"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub _cell { |
|
|
|
|
|
|
|
my ($self, $attrs, $content) = @_; |
|
|
|
|
|
|
|
my $cs = $attrs->{colspan} || 1; |
|
|
|
|
|
|
|
my ($pl, $pr); # read as: padding left/right |
|
|
|
|
|
|
|
unless ($attrs->{align}) { ($pl, $pr) = ('', ''); } |
|
|
|
|
|
|
|
elsif ($attrs->{align} eq 'center') { ($pl, $pr) = (" ", " "); } |
|
|
|
|
|
|
|
elsif ($attrs->{align} eq 'left') { ($pl, $pr) = ("", " "); } |
|
|
|
|
|
|
|
elsif ($attrs->{align} eq 'right') { ($pl, $pr) = (" ", ""); } |
|
|
|
|
|
|
|
return $pl . $content . $pr . ("|" x $cs); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub td { my $self = shift; $self->_cell(@_); } |
|
|
|
|
|
|
|
sub th { my $self = shift; $self->_cell(@_); } |
|
|
|
|
|
|
|
|
|
|
|
1; |
|
|
|
1; |
|
|
|