tags:

views:

185

answers:

2

Hi. 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!

+2  A: 

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.

Yi Jiang
@"This line" - The Problem is, all plugins and modules I use are XHTML and create output like <br /> and <img /> etc. So I must rewrite everyone and with update I must do it again and again.@Markdown editorFor me not really a alternativ. I dont like markdown. For normal user its to complex. This my personal opinion.
Katsumi
A: 

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...

AlfonsoML
I dont think so, there are little small editors which work with html and xhtml mode like Tinyeditor 8.8KB(unpacked) without javascript framework.
Katsumi
OK, then use that. Or is it missing some features in those 8.8KB?
AlfonsoML