Merge segments before rendering

This will reduce the number of segments to render
and produce cleaner ANSI escape code sequences.

Closes #46
This commit is contained in:
Patrik Svensson
2020-08-30 12:33:49 +02:00
committed by Patrik Svensson
parent 47fd646d21
commit 7fd2efaeb5
4 changed files with 42 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ namespace Spectre.Console.Tests.Unit
{
[Theory]
[InlineData("[yellow]Hello[/]", "Hello")]
[InlineData("[yellow]Hello [italic]World[/]![/]", "Hello World!")]
[InlineData("[yellow]Hello [italic]World[/]![/]", "Hello World!")]
public void Should_Output_Expected_Ansi_For_Markup(string markup, string expected)
{
// Given
@@ -26,7 +26,7 @@ namespace Spectre.Console.Tests.Unit
}
[Theory]
[InlineData("[yellow]Hello [[ World[/]", "Hello [ World")]
[InlineData("[yellow]Hello [[ World[/]", "Hello [ World")]
public void Should_Be_Able_To_Escape_Tags(string markup, string expected)
{
// Given