Often I've wanted to keep separate running counters going for a page that aren't necessarily adjacent in text, nor an ordered list. Turns out it's easy to implement. Add a %Counters global and then add
s/([^#])#(\w+)#/$1 . ++$Counters{$2}/ge;to CommonMarkup. I did this just after the <tt> expression. This will match things like #foo# #foo# #bar# #foo# #bar# in the text, emitting 1 2 1 3 2. -- SunirShah
s/([^#])#(\w+)#/$1 .((($Counters{$2}) < 9)?"0":""). ++$Counters{$2}/ge;--JuanmaMP