Fix issues with html text rendering and text boundaries