laravel / pail

Dive into your Laravel application's log files directly from the console. 🪣
MIT License
769 stars 21 forks source link

Style [gmail-zeroclipboard-container] not found. #10

Closed Baspa closed 1 year ago

Baspa commented 1 year ago

Laravel Package Version

1.0@beta

Laravel Version

10.28.0

PHP Version

8.2

Database Driver & Version

No response

Description

I'm not sure if this is an actual bug of Laravel Pail, but I just tried to log the output of an email using the package. I did it like this:

logger()->info('InsertMessageDetailToMessage', [
    ...$data,
]);

This is the raw content of the email:

<div dir=3D"ltr"><div class=3D"gmail-highlight gmail-highlight-source-shell=
 gmail-notranslate gmail-position-relative gmail-overflow-auto" dir=3D"auto=
" style=3D"box-sizing:border-box;margin-bottom:16px;color:rgb(173,186,199);=
font-family:-apple-system,&quot;system-ui&quot;,&quot;Segoe UI&quot;,&quot;=
Noto Sans&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&q=
uot;Segoe UI Emoji&quot;;font-size:16px;background-color:rgb(34,39,46);over=
flow:auto"><pre style=3D"box-sizing:border-box;font-family:ui-monospace,SFM=
ono-Regular,&quot;SF Mono&quot;,Menlo,Consolas,&quot;Liberation Mono&quot;,=
monospace;font-size:13.6px;margin-top:0px;margin-bottom:0px;padding:16px;ov=
erflow:auto;line-height:1.45;border-radius:6px;word-break:normal">php artis=
an pail</pre><div class=3D"gmail-zeroclipboard-container gmail-position-abs=
olute gmail-right-0 gmail-top-0" style=3D"box-sizing:border-box"></div></di=
v><br class=3D"gmail-Apple-interchange-newline"></div>

Which results in the following error:

Termwind\Exceptions\StyleNotFound: Style [gmail-zeroclipboard-container] not found.

Steps To Reproduce

Step 1

Create an Laravel Pail log using this data:

<div dir=3D"ltr"><div class=3D"gmail-highlight gmail-highlight-source-shell=
 gmail-notranslate gmail-position-relative gmail-overflow-auto" dir=3D"auto=
" style=3D"box-sizing:border-box;margin-bottom:16px;color:rgb(173,186,199);=
font-family:-apple-system,&quot;system-ui&quot;,&quot;Segoe UI&quot;,&quot;=
Noto Sans&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&q=
uot;Segoe UI Emoji&quot;;font-size:16px;background-color:rgb(34,39,46);over=
flow:auto"><pre style=3D"box-sizing:border-box;font-family:ui-monospace,SFM=
ono-Regular,&quot;SF Mono&quot;,Menlo,Consolas,&quot;Liberation Mono&quot;,=
monospace;font-size:13.6px;margin-top:0px;margin-bottom:0px;padding:16px;ov=
erflow:auto;line-height:1.45;border-radius:6px;word-break:normal">php artis=
an pail</pre><div class=3D"gmail-zeroclipboard-container gmail-position-abs=
olute gmail-right-0 gmail-top-0" style=3D"box-sizing:border-box"></div></di=
v><br class=3D"gmail-Apple-interchange-newline"></div>

and log it like this:

logger()->info('log', [
    $html,
]);
driesvints commented 1 year ago

This doesn't seems like a Laravel Pail issue.

driesvints commented 1 year ago

@Baspa sorry, it does seem this is a Pail issue.

Baspa commented 1 year ago

No problem at all @driesvints. If I can help with anything, please let me know. I'll be happy to help.

nunomaduro commented 1 year ago

@Baspa Can you open a pull request where you escape de content being presented before render it with termwind?

Baspa commented 1 year ago

Fixed in #11