Correctly strip HTML tags from content when measuring length