Click here to Skip to main content
15,917,971 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Good morning

I have a issue in ckeditor5
when i write a html code this code is executed after submit

for exemple this code:
HTML
<span style="color;red";>exemple1</span>
is executed after submit and the span color is red
The code is not shown after submit

how can i resolve this issue
thanks

What I have tried:

ckeditor html code issue after submit
Posted
Comments
Richard Deeming 23-May-24 6:56am    
Aside from the syntax errors in the HTML you've provided - it should be style="color:red;", NOT style="color;red"; - you haven't explained what the problem is.

What does "this code is executed" mean? And what does "The code is not shown" mean? You haven't shown any code, just a fragment of HTML.
Richard Deeming 23-May-24 7:15am    
Also, you've mentioned CKeditor 5. That is a rich-text editor which allows you to format input as HTML. If you type in something that looks like HTML markup, CKeditor will HTML-encode it so that it looks identical to what you typed in when you display it in an HTML document.

You can only type raw HTML into the source view, and v5 doesn't have a source view.

If you want to change the colour of some text in the editor, then you need to use the tools in the editor's toolbar to do so.

1 solution

Are you trying to enter code in CKEditor and then execute it? If you are, then the problem exists in the code that you haven't shown us.

As it is, you can't enter HTML directly in CKEditor and expect it to be executed there. It's a text editor, and it is expected to behave just like that.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900