Issue #3080259 by gabesullice, alexpott, Wim Leers: Links with different target attributes are improperly merged (cherry picked from commit 68bacadc)