Closed ruckii closed 1 year ago
I added a function for escaping Get-SpectreEscapedText
. I wonder if that's enough for most cases? It just pipes the text through that escape function you have there so you can use it in a pipeline.
Cases like your one above:
And receiving untrusted input like the best practice doc talks about:
And mixtures of escaped and unescaped data:
I've pushed this and your other PR to psgallery in https://github.com/ShaunLawrie/PwshSpectreConsole/releases/tag/v0.2.3 Thanks for the feedback.
Escaping function is what was needed! Thanks a lot!
According to Spectre.Console Best Practices:
There are at least 2 options:
$data = "][[][]]][[][][][" $escapedData = [Spectre.Console.Markup]::Escape($data) Format-SpectrePanel -Title "Escaped data" -Data $escapedData Format-SpectrePanel -Title "Unescaped data" -Data $data # Exception