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

[Markdown.MAML.Parser.MarkdownParser].ParseString does not process quoted text correctly. #581

Closed
3 tasks done
jhoneill opened this issue Aug 16, 2022 · 1 comment
Closed
3 tasks done
Labels
Milestone

Comments

@jhoneill
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

  1. 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
  2. In VS Code I have set a break point on new-externalHelp but 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 )
  3. After this line has run examine $model.children[17].spans[-5..-1] | ft style,text -Wrap

The Markdown

>[!NOTE]
> In PowerShell 3.0 and PowerShell 4.0, `Get-Help` can't find **About** articles in modules unless
> the module is imported into the current session. This is a known issue. To get **About** articles
> in a module, import the module, either by using the `Import-Module` cmdlet or by running a cmdlet
> that's included in the module.

Translates to

 Style Text
 ----- ----
Normal .
       >[!NOTE] > In PowerShell 3.0 and PowerShell 4.0, `Get-Help` can't find
  Bold About
Normal articles in modules unless > the module is imported into the current session. This is a known issue. To get
  Bold About
Normal articles > in a module, import the module, either by using the `Import-Module` cmdlet or by running a cmdlet > that's included in the module.

i..e. newline > just merges together instead of preserving the same > markers and line breaks.

Expected behavior

The description part of Get-Help Get-Help looks  similar to what is displayed at https://docs.microsoft.com/en-gb/powershell/module/microsoft.powershell.core/get-help?view=powershell-7.2#description  i.e.

>[!NOTE] 
> In PowerShell 3.0 and PowerShell 4.0, `Get-Help` can't find About articles in modules unless 
> the module is imported into the current session. This is a known issue. To get About articles 
> in a module, import the module, either by using the `Import-Module` cmdlet or by running a cmdlet 
> that's included in the module.

Actual behavior

It displays as

    >[!NOTE] > In PowerShell 3.0 and PowerShell 4.0, `Get-Help` can't find About articles in modules unless > the module is imported into the current session. This is a known issue. To get About articles > in a module, import the module, either by using the `Import-Module` cmdlet or by running a cmdlet > that's included in the module.

Error details

No error 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

@jhoneill jhoneill added the Needs-Triage The issue is new and needs to be triaged by a work group. label Aug 16, 2022
@jhoneill jhoneill changed the title [Markdown.MAML.Parser.MarkdownParser].ParseString does not quoted text correct. [Markdown.MAML.Parser.MarkdownParser].ParseString does not process quoted text correctly. Aug 16, 2022
@sdwheeler sdwheeler added platyps-0.14.2 and removed Needs-Triage The issue is new and needs to be triaged by a work group. labels May 21, 2024
@sdwheeler
Copy link
Collaborator

This is fixed in Microsoft.PowerShell.PlatyPS v1.

@sdwheeler sdwheeler added the Resolution-Fixed The issue is fixed. label May 31, 2024
@sdwheeler sdwheeler added this to the OPS-Release milestone May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants