platyPS
platyPS copied to clipboard
[Markdown.MAML.Parser.MarkdownParser].ParseString does not process code blocks marked with single back ticks
Prerequisites
- [X] Write a descriptive title.
- [X] Make sure you are able to repro it on the latest released version
- [X] Search the existing issues.
Steps to reproduce
- As a test file I have download the MD help file for Get-Help from. https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.2/Microsoft.PowerShell.Core/Get-Help.md
- In VS Code I have set a break point on
new-externalHelpbut the important part is in the function GetMamlModelImpl which has a line$model = $p.ParseString($mdText, $parseMode, $_)(1605 in the .PSM1 file for v 0.14.2 ) - After this line has run examine
$model.children[17].spans[0]
The text looks like this
Style Text
----- ----
Normal The `Get-Help` cmdlet displays information about PowerShell concepts and commands, including cmdlets,
The backticks around get help have not resulted it being placed in its own span with a style representing "code" nor have they been stripped out
Expected behavior
Back ticks don't appear in the output of get help,
or in a perfect world Get-Help is able to do some rendering of code blocks.
Actual behavior
Output of Get-Help Get-Help looks like this
DESCRIPTION
The `Get-Help` cmdlet displays information about PowerShell concepts and commands,
Error details
No message
Environment data
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 0.14.2 platyPS Desk {New-MarkdownHelp, Get-MarkdownMetadata, New-ExternalHelp, New-YamlHelp}
Name Value
---- -----
PSVersion 7.2.6
PSEdition Core
GitCommitId 7.2.6
OS Microsoft Windows 10.0.22000
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
The markdown parsing has totally changed in Microsoft.PowerShell.PlatyPS v1. However, the backticks are still maintained in the text when converted to MAML. Whether or not we should remove the backticks needs further discussion.
Thank you for your contribution. We are no longer maintaining the v0.14 version of platyPS. If you’re interested in continuing to help, we’d love your support on the release version of Microsoft.PowerShell.PlatyPS v1.0.0.