Add support for tables

This commit is contained in:
Patrik Svensson
2020-08-04 16:05:57 +02:00
committed by Patrik Svensson
parent aa34c145b9
commit a068fc68c3
19 changed files with 837 additions and 33 deletions

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Spectre.Console.Internal
{
@ -35,7 +36,7 @@ namespace Spectre.Console.Internal
else if (token.Kind == MarkupTokenKind.Text)
{
// Get the effecive style.
var effectiveStyle = style.Combine(stack);
var effectiveStyle = style.Combine(stack.Reverse());
result.Append(token.Value, effectiveStyle);
}
else

View File

@ -18,12 +18,7 @@ namespace Spectre.Console.Internal
public static bool TryParse(string text, out Style style)
{
style = Parse(text, out var error);
if (error != null)
{
return false;
}
return true;
return error == null;
}
private static Style Parse(string text, out string error)