You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When DescriptionAttribute contains a middle bracket, the app will crash with the following exception when printing the usage message.
Unhandled exception. System.InvalidOperationException: Encountered malformed markup tag at position 56.
at Spectre.Console.MarkupTokenizer.ReadMarkup() in /_/src/Spectre.Console/Internal/Text/Markup/MarkupTokenizer.cs:line 192
at Spectre.Console.MarkupTokenizer.MoveNext() in /_/src/Spectre.Console/Internal/Text/Markup/MarkupTokenizer.cs:line 27
at Spectre.Console.MarkupParser.Parse(String text, Style style) in /_/src/Spectre.Console/Internal/Text/Markup/MarkupParser.cs:line 19
at Spectre.Console.Markup..ctor(String text, Style style) in /_/src/Spectre.Console/Widgets/Markup.cs:line 42
at Spectre.Console.Cli.Composer.Measure(RenderOptions options, Int32 maxWidth) in /_/src/Spectre.Console.Cli/Internal/Composer.cs:line 123
at Spectre.Console.TableMeasurer.MeasureColumn(TableColumn column, Int32 maxWidth) in /_/src/Spectre.Console/Widgets/Table/TableMeasurer.cs:line 107
at Spectre.Console.TableMeasurer.<>c__DisplayClass7_0.<CalculateColumnWidths>b__0(TableColumn column) in /_/src/Spectre.Console/Widgets/Table/TableMeasurer.cs:line 57
at System.Linq.Enumerable.SelectListIterator`2.Fill(ReadOnlySpan`1 source, Span`1 destination, Func`2 func)
at System.Linq.Enumerable.SelectListIterator`2.ToArray()
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Spectre.Console.TableMeasurer.CalculateColumnWidths(Int32 maxWidth) in /_/src/Spectre.Console/Widgets/Table/TableMeasurer.cs:line 57
at Spectre.Console.Table.Render(RenderOptions options, Int32 maxWidth) in /_/src/Spectre.Console/Widgets/Table/Table.cs:line 140
at Spectre.Console.Rendering.Renderable.Spectre.Console.Rendering.IRenderable.Render(RenderOptions options, Int32 maxWidth) in /_/src/Spectre.Console/Rendering/Renderable.cs:line 19
at Spectre.Console.Rendering.JustInTimeRenderable.Render(RenderOptions context, Int32 width) in /_/src/Spectre.Console/Rendering/JustInTimeRenderable.cs:line 21
at Spectre.Console.Rendering.Renderable.Spectre.Console.Rendering.IRenderable.Render(RenderOptions options, Int32 maxWidth) in /_/src/Spectre.Console/Rendering/Renderable.cs:line 19
at Spectre.Console.RenderableExtensions.GetSegments(IAnsiConsole console, RenderOptions options, IEnumerable`1 renderables) in /_/src/Spectre.Console/Extensions/RenderableExtensions.cs:line 37
at Spectre.Console.RenderableExtensions.GetSegments(IRenderable renderable, IAnsiConsole console) in /_/src/Spectre.Console/Extensions/RenderableExtensions.cs:line 29
at Spectre.Console.AnsiBuilder.Build(IAnsiConsole console, IRenderable renderable) in /_/src/Spectre.Console/Internal/Backends/Ansi/AnsiBuilder.cs:line 17
at Spectre.Console.AnsiConsoleBackend.Write(IRenderable renderable) in /_/src/Spectre.Console/Internal/Backends/Ansi/AnsiConsoleBackend.cs:line 30
at Spectre.Console.AnsiConsoleFacade.Write(IRenderable renderable) in /_/src/Spectre.Console/Internal/Backends/AnsiConsoleFacade.cs:line 40
at Spectre.Console.Cli.AnsiConsoleExtensions.SafeRender(IAnsiConsole console, IEnumerable`1 renderables) in /_/src/Spectre.Console.Cli/Internal/Extensions/AnsiConsoleExtensions.cs:line 33
at Spectre.Console.Cli.CommandExecutor.Execute(IConfiguration configuration, IEnumerable`1 args) in /_/src/Spectre.Console.Cli/Internal/CommandExecutor.cs:line 80
at Spectre.Console.Cli.CommandApp.RunAsync(IEnumerable`1 args) in /_/src/Spectre.Console.Cli/CommandApp.cs:line 84
at Spectre.Console.Cli.CommandApp.Run(IEnumerable`1 args) in /_/src/Spectre.Console.Cli/CommandApp.cs:line 58
To Reproduce
[CommandOption("--some-nums <SomeNumbers>")]
[Description("The numbers to use. Default is [1,2,3,4].")]
public int[] SomeNumbers { get; set; } = [1,2,3,4];
Expected behavior
No crash happened after adding '[' in the description message.
Or error with a more user-friendly message.
The text was updated successfully, but these errors were encountered:
Describe the bug
When DescriptionAttribute contains a middle bracket, the app will crash with the following exception when printing the usage message.
To Reproduce
Expected behavior
No crash happened after adding '[' in the description message.
Or error with a more user-friendly message.
The text was updated successfully, but these errors were encountered: