// Copyright Epic Games, Inc. All Rights Reserved. // Tiny shared helpers used across the trace-viewer modules. // Escape characters that have special meaning inside an HTML context (text or // attribute) so that user-supplied strings can be safely interpolated into // .innerHTML / template literals. Coerces the input to string first so callers // don't have to. export function escapeHtml(s) { return String(s).replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", "\"": """, "'": "'", }[c])); }