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;
}
div.paste {
padding: 20px;
border: 1px dotted #777777;
}
/* imgbin */
div.img-preview {
margin: 5px;

12
templates/zerobin/view.html.ep

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

Loading…
Cancel
Save