X-Git-Url: https://git.distorted.org.uk/~mdw/odin-cgi/blobdiff_plain/7f77ead8af9c6100f0bf4f259b5be780c4b0d86f..969db1ef94e92c88afaa35b683918b2bf33b87f0:/mason/pastebin/%show diff --git a/mason/pastebin/%show b/mason/pastebin/%show index 6ec0bb2..9e6afab 100644 --- a/mason/pastebin/%show +++ b/mason/pastebin/%show @@ -19,14 +19,17 @@ "$Odin::PASTEBIN/$tag" |h %> % } -
% if ($lang eq 'txt') { +<% $content |h %>\ -% } else { ++% } elsif ($lang =~ /^hl:(.*)$/) { +<%perl> + my $hl_lang = $1; my $kid = open my $fh, "-|" // die "fork: $!"; if ($kid == 0) { - open my $hl, "|-", "highlight", "-Ohtml", "-f", "-t8", "-S$lang" + open my $hl, "|-", "highlight", "-Ohtml", "-f", "-t8", "-S$hl_lang" or die "open highlight: $!"; syswrite $hl, $content // die "highlight write: $!"; close $hl or die "highlight kid: $!, $?"; @@ -37,8 +40,17 @@ or die "highlight parent: $!, $?"; } %perl> -% }+% } else { +++I don't know how to display content with language + ‘<% $lang |h %>’. This is a bug in the Pastebin program. + Here's the raw text, in case that's useful. +
+<% $content |h %>\ ++% } &> %# <%args>