I would try first pulling the title text out of the <a> tags via regex, leaving you with static text following an unlabeled link, then add the counter via a::before.
Code:
<a href='#target'></a>My Informative Title
Code:
a::before {
content: counter(heading) '.' counter(subheading) ': ';
}
Might be a start, anyway.