1
0
mirror of https://gitlab.com/depesz/explain.depesz.com.git synced 2024-11-28 08:58:52 +02:00

Unescape .csv quotes

This commit is contained in:
Alexandre Felipe 2022-07-12 15:13:52 +01:00
parent 9bca31ab04
commit ff0d6f73ab

View File

@ -84,6 +84,15 @@
%# vi - visibility of "inclusive" column
%# ...
%sub csv_unescape {
% my $s = shift;
% $s = "\n${s}\n";
% $s =~ s/((?<=\n)[\t ]*")|("[\t ]*(?=\r?\n))//g;
% $s =~ s/""/"/g;
% return $s;
%}
% my @cookie = grep { $_->name eq 'explain' } @{ $self->req->cookies };
% my $cookie = scalar @cookie ? Mojo::ByteStream->new( $cookie[0]->value )->url_unescape : '';
@ -824,7 +833,7 @@
</div>
<div class="result-source res-tab hidden">
<pre id="source"><code class="<%= lc( $explain->source_format ) =%>"><%= $explain->source =%></code></pre>
<pre id="source"><code class="<%= lc( $explain->source_format ) =%>"><%= csv_unescape($explain->source) =%></code></pre>
<button class="copy">Copy source to clipboard</button>
</div>