Add link support for supported terminals

Also refactors the code quite a bit, to make it a bit more
easier to add features like this in the future.

Closes #75
This commit is contained in:
Patrik Svensson
2020-09-11 00:34:45 +02:00
committed by Patrik Svensson
parent 1601ef24b3
commit 504746c5dc
33 changed files with 574 additions and 1539 deletions

View File

@ -1,4 +1,4 @@
using System.Text;
using System.Text;
namespace Spectre.Console.Tests
{
@ -13,19 +13,15 @@ namespace Spectre.Console.Tests
public Encoding Encoding => _console.Encoding;
public Decoration Decoration { get => _console.Decoration; set => _console.Decoration = value; }
public Color Foreground { get => _console.Foreground; set => _console.Foreground = value; }
public Color Background { get => _console.Background; set => _console.Background = value; }
public ConsoleWithWidth(IAnsiConsole console, int width)
{
_console = console;
Width = width;
}
public void Write(string text)
public void Write(string text, Style style)
{
_console.Write(text);
_console.Write(text, style);
}
}
}

View File

@ -16,6 +16,7 @@ namespace Spectre.Console.Tests
public Decoration Decoration { get; set; }
public Color Foreground { get; set; }
public Color Background { get; set; }
public string Link { get; set; }
public StringWriter Writer { get; }
public string RawOutput => Writer.ToString();
@ -39,7 +40,7 @@ namespace Spectre.Console.Tests
Writer.Dispose();
}
public void Write(string text)
public void Write(string text, Style style)
{
Writer.Write(text);
}