Skip to content

New lines in querys in exception page breaks frontend and built-in syntax on the page #57246

@Marfjeh

Description

@Marfjeh

Laravel Version

12.32.5

PHP Version

8.4.13

Database Driver & Version

12.0.2-MariaDB-ubu2404 (Docker)

Description

Hi,

There is a frontend issue, where in the layout and syntax highlighter breaks on the query component, this also causes text to overlay on other components on the page.

The problem happens here:

It shows like this:
Image
(Note that i'm using a monospaced font as default browser font)

Steps To Reproduce

Make sure to create a model you can create a item to the database. in this example i've used the model Audit.

Make the changes to bootstrap/app.php look like this:

<?php

use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;

return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        web: __DIR__.'/../routes/web.php',
        commands: __DIR__.'/../routes/console.php',
        health: '/up',
    )
    ->withMiddleware(function (Middleware $middleware) {
        //
    })
    ->withExceptions(function (Exceptions $exceptions) {
        \App\Models\Audit::create([
            'log' => "A long text \n Look i'm on a new line! \n Another new line! \n Wheeee! \n We also break syntax! select from\n a new line! \n a new line! \n a new line! \n a new line!\n a new line! \n a new line! \n a new line! \n a new line\n a new line! \n a new line! \n a new line! \n a new line\n a new line! \n a new line! \n a new line! \n a new line!!!"
        ]);
    })->create();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions