Would be nice to have a HTML5 compliant version of the code. As far I have seen the code, it's just about replacing the old-fashioned entities with the « new » way to write them—by using charcodes. For instance, ` ` would become ` ` and so on.