advoor / nova-editor-js

Editor JS field for Laravel Nova
92 stars 54 forks source link

generateHtmlOutput Renders encoded HTML entities #79

Closed percymamedy closed 1 year ago

percymamedy commented 2 years ago

When using \Advoor\NovaEditorJs\NovaEditorJs::generateHtmlOutput it automatically encodes html entities in the returned HtmlString object returned:

image

Then when using blade to output this string it shows as html tags which is not what we want:

image

I had to use this work around to make it work:

{!! html_entity_decode(\Advoor\NovaEditorJs\NovaEditorJs::generateHtmlOutput($content->body_default)) !!}

This does not work also:

{{ \Advoor\NovaEditorJs\NovaEditorJs::generateHtmlOutput($content->body_default) }}
roelofr commented 2 years ago

This should've been fixed by 510fea4ce8e959de29cc890ce661a5ebbbabd056. Are you using the most up-to-date views (or haven't published them)?

percymamedy commented 2 years ago

I am using the latest version of the package which 3.1.0

roelofr commented 2 years ago

Apologies for the slow reply.

Your exported views are likely outdated. You may want to compare them against the current versions in this repository.

If you haven't changed the views (or if you're comfortable using Git to check your changes), you may run the following command to overwrite your views with the package's default one:

Warning This will overwrite any changes made to the views, so use with caution.

php artisan vendor:publish --provider="Advoor\NovaEditorJs\FieldServiceProvider" --tag=views --force

I hope this resolves this issue.