Feed Sign in with OpenID OpenID

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.

View blog reactions

Next: Pingback specification

Previous: New IXR soon

11 comments

  1. I think an editor written in Macromedia Flash is the way forward... now browser compatibility issues for starters http://www.illogicz.com/flashmx/texteditor/ is a good example of what can be done.

    Peter - 5th September 2002 10:25 - #

  2. Yup, that's the one that inspired us to build our Flash editor. One solution to browser compatibility issues could be to have normal textareas and convert them in to editors using an IE behvaiours / Mozilla XBL file attached to the textarea via CSS. The script could use the DOM to replace the textarea with a more flashy editor in those browsers, while other browsers would just see the normal textarea.

    Simon - 5th September 2002 11:29 - #

  3. In my opinion, copy and paste from Word is crucial for professional editing. You simply can't expect professional writers to adopt a new editing/writing tool. - and you can't expect that tool to get to the level of sophistication of Word within a few years. I don't have the right solution. But for now, how hard would it be to rework the crap Word sends you (it doesn't get worse than that so I use that as an example) as valid xhtml? Long, but it would be a lot easier than writing a new editor.

    PeterV - 5th September 2002 15:18 - #

  4. I agree you need to copy and paste content from Word - my point is you really, really need to lose the formatting information. The real trick would be to second-guess the structure of the document from the Word styles - but that would only work if the people making the document were using a logical method of styling their document. Personally I've never seen the attraction of Word, but then I'm hardly a professional writer :) The Word angle is very interesting though, and something I hadn't really thought about until now.

    Simon - 5th September 2002 15:46 - #

  5. I've tried tools that convert word using the styles used, but the mark-up produce is far from semantic. (Loads of empty tags etc.) IMHO, the only way that could work is if the writers are restricted to particular (structural) styles during writing. Then you *might* be able to get useful code out of it. The flash editor looks interesting though...

    Alastair - 5th September 2002 17:20 - #

  6. Why Flash? Does it have a bigger installed base than Java? Java is extremely flexable. Why, you could even have the applet commit the document straight to the database/server, your applets pick up the local look and feel, there is a great toolkit... I personally don't see the advantage of Flash.

    Mark - 5th September 2002 19:00 - #

  7. Actually, Flash /does/ have a bigger install base than Java :) Macromedia frequently claim that 95% of browsers support Flash. I would be amazed if Java was that widespread now that it is no longer included with Windows XP (none of my browsers support Java and I'm a web developer, so the chances of less technical users getting it if it isn't already on their machine are pretty slim).

    Simon - 5th September 2002 20:31 - #

  8. Flash also seems to crash browsers less than the java plugin. Simon: did you realise that the comments number shown on the page is wrong? It keeps on showing 0 and I can't find the threads I posted comments to ;-)

    Peter - 7th September 2002 18:34 - #

  9. Ugh, Java. I've disabled Java on my machine full-stop. It might be useful once in a while, and it might be able to be pulled off well, but every single thing I've seen done in it has been slow. clunky and has crashed my machine / browser often enough to make me bother to go and disable it.

    Lach - 8th September 2002 10:03 - #

  10. Hi. Just found your email while searching info for rich text emails. I am fetching emails from pop3 server using a pop3 component. Can U pls.tell how one can identify rich text emails and how can i display them. Kindly do the needful and oblige

    Vipul Bhatt - 19th July 2003 14:16 - #

  11. I want to get a flash based rich text editor. Any good ideas?

    ���议 - 29th July 2005 14:48 - #

Comments are closed.

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

A django site