PowerShell / platyPS

Write PowerShell External Help in Markdown
MIT License
765 stars 149 forks source link

Fix unsafe characters in command names breaking markdown file creation #603

Closed ShaunLawrie closed 8 months ago

ShaunLawrie commented 1 year ago

PR Summary

This replaces unsafe characters in command names with underscores so that file creation will work if this library tries to create files for strangely named functions like:

image

Note The master branch currently has a failing test because it's checking for a single instance of a string in the output markdown which should be there twice, once in the synopsis and once in the description. It looks like it's been failing for a long time, I fixed it by making the description and the synopsis unique on line 349 of test/Pester/PlatyPs.Tests.ps1. This could be fixed in this PR or I can descope it https://ci.appveyor.com/project/PowerShell/markdown-maml/branch/master

PR Context

I've been trying to generate help docs for PowerShellAI and it uses question marks in command names which causes platyPS to fail when run on Windows.
Fixes https://github.com/PowerShell/platyPS/issues/602

ShaunLawrie commented 1 year ago

@microsoft-github-policy-service agree