Slightly optimzed formatAndStripHtmlFromString method