deathshadow - I have been having a good play around with your code. Boy am I glad that you replied to my initial question here because this code is so good and can be tailored to style the arduino code exactly as it appears in the Arduino IDE and that is just the tip of the iceberg no doubt :) Thank you so much Pedro
Oh, one little side note -- in production this is NOT something I'd be doing client-side. I may enhance it client-side with the scripting to turn off highlighting and select the element, but the processing of the file I'd be handling server-side in a language like PHP.
In fact, having a PHP parser could be handier since you could then be sure all the specialchars are escaped properly, and you could just point at the actual file and read it in with something like file_get_contents.
The calling convention for that could turn out quite nice, something like:
Where $fileName would be the file of the source code -- thich could then read in the file and spit it out all nice and well formatted.
I might take a stab at implementing that later today.
As I am sure you are now aware, I am very much a rank beginner with all this deathshadow .. hey we all have to start somewhere but pity i didn't start until age 59 :) So I assume that if the script is to be run server side, the arduinoCode script and "some" other associated coding is stored on the server and a "call" is made to the server when the arduinoCode section in the html of the webpage is to be displayed in the browser. I tailored you script to format some Arduino code and I put it up at my test site at http://www.pedrosdigitalsolutions.com/code_1.html Just as a side not if you did happen to use the page nav on that page it would take to some rather old and very ugly early examples of my initial coding forays - not pretty. I also realise that you are not a fan of my scroll boxes but these are all just different techniques that I am trying out at this stage in my "quest to code" I know you optimised one piece of my Arduino code but at this stage I am concentrating on the website displaying of it so I am still using examples of my dinosaur Arduino code in these pages, plus I haven't touched any Arduino code or hardware ever since I typed my first <html> :) I would be really interested in seeing how you script could be implemented server side with php