Say I have this:
...
<li class='tab'><a href="#tabs2-7">7</a></li>
<li class="tab"><a href="#tab2-8">8</a></li>
...
...and I'd like to use Sparkup in my editor to add another say 6 tabs...so I run the sparkup command:
li.tab > a[href=#tab2-$]{$}*6
but it comes out all wrong,
<li class="tab"><a href="#tab2-8">8</a></li>
<li class="tab">
<a href="#tab2-1">1</a>
<a href="#tab2-2">2</a>
<a href="#tab2-3">3</a>
...
</li>
My first thought was that my syntax should have been:
(li.tab > a[href=#tab2-$]{$})*6
But that did pretty much the same thing...except this time it didn't insert the second number:
<li class="tab"><a href="#tab2-8">8</a></li>
<li class="tab">
<a href="#tab2-1">$</a>
<a href="#tab2-2">$</a>
<a href="#tab2-3">$</a>
...
</li>
Now the range problem (starting at 9 instead of 1) is just a minor annoyance, but what if I want it to repeat the li
as well as the a
tag?
And yes, before you go off about it, I am indeed aware that I could create all of this stuff just using a simple for loop; but that wasn't part of the question now was it?
You are almost there:
You want to create 6
<li>
so that's where you should put your multiplier.No need to be defensive.