1 geespot May 30, 2006 23:02
3 edb Jun 01, 2006 00:20
stk wrote:
Note: A tool I used to use to convert snippets of code to display-ready code, can be found at Dan Cederholm's site ... it's called [url=http://www.simplebits.com/cgi-bin/simplecode.pl]SimpleCode[/url] ... just paste in your bits of code you want to display, hit "process" and it spits out converted, display-ready code, inside of <code> tags.
Hey cool! That's the code I tweaked into my hackin* so long ago. The site used to be html & javascript, and disappeared for the longest time. The only reason I had it was because I snagged a local copy. Nice to see it's back online!
Oh and you don't really need to make >s be >s because b2evo, as you pointed out, only gets excited when it thinks a tag is about to open. Also if you're pasting in code with a blank line you'll need to put a on it so the formatting you apply to the <code> tag will jump the gap. I've no idea why that it. It just is.
--------------------
* hackin: a freshly minted word to identify a plugin that required hacking. For example everything everyone ever did for every version prior to 1.6 ;)
Unfortunately, the <code> tag (besides designating - correctly - that what follows is "code") does nothing, in and of itself, in XHTML.
The problem is that the program (b2evolution) sees the "<" and thinks to itself ... "aha ... a tag is coming up" and tries to do whatever is in the tag.
IF you want to display a code snippet (as text) in your blog and not have the program try to INTERPRET it, then you need to convert certain characters (>, <, namely) to entity values.
"<" should be written as <
">" should be writeen as >
For your example, your code snippet (in the post) should look like:
, which the html-checker should then "pass", without difficulty.
Hope this helps.
Note: A tool I used to use to convert snippets of code to display-ready code, can be found at Dan Cederholm's site ... it's called [url=http://www.simplebits.com/cgi-bin/simplecode.pl]SimpleCode[/url] ... just paste in your bits of code you want to display, hit "process" and it spits out converted, display-ready code, inside of <code> tags.