JiHong88 / suneditor

Pure javascript based WYSIWYG html editor, with no dependencies.
http://suneditor.com
MIT License
1.67k stars 308 forks source link

Don't F**k with HTML option #1320

Closed bobwoofix closed 3 months ago

bobwoofix commented 9 months ago

Seriously, there should be a 'Don't F**k with My HTML' option. I don't understand why so much of the HTML is being changed, deleted or wrapped with some custom tags.

melloware commented 5 months ago

We have incorporated SunEditor in PrimeFaces Extensions and missing this ability to not touch the HTML is the biggest complaint have gotten so far about SunEditor: https://www.primefaces.org/showcase-ext/sections/sunEditor/basicUsage.jsf

rider87 commented 4 months ago

Any plans here? Without such option this Editor is completely useless.

JiHong88 commented 4 months ago

It is designed that way to process formats such as images and tables. If everything is done in free form, it is difficult to select or edit images or etc. This is my lack of skill. In version 3.0.0, I modifying it so that users can select it step by step.

Before updating to version 3.0.0, I will add 'strictMode' to the next version to prevent HTML clean-related tasks.

And you can temporarily disable it as follows:

editorInstance.core.cleanHTML = function (html) {return html;}
editorInstance.core.convertContentsForEditor = function (html) {console.log(html);return html;}
melloware commented 4 months ago

awesome @JiHong88 !!!

bobwoofix commented 3 months ago

Thanks heaps for your help with this -- let me know if I can assist in some way.

BTW what version do these functions work on? -- and what do they do?

JiHong88 commented 3 months ago

It is version 2. It is difficult to change many things in the current version. I'll simply added an option that does not force the HTML format to be modified.

Version 3 is currently under development and is almost complete. https://github.com/JiHong88/suneditor/tree/version/3