simple, cross-browser rich text editor - does it exist?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
mindplay
Forum Commoner
Posts: 25
Joined: Sat Sep 16, 2006 1:32 pm

simple, cross-browser rich text editor - does it exist?

Post by mindplay »

I need a simple, cross-browser, XHTML-compliant, WYSIWYG rich-text editor.

Something lightweight. Nothing like FCKEditor or TinyMCE, that is.

I have seen editors like nicEdit, Whizzywig and MooEditable, all of which are great! But all of them suffer from the same flaw - they're not really cross-browser; that is, the behavior of the ENTER key is unpredictable - sometimes breaks, sometimes paragraphs.

Apparently, this problem is far more complicated than you would think. The ENTER key behavior method in TinyMCE, for example, is 220 lines of code - and that's just the method itself, not all of the DOM-management, range-handling, etc. that it relies on.

It doesn't look like there's any simple solution to this problem. Semantic, consistent XHTML is an absolute requirement for the projects I work on, and therefore we can't use any of these editors.

Quick fixes have been attempted by several of them, including MooEditable and Whizzywig, which I've been trying to fix for months myself. But it seems rather hopeless...

I'm to the point where I consider dropping WYSIWYG-editing altogether. If the only alternative is 150+KB of mostly unused JavaScript, in the form of TinyMCE or FCKEditors (the only two editors I know of that handle the ENTER key correctly), maybe my customers would be better off using a simple markup of some sort.

Needless to say, a lot of them would object strongly to that.

Has anyone ever heard of a scalable editor, or editor of reasonable size, that handles the ENTER key, and correctly produces paragraphs? I must have tried out 30-40 editors at this point, and if it exists, I'm not finding it...

Any help/ideas would be greatly appreciated!
mindplay
Forum Commoner
Posts: 25
Joined: Sat Sep 16, 2006 1:32 pm

Re: simple, cross-browser rich text editor - does it exist?

Post by mindplay »

(sorry, not bumping, just need to subscribe to this post, and there doesn't seem to be a link to do that...)
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: simple, cross-browser rich text editor - does it exist?

Post by pickle »

If you're using the default template, there's a "Subscribe topic" near the top of the posts.

What you're asking for is not simple. It's simple to describe, but certainly not to implement. Your customers would certainly have smaller, cleaner code if they hand coded itself, but generally the customer that wants a WYSIWYG editor is not the kind of customer that can do it by hand.

Here's a lightweight, jQuery based, super simple editor: http://www.ajaxbestiary.com/2007/11/13/ ... in-jquery/ .
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
mindplay
Forum Commoner
Posts: 25
Joined: Sat Sep 16, 2006 1:32 pm

Re: simple, cross-browser rich text editor - does it exist?

Post by mindplay »

pickle wrote:Here's a lightweight, jQuery based, super simple editor: http://www.ajaxbestiary.com/2007/11/13/ ... in-jquery/ .
Yeah, still no paragraphs in FF2...
mindplay
Forum Commoner
Posts: 25
Joined: Sat Sep 16, 2006 1:32 pm

Re: simple, cross-browser rich text editor - does it exist?

Post by mindplay »

I am now leaning towards a server-side solution - stripping and cleaning the posted HTML, transforming double-breaks into paragraphs, etc...

It seems solving this problem on the client-side is simply not feasible.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: simple, cross-browser rich text editor - does it exist?

Post by Kieran Huggins »

WYMeditor looks promising, but it's not what I would consider truly complete yet.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: simple, cross-browser rich text editor - does it exist?

Post by Eran »

Kieran, thanks for the WYMeditor link! The RTE issue is a painful one and this one looks promising.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: simple, cross-browser rich text editor - does it exist?

Post by Kieran Huggins »

I live to give :mrgreen:
mindplay
Forum Commoner
Posts: 25
Joined: Sat Sep 16, 2006 1:32 pm

Re: simple, cross-browser rich text editor - does it exist?

Post by mindplay »

Thanks, Kieran - I knew about WYMEditor, but it's not exactly WYSIWYG. And, unfortunately, that's what most clients want - try telling them, but they just don't know what's good for them ;-)

I remember examining WYMEditor and finding it to be, basically, a WYSIWYG editor with a peculiar stylesheet. But since it has the required functionality, I wonder if it would be possible to replace it's stylesheet to achieve something more WYSIWYG like... hmm...

For the time being, I like nicEdit, which I have been started trying to modify to better suit my needs. It too does not consistently do paragraphs, but uses a simpler approach and at least consistently does breaks - currently I've settled for a simple solution where double-breaks are transformed to paragraphs on the server-side. It's not what I wanted, but it's the best I can do right now, it seems...
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Re: simple, cross-browser rich text editor - does it exist?

Post by matthijs »

mindplay wrote:Thanks, Kieran - I knew about WYMEditor, but it's not exactly WYSIWYG. And, unfortunately, that's what most clients want - try telling them, but they just don't know what's good for them ;-)

I remember examining WYMEditor and finding it to be, basically, a WYSIWYG editor with a peculiar stylesheet. But since it has the required functionality, I wonder if it would be possible to replace it's stylesheet to achieve something more WYSIWYG like... hmm...
If I look at the demo of WYMEditor it does work like a WYSIWYG. What's about it thats not? I really do like the approach. Using semantic elements which are styled the normal way. Much better then having people write real HTML (and forgetting to close elements etc)

It's always so annoying when clients start 'designing' the content of web pages. Have you spend hours fine-tuning the typography of the website, they come and start making everything big and red, underlined while not being links, etc etc. Normally when they ask me how to do stuff like that I just tell them they can't. Or at least that they have a limited set of markup (headers, paragraphs, bold, links etc) they can use and that it's in their best interest to leave the styling to me (the stylesheet).
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: simple, cross-browser rich text editor - does it exist?

Post by Kieran Huggins »

matthijs wrote:It's always so annoying when clients start 'designing' the content of web pages. Have you spend hours fine-tuning the typography of the website, they come and start making everything big and red, underlined while not being links, etc etc. Normally when they ask me how to do stuff like that I just tell them they can't. Or at least that they have a limited set of markup (headers, paragraphs, bold, links etc) they can use and that it's in their best interest to leave the styling to me (the stylesheet).
matthijs++

I refuse to give people "font access" in wysiwyg editors - instead giving them a subset of tags and classes. Makes a world of difference!
Post Reply