2 title => Odin::escapify($m, $title) . " (odin.gg Paste Bin)" &>
3 <h1><tt>odin.gg</tt> Paste Bin: <% $title %></h1>
5 <span class="item"><a href="<% "$Odin::PASTEBIN/$tag?op=raw" |h %>">Raw</a></span>
7 <span class="item"><a href="<% "$Odin::PASTEBIN/$tag?edit=$edit" |h %>">Edit</a></span>
9 <span class="item"><a href="<% "$Odin::PASTEBIN/" |h %>">New</a></span>
11 % if (defined $honc) {
13 <p>Your browser doesn't appear to be accepting my cookies.
14 <p>Don't share the link to this page with other people. <b>If you do,
15 they'll be able to edit this paste just as you can</b>, using the
16 <b>Edit</b> link at the top of the page.
17 <p>Instead, share this link:
18 <a href="<% "$Odin::PASTEBIN/$tag" |h %>"><%
19 "$Odin::PASTEBIN/$tag" |h %></a>
22 % if ($lang eq 'txt') {
26 % } elsif ($lang =~ /^hl:(.*)$/) {
28 % filter "highlight", $m, $content,
29 % "highlight", "-Ohtml", "-f", "-t8", "-S$1";
31 % } elsif ($lang eq "md") {
32 % filter "markdown", $m, $content,
33 % "markdown", "-fnohtml,autolink,safelink,footnote";
36 <p>I don't know how to display content with language
37 ‘<% $lang |h %>’. This is a bug in the Pastebin program.
38 Here's the raw text, in case that's useful.
56 my $db = Odin::open_db;
63 my ($what, $m, $content, @cmd) = @_;
64 my $kid = open my $fh, "-|" // die "fork: $!";
66 open my $hl, "|-", @cmd or die "open $what: $!";
67 syswrite $hl, $content // die "$what write: $!";
68 close $hl or die "$what kid: $!, $?";
71 while (sysread $fh, my $buf, 8192) { $m->print($buf); }
72 close $fh and waitpid $kid, 0
73 or die "$what parent: $!, $?";