* Peter da Silva <[email protected]> [2008-10-16T07:20:22] > >And then it shows me the "raw" version of my changed version. Not > >the WYSIWYG > >version, which is what I was editing. > > WYSIWYG editing in web page text boxes is hateful. WYSIWYG editing in > text boxes in a Wiki? Oh mamma, the burning.
Yeah, let's talk about that, shall we? Almost all wysiwyg text editors in the browser are implemented with "design mode." Design mode lets you edit a textarea that contains rendered HTML. You type into the box and see what you typed, and there are various JavaScript buttons that let you select a hunk of text and wrap it in (invisible) HTML markup, rendered immediately. Sounds pretty reasonable, as web crap goes! Ha. Let's say you only want users to be able to use <B> and <I> and insert anchors that link to other http resources on your server. Great, you only implement three buttons for that JavaScript. Too bad, though, that every browser I know of (that implements design mode (meaning, all the browsers that matter)) let you paste HTML content directly into the textarea... and you get whatever moronic HTML you had on your clipboard. So, first off, someone can bring up a file in his web browser, select a bunch of the HTML, copy, and paste into your design mode textarea. Now he's gotten some UL and LI and OBJECT tags in there. As if that wasn't bad enough, the OS often knows how to coerce from one type of content into another when pasting. That means that if your user copies a hunk of Word document and pastes it into your wysiwyg editor, you get HTML as generated by MS Word -- a hate unto itself. So, you can post-submit validate to make sure you only got things you wanted, or you can try to disable pasting. In either case, the user only wonders, "Why are you such a fascist that you don't let me use a better editor and then copy and paste? It works $elsewhere!" AAAuuuuuuugh. -- rjbs
