|
|
|
@ -49,6 +49,7 @@ sub _content_save {
|
|
|
|
|
|
|
|
|
|
unless (ref $content) { |
|
|
|
|
my $asset = Mojo::Asset::File->new; |
|
|
|
|
utf8::encode($content); |
|
|
|
|
$asset->add_chunk($content); |
|
|
|
|
$content = $asset; # wrap plaintext to Mojo::Asset |
|
|
|
|
} |
|
|
|
@ -65,8 +66,10 @@ sub _content_load {
|
|
|
|
|
die("paste content not found\n") unless (-f $path); |
|
|
|
|
my $asset = Mojo::Asset::File->new(path => $path); |
|
|
|
|
$asset->cleanup(0); |
|
|
|
|
my $content = $asset->slurp; |
|
|
|
|
utf8::decode($content); |
|
|
|
|
|
|
|
|
|
return $asset->slurp; |
|
|
|
|
return $content; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sub create { |
|
|
|
|