This is a great post.
Searchable text
// Pre-compiled regex for better performance const HTML_TAG_REGEX = /<[^>]*>/g; /** * Removes HTML tags from a string * @param str - The input string containing HTML * @returns A string with HTML tags removed * @example * ```ts * // Basic usage * stripHtml('
Hello World
') // 'Hello World' * stripHtml('Thanks for signing up.
' * const preview = stripHtml(emailBody) // 'Welcome! Thanks for signing up.' * * // Notification sanitization * const notification = 'New message
' * const safeText = stripHtml(notification) // 'alert("xss")New message' * * // Blog post excerpt for meta description * const post = 'This is a great post.
Searchable text