Haloscan's default setup for including comments is to use a javascript command in the href attribute, ie:

<a href="javascript:HaloScan('Name');" >

However, this is a bit naughty and not nice. It is better to include a real link in the href attribute and put javascript in an onClick attribute. That in itself is easy to do, but the problem I had with Nanoblogger was that I was using the post ID (NB_EntryID) as the Haloscan comment name since it would be unique for all posts. This is in the format "e2006-07-17T22_10_04.txt", but Haloscan reformats this on the fly to "e2006_07_17T22_10_04_txt", which is all well and good, but if I'm not using javascript in the href attribute it means I need to reformat the NB_EntryID upfront.

This had me puzzled for a bit, but Nanoblogger, being the cool thing that it is allows you to use Bash commands directly in the blog template files, which means I could put:

href="http://www.haloscan.com/comments/i5m/`echo "$NB_EntryID" |sed -e 's/[^0-9eTtx]/_/g'`"

Which is just pretty cool. The bits between ` and ` get executed. I've not used sed before, but have used awk and regexp, etc, very briefly: the "s" stands for substitute, the [^0-9eTtx] matches any character that isn't a number, letter e, T, t or x. The underscore, "_" is what to replace the matches with and the "g" means replace all occurences.