using System; using Spectre.Console.Internal; namespace Spectre.Console { /// /// Contains extension methods for . /// public static class RecorderExtensions { private static readonly TextEncoder _textEncoder = new TextEncoder(); private static readonly HtmlEncoder _htmlEncoder = new HtmlEncoder(); /// /// Exports the recorded content as text. /// /// The recorder. /// The recorded content as text. public static string ExportText(this Recorder recorder) { if (recorder is null) { throw new ArgumentNullException(nameof(recorder)); } return recorder.Export(_textEncoder); } /// /// Exports the recorded content as HTML. /// /// The recorder. /// The recorded content as HTML. public static string ExportHtml(this Recorder recorder) { if (recorder is null) { throw new ArgumentNullException(nameof(recorder)); } return recorder.Export(_htmlEncoder); } } }