fixed calculating html text length