Are you sure that break tags are the only tags that could exist in hyperlinks that would cause this problem? This code is pretty complex, so I'm not even sure what's going on here.