views:

36

answers:

1

When creating a cross-browser rich text editor. Which would you use and why?

Keep in mind that pasting has to be resilient to stand against multiple sources (notepad, word, other websites) and it should not be dependent on any Javascript libraries.

A: 

You probably want contentEditable. designMode applies to the document, contentEditable to a specific element and its children.

http://blog.whatwg.org/the-road-to-html-5-contenteditable

jvenema
... and neither of them are a satisfactory solution at this time. I've sort of given up on so called rich-text editing (which I just assume to be a synonym for WYSIWYG editors) and stuck to Markdown.
Yi Jiang
@Yi Jiang - I did find some resources on MarkDown but the editing part looks like a form of "wiki" format, which will not be suitable for our users. Do you have an example of a MarkDown WYSIWYG editor that does on-the-fly conversion as the user edits?
Gary
@jvenema - Isn't RTE encapsulated by an iFrame which makes the rich text editor a 'document'? If that's the case then wouldn't contentEditable and designMode actually the same thing in the context of which it applies to?
Gary
If you're using an iframe, I'd assume you're correct; never having implemented a RTE completely myself, I'm not sure though.
jvenema
From your article, I found some more info relating that contentEditable attribute and that we're not going need to use iFrame anymore. html5demos.com/contenteditable w3.org/TR/html5/editing.html#contenteditable This blog helped also: http://nagoon97.wordpress.com/2008/04/20/differences-between-designmode-and-contenteditable/Thanks.
Gary