Content Editable Text Editors

后端 未结 2 1667
没有蜡笔的小新
没有蜡笔的小新 2020-12-05 08:23

I have tried out several HTML editors including TinyMCE, CKEditor and now NicEdit. NicEdit is good in one respect - it is very easy to customize. However, I have found tha

2条回答
  •  [愿得一人]
    2020-12-05 09:12

    Having spent a great deal of time trying to find ways of ensuring that I get production grade HTML out of a WYSIWYG editor I thought I should share my results here for the benefit of anyone running into this thread.

    Very brief recommendation - stop wasting your time. Content editable editors are never going to deliver anything even remotely close to production grade HTML. People like Reinmar have done a great deal of work to minimize this but it is all too easy for the user to throw the underlying browser code that handles content editable into a tizzy.

    You are better off using BBCode markup. The 100% bullet proof option is to make the user edit the BBCode and keep a tight reign on what he/she is allowed to do at any point. I have done this in my own project but the issue with making non-techie users play with markup of any description is a tricky one. Putting your own WYSIWYG interface for BBCode editing is a job not to be undertaken lightly. Luckily, help is at hand in the form of SCEditor. Sam has done an outstanding job here. Be aware - what comes out can still contain a few "soupy" bits since the WYSIWYG bit still relies on content editable. However, it is relatively easy to clean up.

提交回复
热议问题