capture text before [[ as part of anchor text

(Mostly) fixes gh-12. Some corner cases left.