Add JSON text renderer (#1086)

* Add JsonText widget to render highlighted JSON

Closes #1051
This commit is contained in:
Patrik Svensson
2022-12-31 19:17:15 +01:00
committed by GitHub
parent 3e6e0990c5
commit 54be64ec84
48 changed files with 1634 additions and 21 deletions

View File

@@ -0,0 +1,17 @@
namespace Spectre.Console.Tests;
public static class StreamExtensions
{
public static string ReadText(this Stream stream)
{
if (stream is null)
{
throw new ArgumentNullException(nameof(stream));
}
using (var reader = new StreamReader(stream))
{
return reader.ReadToEnd();
}
}
}