|
|
|
@ -49,10 +49,12 @@ sub create {
|
|
|
|
|
$self->access_allowed($self->app->config->{zerobin}->{access}) |
|
|
|
|
or return; |
|
|
|
|
|
|
|
|
|
my @syntax = ($self->c(text => ['plaintext', 'markdown'])); |
|
|
|
|
my $langs = $self->app->config->{zerobin}->{syntax}; |
|
|
|
|
push @syntax, $self->c(code => $langs) |
|
|
|
|
if (ref($langs) eq 'ARRAY'); |
|
|
|
|
my @syntax = qw(auto); |
|
|
|
|
my $syntax = [ @{ $self->app->config->{zerobin}->{syntax} } ]; |
|
|
|
|
while (my ($cat, $list) = splice(@{ $syntax }, 0, 2)) { |
|
|
|
|
next unless $cat and ref($list) and ref($list) eq 'ARRAY'; |
|
|
|
|
push @syntax, $self->c($cat => $list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$self->stash({syntax => \@syntax}); |
|
|
|
|
$self->render; |
|
|
|
|