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