Thanks Allan.
The code works perfectly! I've tried to insert a variable inside...
<${1:ul}> ${TM_SELECTED_TEXT/(.+)(?:\n(.+))?/ <li class="${3:odd}">$1</li>(?2: \n <li>$2</li>)/g} </$1>
...and this is the result...
<ul> <li class="${3:odd}">dfadfadfadfadfad</li> <li>fadfadfadfdaf</li> <li class="${3:odd}">afdfadfdafd</li> </ul>
How can we adjust the class to be the next tab stop with a default? I also adjusted your code to allow for a clean indentation of the li elsments.
Thanks for the help. :)
On 13. Oct 2006, at 00:02, Adam Stacoviak wrote:
[...] How can we adjust the class to be the next tab stop with a default?
It is not possible to have the replacement string provide new tab stops.
You can however make a command which generates the snippet instead. See e.g. the Wrap Each Line in Open / Close Tags command in the HTML bundle.