Improved normalize links in diary (fixes #66)

I think this should solve the issue. I would suggest that you check the code. I've tested and it seems to work well, but perhaps I should have done something in a different way to be consistent with your coding style.