Replaces unsafe characters from html code with safe versions.