Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when Append/PrependMarkdown includes certain wildcard characters #160

Closed
fflaten opened this issue Mar 26, 2023 · 5 comments
Closed

Comments

@fflaten
Copy link
Contributor

fflaten commented Mar 26, 2023

image

Exception is thrown by Test-Path here
Can repro with same string using Test-Path in unix only (pester/docs devcontainer).

$t = @"
:::note This page was generated using the comment based help in Pester $($ModuleList.Pester).
To edit the content of this page, change the corresponding help in the [pester/pester](https://github.com/pester/pester)-repository.
:::
"@

Test-Path $t

Using Test-Path -LiteralPath $t doesn't throw, but maybe better to check if string is a path first?
Haven't really identified the issue as you can solve it by any of these ways:

  • Remove ::: prefix
  • Remove / in the link name
  • Remove square brackets in link (which are wildcard chars, so that makes sense)
@bravo-kernel
Copy link
Contributor

bravo-kernel commented Mar 26, 2023 via email

@bravo-kernel
Copy link
Contributor

If you have an example of how to check if string is really a path, let me know and I will make a new version.

@fflaten
Copy link
Contributor Author

fflaten commented Mar 26, 2023

Was about to suggest Test-Path $t -IsValid, but it's actually true with ::: prefix which is probably why some provider-code with wildcard-support is executed.

You could maybe just catch the exception like suggested here: https://ss64.com/ps/test-path.html

@bravo-kernel
Copy link
Contributor

Awesome, will add that when I find the time 👍 because while we are doing all this, I am also being flooded with this https://github.com/alt3/rank-my-wallet/blob/main/contributing.md#translations

@bravo-kernel
Copy link
Contributor

Fix released with https://github.com/alt3/Docusaurus.Powershell/releases/tag/1.0.34. Thanks for the pointer 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants