diff --git a/src/Editors/MarkdownEditor.php b/src/Editors/MarkdownEditor.php index b8889dd..9d1d1c0 100644 --- a/src/Editors/MarkdownEditor.php +++ b/src/Editors/MarkdownEditor.php @@ -22,7 +22,11 @@ public static function component(): Component public static function render(string $content): string { if (class_exists(MarkdownEditorAlias::class)) { - return str($content)->markdown(); + return (new \Illuminate\Support\HtmlString( + str(strip_tags($content)) + ->replace(['prompt(','eval(','<script','markdown() + ))->toHtml(); } return $content; diff --git a/src/Editors/RichEditor.php b/src/Editors/RichEditor.php index 2a38d75..4c3dd47 100644 --- a/src/Editors/RichEditor.php +++ b/src/Editors/RichEditor.php @@ -21,6 +21,8 @@ public static function component(): Component public static function render(string $content): string { - return html_entity_decode($content); + return + str(html_entity_decode($content)) + ->replace(['prompt(','eval(','<script','replace(['prompt(','eval(','<script','asHTML($content); + return tiptap_converter() + ->asHTML( + str(html_entity_decode($content)) + ->replace(['prompt(','eval(','<script','