Browse Source

* add support of plaintext/markdown to zerobin

master
Alex 'AdUser' Z 9 years ago
parent
commit
c549c5b6e6
  1. 5
      public/css/zerobin.css
  2. 12
      templates/zerobin/view.html.ep

5
public/css/zerobin.css

@ -15,6 +15,11 @@ pre code {
background-color: #777777; background-color: #777777;
} }
div.paste {
padding: 20px;
border: 1px dotted #777777;
}
/* imgbin */ /* imgbin */
div.img-preview { div.img-preview {
margin: 5px; margin: 5px;

12
templates/zerobin/view.html.ep

@ -10,10 +10,14 @@
</span> </span>
</div> </div>
<br/> <br/>
<div class="paste">
% my $paste = (stash 'paste') || {}; % my $paste = (stash 'paste') || {};
% my $syntax = $paste->{syntax}; % if (not $paste->{syntax} or $paste->{syntax} eq 'plaintext') {
% my @opts = ($syntax and $syntax ne 'auto') ? (class => $syntax) : (); %= b(plaintext($paste->{data}));
<div> % } elsif ($paste->{syntax} eq 'markdown') {
<pre><%= tag 'code' => (@opts) => $paste->{data}; %></pre> %= b(markdown($paste->{data}));
% } else {
<pre><%= tag 'code' => (class => $paste->{syntax}) => $paste->{data}; %></pre>
% }
</div> </div>
</div> </div>

Loading…
Cancel
Save