Web Hosting Talk







View Full Version : Online Code Editor Issue


Syphic
02-24-2009, 07:40 PM
Alright, I have been writing my own online editor and am using the designmode to do the color highlighting and to show line number. However, when in mozilla you hit enter it puts a br tag in the code. I need to identify these differently than if someone types in a br themselves. Any ideas?
One Solution: Find and Replace the br added and then add a class to it so at the end it knows to change them out for forward slash n's. Problem is finding the right one on what line? etc.
Two Solution: Made designmode when hitting enter do something other than br's or p? But cant find a way to do this unless through javascript which is what I am checking now.
Three Solution: Find a way to show forward n's /n instead of br's in designmode?
Questions:
Could I make design mode show forward slash n's /n? instead of having to use br's?
Has anyone made one of these before and could be of any assistance or give some advice? I have figured all this out on my own so far but asking questions always helps.
Any thoughts would be helpful.

Syphic
02-24-2009, 08:58 PM
Some Light: Alright, I figured out with jquery I can grab the specific item and grab it html style however it does not work when doing submit but only when doing through keyup or keydown. Does the .submit in jquery clear everything because it says the variable is null when before it has value.