using System.Text.RegularExpressions; using HtmlAgilityPack; namespace BlueLaminate.Scraper.Wiki; /// Text helpers shared by wiki scrapers. public static class WikiText { private static readonly Regex Whitespace = new(@"\s+", RegexOptions.Compiled); /// Decodes HTML entities and collapses whitespace runs to single spaces. public static string Normalize(string raw) => Whitespace.Replace(HtmlEntity.DeEntitize(raw) ?? string.Empty, " ").Trim(); }