diff --git a/src/Common.AnsiCli/AnsiCli.cs b/src/Common.AnsiCli/AnsiCli.cs index 1142369ca..efbe34a8e 100644 --- a/src/Common.AnsiCli/AnsiCli.cs +++ b/src/Common.AnsiCli/AnsiCli.cs @@ -62,16 +62,16 @@ public static IRenderable Title(string title) foreach (var row in data) { var color = (row as IHighlightColor)?.HighlightColor ?? default; - var foreground = (color == default) + var style = new Style((color == default) ? Color.Default - : new Color(color.R, color.G, color.B); + : new Color(color.R, color.G, color.B)); table.AddRow(getters.Select(getter => { - var value = getter.Invoke(row, []); - return new Text( - value?.ToString() ?? "", - new Style(foreground, link: (value as Uri)?.ToStringRfc())); + object? value = getter.Invoke(row, []); + return new Paragraph( + value?.ToString() ?? "", style, + link: value is Uri uri ? new Link(uri.ToStringRfc()) : null); })); } diff --git a/src/Common.AnsiCli/Common.AnsiCli.csproj b/src/Common.AnsiCli/Common.AnsiCli.csproj index 7ae02636a..1a4a4729a 100644 --- a/src/Common.AnsiCli/Common.AnsiCli.csproj +++ b/src/Common.AnsiCli/Common.AnsiCli.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/Samples/AnsiCli/Program.cs b/src/Samples/AnsiCli/Program.cs index 9866a40eb..97aa72ad9 100644 --- a/src/Samples/AnsiCli/Program.cs +++ b/src/Samples/AnsiCli/Program.cs @@ -31,9 +31,8 @@ handler.Output("Table", new Data[] { - new ("a", "b"), - new ("x", "y") + new ("Website", new Uri("https://0install.net/")), + new ("Docs", new Uri("https://docs.0install.net/")), }); -// ReSharper disable once CheckNamespace -record Data(string Column1, string Column2); +record Data(string Name, Uri Address);