generate links correctly when text has extra [bracketed] strings (#470)