开发者

ckeditor problem: extra html tags in source

开发者 https://www.devze.com 2022-12-25 19:25 出处:网络
I 开发者_如何学编程am creating an editor in asp.net MVC application using ckeditor. In textarea i have just written \"Sample Text\", but when i load the ckeditor and click on source button of ckeditor

I 开发者_如何学编程am creating an editor in asp.net MVC application using ckeditor. In textarea i have just written "Sample Text", but when i load the ckeditor and click on source button of ckeditor it gives me a lot of html like html > body > p > [Sample Text]. Why its creating extra html tags?? i have to send the content to database for saving html but ckeditor is adding extra markups.

any workaround? or what i am doing worng?


If it outputs html and body tags it's because you have set the fullPage to true (the default is false as most of the people don't want that)


People are usually using WYSIWYG editors on the web sites to let people enter some nice looking text.

To do that the editor is automatically wrapping the text that was entered by the consumer with the html tags. In this way, when the text will be then shown separately on the page, it will look exactly like you entered it.

There is no way of how to make the text looks great without using html tags. If you don't believe, open simple notepad editor and try to create nice looking text with paragraphs, images, etc. You couldn't do that.

So, at the very end, after editing of the text in WYSIWYG editor complete, the editor prepares entered text wrapped with HTML.

In other words, you will always has HTML if you use WYSIWYG editor.

If you don't want html, use simple textarea or text input tag on the page.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号