Close link tags properly and remove single quotes from HTML