[TxMt] list (ul/ol) HTML snippet question
Allan Odgaard
throw-away-1 at macromates.com
Thu Oct 12 02:37:30 UTC 2006
On 12. Oct 2006, at 01:25, Adam Stacoviak wrote:
> How could we alter this.
>
> <${1:ul}>
> ${TM_SELECTED_TEXT/.+/ <li>$0<\/li>/g}
> </$1>
>
> ...to add a class option to the li tag, but only every other
> instance of the li tag? Thanks Sune for setting up this snippet, it
> saves me a ton of time when creating ul/ol lists!!!!
For the middle line, try something like:
${TM_SELECTED_TEXT/(.+)(?:\n(.+))?/ <li class="odd">$1<\/li>(?2:\n
<li>$2<\/li>)/g}
More information about the textmate
mailing list