Hey, I'm writing a small script to format C code with html to make it more presentable on my site-- making different aspects of the code a certain color. I'm having some trouble though.. finding every occurance of the strings is easy enough, but it's inserting the necessary html just before and after each occurance of the string that is getting to me. For example, at the beginning of a comment I may want to stick a:
<font color="#999999">
tag in there, and an ending </font> tag right after. The ending tag is fine, I can do that.. it's just inserting something before the comment (or whatever string I'm working with) that has me hung up .. I hope this makes sense .. any ideas?