开发者

very cool wysiwyg jquery editor problem with browsers design mode

开发者 https://www.devze.com 2023-01-12 04:59 出处:网络
I have founded a great jquery wysiwyg (rich edit editor), but its use \"browsers design mode\" to create the html and with this it create HTML and not XHTML.

I have founded a great jquery wysiwyg (rich edit editor), but its use "browsers design mode" to create the html and with this it create HTML and not XHTML.

Link: http://premiumsoftware.net/cleditor/

owner says:

"CLEditor takes advantage of the browsers design mode feature and does not generate any HTML itself. When you click a button or popup item, a command is sent to the browser and the browser determines the actual HTML to insert into the document."

All of my code(CMS,...) in website is XHTML, 开发者_运维百科so I can not go back to HTML. I think about a HTML to XHTML converter, but this is very ugly. In this time I store HTML in database and receive HTML for the output in textarea and for website i must convert html to xhtml. Is here a good light converter in php for HTML to XHTML?

It is possible to say these "browsers design mode" to create XHTML?

Thanks!


The problem with WYSIWYG is that HTML is a markup language - it shouldn't contain any of the stylistic information one would expect from a WYSIWYG editor, thus the HTML generated is usually of a very poor quality when compared to hand written code. In addition to all that, getting a rich text editor working cross browser is extremely difficult, thus almost all of them uses (what I consider) a fairly hackish method involving an iframe and some Javascript mumbo jumbo...

What I suggest is that you work with a What You See is What You Mean (WYSIWYM) editor, much like the wmd + Markdown combination employed here at SO. This is almost guaranteed to create higher quality code than WYSIWYG editors like the one you suggested. You can have a look at it here: http://github.com/derobins/wmd


This line

All of my code(CMS,...) in website is XHTML, so I can not go back to HTML.

Is quite disturbing to me - XHTML should normally be a strict subset of HTML, so you shouldn't have any problem in 'going back' to HTML.

Browser design mode refers to one of the new/old specifications which are about to be introduced in HTML5. See

http://dev.opera.com/articles/view/rich-html-editing-in-the-browser-part-1/
http://blog.whatwg.org/the-road-to-html-5-contenteditable

for more information. Its nothing groundbreaking - the code generated is just as rubbish.


It's always the same.

You can choose to use a very simple editor that uses just the browser contentEditable features and it's restricted to the behavior that each browser provides or you can go for a more complex editor that takes care of providing uniform output, control what kind of markup is generated, etc...

0

精彩评论

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