Truncate html properly