ckeditor textarea output as html tags in browser. I am using laravel 5.2 and mysql database. How to fix this issue? - ckeditor

I want to get the textarea data and show in browser. I am using CKEditor with textarea. But textarea data show with html tags as output.
In the editor I write "This is textarea" but it displays as <p>This is text textarea</p> in browser.
Trying to set up configuration of ckeditor config.js file from the documentation with 'config.htmlEncodeOutput = true' and 'config.basicEntities = false'. But it doesn't work.
<textarea name="post_description" id="editor" cols="30" rows="15" class="form-control"></textarea>

You need to properly escape strings that contain HTML tags so that they are formatted by browser engine. In Laravel you can simply change where you display your content from:
{{ $text }}
to
{!! $text !!}

Related

ck editor content does not displaying as html in frontend

My website is in Laravel. I am makeing about-us page in ckeditor on the Admin side.On the admin end, it works fine. I save the content json_encoded in DB. Issue is that when i want to display it on the front end side it displays the content as string . Have a look at result
what i am doing in blade.php is here
Your current output is escaped(safe-printed) by default, try printing the content by using:
#if (isset($about?->about))
{!! json_decode($about->about) !!}
#endif
Read more: Laravel Docs: Displaying Unescaped Data

Using ckeditor i have stored description but in view i got the data with <p> tag how can i solve it?

When I am storing something using ekeditor in my Laravel project, I got the data in view the data with a <p> tag. How can I store my data without a <p> tag
Result:
<p>good<\p>
Expected result:
good
use textarea instead of CKEditor if you don't want tags to be stored.
otherwise, you can try this.
if you use {{ $data->xyz }} , it will show texts with tags. So use {!! $data->xyz !!} , it won't show tags but will convert in html codes.

Prevent TinyMce in Joomla to modify inserted html code

I'm using joomla (last version) and just added this template in tinymce :
<a href="/test" class="darkimagediv">
<img src="/images/logo2.png">
<div>
<div>
Test
</div>
</div>
</a>
It displays fine in the popup dialog just before inserting, but when I do it is inserted like that:
<p><a class="darkimagediv" href="test"> <img src="images/logo2.png" /></a></p>
<div>
<div>Test</div>
</div>
<p> </p>
Which is very bad.
I'm superuser and text filtering is off in the global configuration. I don't find any cleanup option in tinymce, so I need to find which script modify my html but I don't even know if I must search tinymce or joomla itself.
If you are pasting code Don't use a rich text editor.
The editor is doing what it is supposed to and correcting your incorrect markup. Either way, if you want to insert markup, incorrect or not, then don't use a rich text editor.

ckeditor Disable HTML correction

I am using the ckeditor in Kentico tool.
There is an
getting added for empty div.
Example-
is transformed to
<div id="ctl00_fullLayoutDiv">
<div class="main-block" id="ctl00_divMainBlock"> </div>
</div>
Please provide any solution to remove the
getting added automatically to empty div in ckeditor.

CKEditor HTML Autocorrection Issue

I have few lines of HTML in my database. I want to edit the content in CKEditor. But when I open that in editor the HTML gets break down. The HTML gets rearranged.
Below is the HTML which is in database:
<span class="sec_title">
<h1><span>Web</span> Engineering</h1>
<hr>
</span>
And when I open it in CKEditor the HTML looks likes below:
<h1><span class="sec_title"><span>Web</span> Engineering</span></h1>
<hr />
Some one please help me. I tried config.allowedContent = true; but it is also not stopping the CKEditor to do the modifications.
CKEditor works with a valid HTML only and <h1> is not a valid content of <span>. Quoting CKEditor basic concepts:
CKEditor is not a tool that will let you input invalid HTML code. CKEditor abides by W3C standards so it will modify code if it is invalid.

Resources