I create a mini-application where users can paste any texts & share it. Let's say the user inputs these texts below.
Ex.
╔══╗
╚╗╔╝
╔╝(¯`v´¯)
╚══`.¸.[Stackoverflow]
When I load it on textarea, it displays correctly.
But when I return raw of that
I kept getting display inline (broken)
╔══╗ ╚╗╔╝ ╔╝(¯`v´¯) ╚══`.¸.[Stackoverflow]
All I did was this
public function raw($uuid)
{
$paste = Paste::where('uuid', base64_decode($uuid))->first();
if($paste->type == 'json'){
return response()->json($paste->data);
} else {
return $paste->raw;
}
}
How can I maintain the same format as I would have render it in my textarea ?
Ex 2.
▀██▀─▄███▄─▀██─██▀██▀▀█
─██─███─███─██─██─██▄█
─██─▀██▄██▀─▀█▄█▀─██▀█
▄██▄▄█▀▀▀─────▀──▄██▄▄█
As you can see in raw it displays so bad ...
▀██▀─▄███▄─▀██─██▀██▀▀█ ─██─███─███─██─██─██▄█ ─██─▀██▄██▀─▀█▄█▀─██▀█ ▄██▄▄█▀▀▀─────▀──▄██▄▄█
Edit
If I wrap it around pre tag
return '<textarea style="width: 100%; height: 100%;">'. $paste->raw.'</textarea>';
I get a better result

