1/*--------------------------------------------------------------------------------------------- 2 * Copyright (c) Microsoft Corporation. All rights reserved. 3 * Licensed under the MIT License. See License.txt in the project root for license information. 4 *--------------------------------------------------------------------------------------------*/ 5export function escapeHtmlText(str: string): string { 6 return str 7 .replace(/&/g, '&') 8 .replace(/</g, '<') 9 .replace(/>/g, '>') 10 .replace(/"/g, '"') 11 .replace(/'/g, '''); 12} 13 14