Split escapeTextForBrowser into escapeTextContentForBrowser and quoteAttributeValueForBrowser