This is getting awfully close to a general footnoting tool. If you remove the link formatting for description, you are pretty much there. That would be a useful (different) add-on. As it is, I like this one for its intended purpose. I'm using the ruby version, mostly because I did something dumb in the original install and tried ruby to see if that worked. It did, so I left it alone -- using ruby.
<br><br><div><span class="gmail_quote">On 2/28/06, <b class="gmail_sendername">Fred B.</b> <<a href="mailto:fredb7@starflam.com">fredb7@starflam.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<span class="q"><br><div><div>On 28 Feb 2006, at 17:42, Dr. Drang wrote:</div><div><br></div><br><blockquote type="cite"><blockquote type="cite"> </blockquote><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">
Clever! And if I'm reading your code correctly, you're updating from the last number but still allowing the user to override, which is nice.</div></blockquote></div><br><div><br></div></span><div>Yes, because I sometimes use something else than numbers like
e.g. [mail].</div><div>And if it's the first numerical reference, it proposes "1".</div><div><br></div><div>BTW, the second reference I make to #{n} was not necessary, I removed it.</div><span class="q"><div><br>
</div><div><font face="Monaco" size="3"><span style="font-size: 11px;">#!/usr/bin/env ruby</span></font></div><div><font face="Monaco" size="3"><span style="font-size: 11px;"><br></span></font></div><div><font face="Monaco" size="3">
<span style="font-size: 11px;">str = STDIN.read</span></font></div><div><font face="Monaco" size="3"><span style="font-size: 11px;">n = str.scan( %r{.*\[(\d+)\]: }m ).to_s.to_i + 1</span></font></div></span><div><font face="Monaco" size="3">
<span style="font-size: 11px;">print "[${1:description}][${2:#{n}}]$0" + str.gsub(/[$`\\]/, '\\\\\1') + "[<font color="#2d8a53">$2</font>]: ${3:http://}\n"</span></font></div><span class="sg"><div><font face="Monaco" size="3">
<span style="font-size: 11px;"><br></span></font></div><div><font face="Monaco" size="3"><span style="font-size: 11px;">--</span></font></div><div><font face="Monaco" size="3"><span style="font-size: 11px;">FredB</span></font>
</div>
</span><br><br>______________________________________________________________________<br>For new threads USE THIS: <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com
</a><br>(threading gets destroyed and the universe will collapse if you don't)<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.macromates.com/mailman/listinfo/textmate" target="_blank">http://lists.macromates.com/mailman/listinfo/textmate
</a><br><br></blockquote></div><br>