Image lightbox link code within excerpt

When there are images attached in top of the post, lightbox link code are included in the excerpt. I am not sure what is the purpose of those link code inside excerpt, it seem no meaning at all.

I am asking this, because it seem those link code cause some styling problem. For more detail, may refer to the post below.