What's the standard way to show code on a website with having it be parsed? ( think that's the word i want)
What do here http://testing.isaacg.net/commentboxa/ seems to work on some browsers. Other times it looks like a waterfall of broken blocks of code, instead of code in one big square or stack of even squares.
question about posting code
question about posting code
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Re: question about posting code
Do you mean such that it preserves whitespace? Use <pre></pre>. Make sure to escape any special HTML characters inside of the <pre></pre>. Also, tabs are evil. Use some power of two # of spaces instead, say 4. Almost all text editors support this.
Re: question about posting code
Thanks, I'll check that out. Also, I just realized that < characters are converted into that &223kj23k stuff on our code blocks:
I guess that's what I should be doing. Then I could just use regular divs.
Code: Select all
<b>This is some code.</b>
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Re: question about posting code
Spaces are a good way to break your spacebar (that may be a bit of an exaggeration), but luckily many editors also automagically convert between one and the other depending on preferences/the format of the rest of the file/etc. It does help that a space is always one character in fixed-width, whereas tabs seem to be rendered by some things as 4 and others as 8. VS's "tabify"/"untabify" commands can be handy like that... not that I'm even sure that's a real word, but hey, you get the point...
Re: question about posting code
To clarify, by "tab," I mean the '\t' character. The key is fine, as long as it isn't outputting '\t' characters. This is what I meant by text editor support--that they support using spaces for indentation when you press the tab key.
The worst is when a file has mixed tabs and spaces... gah.
Isaac, if I recall, the only two characters you have to worry about escaping inside of pre's are '<' and '&', since the rest can't become special without those two first, but if you're dealing with dynamic content, it's best to just use a library function for the escaping.
The worst is when a file has mixed tabs and spaces... gah.
Isaac, if I recall, the only two characters you have to worry about escaping inside of pre's are '<' and '&', since the rest can't become special without those two first, but if you're dealing with dynamic content, it's best to just use a library function for the escaping.
Re: question about posting code
Thanks guys. The changes to my text editors, for the tab thing, is a quick fix. As for the < and &, that should also be pretty easy to fix.
Oh and jeff:
I know MySQL fundamentals.
I'm finding it really user friendly and the 5.1 user manual really easy to follow. I'm now friends with the mysql terminal. So I've moved on to the python mysqldb module to continue my mysql practice. All of this is on my own laptop, not my webserver. The Ubuntu repos did make installing everything really easy. I'll eventually make a new ajax chat application with this in the near future. Lots of fun!
Oh and jeff:
I know MySQL fundamentals.
I'm finding it really user friendly and the 5.1 user manual really easy to follow. I'm now friends with the mysql terminal. So I've moved on to the python mysqldb module to continue my mysql practice. All of this is on my own laptop, not my webserver. The Ubuntu repos did make installing everything really easy. I'll eventually make a new ajax chat application with this in the near future. Lots of fun!
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Re: question about posting code
Yes. Hate.Jeff250 wrote:The worst is when a file has mixed tabs and spaces... gah.