
How to build a desktop WYSIWYG editor with WebKit and HTML 5 - pclark
http://arstechnica.com/open-source/guides/2009/07/how-to-build-a-desktop-wysiwyg-editor-with-webkit-and-html-5.ars
======
euroclydon
Is this only interesting because of the desktop angle and how little code it
takes with GTK/Python, or are Webkit and HTML5 making browser-based WYSIWYG
editors better somehow too?

~~~
jacobolus
Well, if actually implemented by browsers, HTML5's contentEditable makes in-
browser editors better. I’m not sure whether there are compatible
implementations in all the major browsers yet... so you might not be able to
rely on it for web apps.

~~~
tdonia
designMode is already implemented/used by a lot of rich text editors. Usually,
they have an iframe with designMode turned on, capture the code generated and
then run a clean up process to fix inconsistencies. That said, it's no panacea
- the current implementations are not consistent at all - the code generated
in designMode by the rendering engine can become quite ugly pretty quickly.
Hopefully with the HTML5 execution there will be a bit more attention and care
for this as it is really useful and a core part of Tim Berners-Lee's original
vision - every page, editable.

~~~
axod
designMode is absolutely horrible though. When you press enter in the edit
box, some browsers add a <br> tag, some start a new <p> tag, etc etc. It's a
complete mess.

Also the API is ridiculous.

    
    
      editableDocument.execCommand("Bold", false, null);
    

execCommand? seriously?

~~~
olavk
I wrote an article for Opera about designMode and contentEditable:
[http://dev.opera.com/articles/view/rich-html-editing-in-
the-...](http://dev.opera.com/articles/view/rich-html-editing-in-the-browser-
part-1/) You are right it is messy. The API as apparently modelled over the
IOleCommandTarget which is a Microsoft API for document-toolbar integration.
They probably never expected it to become a cross-platform standard.

~~~
axod
Thanks, useful article. I hope one day they standardize that stuff into a
usable DOM API.

