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
#r "nuget: Spectre.Console, 0.49.1"
using Spectre.Console;
var file = @"C:\Foo Bar\Baz.mp4";
var title = string.Join(Path.DirectorySeparatorChar, file.Split(Path.DirectorySeparatorChar)[^2..]);
AnsiConsole.MarkupInterpolated($"[link={file}]{title}[/]");
Removing the space (or replacing it with a dot, say), fixes it:
Exception:
at Spectre.Console.StyleParser.Parse(String text) in /_/src/Spectre.Console/StyleParser.cs:line 10
at Spectre.Console.MarkupParser.Parse(String text, Style style) in /_/src/Spectre.Console/Internal/Text/Markup/MarkupParser.cs:line 29
at Spectre.Console.AnsiConsoleExtensions.Markup(IAnsiConsole console, String value) in /_/src/Spectre.Console/Extensions/AnsiConsoleExtensions.Markup.cs:line 77
at Spectre.Console.AnsiConsoleExtensions.MarkupInterpolated(IAnsiConsole console, IFormatProvider provider, FormattableString value) in /_/src/Spectre.Console/Extensions/AnsiConsoleExtensions.Markup.cs:line 67
at Spectre.Console.AnsiConsoleExtensions.MarkupInterpolated(IAnsiConsole console, FormattableString value) in /_/src/Spectre.Console/Extensions/AnsiConsoleExtensions.Markup.cs:line 35
at Spectre.Console.AnsiConsole.MarkupInterpolated(FormattableString value) in /_/src/Spectre.Console/AnsiConsole.Markup.cs:line 42
at Program.<Main>$(String[] args) in C:\Users\dev\AppData\Local\Temp\roslynpad\build\ad7038b6246d417a81e61589c1da40cf\Program.cs:line 7
I think it would be safe to detect the [link= prefix and effective do a replace of common invalid URL chars such as spaces > %20 and perhaps a few others.
Not sure if this can be considered a bug or a feature request :)
The text was updated successfully, but these errors were encountered:
Repro:
Removing the space (or replacing it with a dot, say), fixes it:
Exception:
I think it would be safe to detect the
[link=
prefix and effective do a replace of common invalid URL chars such as spaces > %20 and perhaps a few others.Not sure if this can be considered a bug or a feature request :)
The text was updated successfully, but these errors were encountered: