'need help getting rid of javascript commands in ckeditor
I am currently working on a small project to create a simple social media web app and i am using Laravel. I used CK editor to make the posts in my media , but i found out that,I can use Javascript commands from the editor by going to the source code section. How can i make it so that the commands don't run but also at the same time have a option to have bold, italic and different fonts and headers.
The following is my code for posting the posts or text;
*<div class="flex justify-center">
<div class="w-9/12 p-3 bg-stale-700 " >
@if ($posts->count())
@foreach ($posts as $post)
<div class="mb-4 p-4 bg-gray-300 rounded " >
<a href="" class="font-bold" > {{$post->user->username}} </a>
<span class=" p-3 text-sm"> {{$post->created_at->toTimeString()}} </span>
{!!$post->body!!}
</div>
@endforeach
{{ $posts->links('pagination::tailwind') }}
@else
There are no posts
@endif
<div>*
The following is the code for ckeditor:
*<form action="{{route('post')}}" method="post" >
@csrf
<textarea name="post"></textarea>
<script>
CKEDITOR.replace( 'post' );
</script>
@error('post')
<p class=" small-text red-200 "> This feild is required </p>
@enderror
<br>
<button class="bg-transparent hover:bg-blue-500 text-blue-700 font-semibold hover:text-white py-2 px-4 border border-blue-500 hover:border-transparent rounded"> post </button>
</form>*
If possible, I am looking for editor like stackoverflow has, Thank you
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
