Javascript Rich Text Editor w/ Syntax Highlighting

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

jayshields wrote:I cna tpye hwo i wana ok!?
Not if you want answers. :)
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

lol. Sorry :( I will type like a pro frmo nwo on :(
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Different text colors in a text area can be accomplished, but I am not sure how to make it dynamic. I know from some of my previous CMS development projects that IE displays HTML as the browser would display when it loads in a textarea, maintaining HTML tags and styles within the textarea.

FCK Editor (no, not the other word) is a very flexible client side rich text editor. Maybe you can combine the server-side functionality of GeSHi with the client side functionality of FCK to get what you want?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

I have spent years working with the mshtml (HTML WYSIWYG) object and writting my own code editors from scratch, both in C++ using it's native interfaces and in javascript...

I have tried a few times to write a solid code editor using just javascript and I'm sure it's possible...but likely very slow to execute...

Without revealing all my secrets (I only partially support OSS movements)... :P

First off, rendering a structured data format (ie: HTML) is ALOT more time consuming than a linear data format...like source code

So using a HTML editor as a source code editor...isn't the best idea...

The easiest approach, but likely painfully slow (I tried a while back)...is basically wrap each keyword, etc with a span and it's associated class ID...

Using regex to locate comments, keywords, etc...

Everytime the buffer changes though, first stripping all HTML tags...on anything of decent size...is untolerable in speed :)

Good luck with that!!! :)

Cheers
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post by pilau »

jayshields wrote:lol I just read your post and thought, hhmm, not usually like to me to use bad grammar, read over my post, and you did misinterpret it a little.

It's only a forum anyway, I cna tpye hwo i wana ok!?
:D Good one man. Tyep howreve uyo wtan ot, no pbrolme.
Post Reply