[TxMt] list (ul/ol) HTML snippet question

Gavin Kistner gavin at refinery.com
Sat Sep 10 03:07:46 UTC 2005


On Sep 9, 2005, at 11:54 AM, minimal.design wrote:
> I was trying to figure out how I could write a snippet that would  
> wrap a bunch of lines into a HTML list...  lets say you got this text:
>
> item 01
> item 02
> item 03
>
> then the snippet would output:
>
> <ul>
>     <li>item 01</li>
>     <li>item 02</li>
>     <li>item 03</li>
> </ul>
>
> I'm kinda stuck on how to get the recursive thing to adapt to the  
> number of list items...  Any thoughts?  Thanks!  :)

How about a macro that does a find/replace non-empty lines in the  
selection to wrap <li>...</li>, and then wraps the whole selection  
with <ul>...</ul>



More information about the textmate mailing list