Updated html generating code to escape href properly for generated links