Simon Willison’s Weblog

Browser based rich text editing

Scott wants a rich text editor for Mozilla. What’s more, he’s willing to put his money where his mouth is and organise a fund drive to give developers a real incentive to do a good job.

At Incutio we have a long history of messing around with rich text editors. I wrote an IE DHTML editor (similar to the one used by Radio Userland) least year which is still in use in our flagship CMS. We are currently looking at replacing it with a Flash editor, which will give us both cross platform compatibility and a better level of control over the HTML. Put simply, MSHTML generated code is absolutely revolting. It’s made worse by the fact that people can cut and paste from Word, Excel and even other IE windows, preserving the formatting every time. Great for picky users but a nightmare for us web developers who are trying to keep the visual look of a site constant. And you can forget about standards compliance...

With CSS finally at a stage where we can properly start to separate structure from presentation I think WYSIWYG editors are far less relevant today than they were a year ago. XHTML is about semantic markup, with presentational stuff being relegated to the site developer controlled stylesheet (where it rightly belongs). Any page editing tools need to concentrate on helping users mark up content in a meaningful way rather than letting them chose their favourite colours and fonts.

That said, I strongly believe that the Mozilla project should invest considerable effort in browser based editing tools. Web based interfaces are here to stay, and a lot of people spend large chunks of their day creating content in a browser. Rather than relying on wizzy and unstable javascript tricks though I think we should go back to basics and reconsider the textarea. Imagine a textarea element that, when double clicked, spawned a brand new editing environment in a new window with all of the tools of a modern text editor. Or how about the option to spawn Composer (Mozilla’s built in HTML editor) with the contents of a textarea, then click a button to have your newly created HTML dumped right back there? I haven’t looked at Composer properly so I have no idea how standards compliant it is (or isn’t) but it’s already built in to the Mozilla suite—why not integrate it with the one part of the browser that needs it the most?

At the end of the day, I suppose anything that enables more people to publish to the web has to be a good thing—especially if it enables more people to make the switch from IE :)

Incidentally, xopus.org have an interesting partial implementation of contentEditable for Mozilla. They have also just released the open source version of their impressive browser based XML editor. One to watch.

This is Browser based rich text editing by Simon Willison, posted on 4th September 2002.

Next: Pingback specification

Previous: New IXR soon

Previously hosted at http://simon.incutio.com/archive/2002/09/04/browserBasedRichTextEditing