platyPS
platyPS copied to clipboard
New-ExternalHelp removes specific carriage returns
It appears that if a line of text in the SYNOPSIS section of a markdown topic starts with bold formatting, the carriage returns around that line of text are not honored when running New-ExternalHelp.
Sample text in markdown topic (note that there are 4 distinct lines of text/paragraphs):
## SYNOPSIS
This cmdlet is available only in the cloud-based service.
Use the Get-HostedConnectionFilterPolicy cmdlet to view the settings of connection filter policies in your cloud-based organization.
**Note**: We recommend that you use the Exchange Online PowerShell V2 module to connect to Exchange Online PowerShell. For instructions, see [Connect to Exchange Online PowerShell](https://docs.microsoft.com/powershell/exchange/connect-to-exchange-online-powershell).
For information about the parameter sets in the Syntax section below, see [Exchange cmdlet syntax](https://docs.microsoft.com/powershell/exchange/exchange-cmdlet-syntax).
Result (note that there are only 3 paragraphs; the Note paragraph is munged together with the previous paragraph):
<maml:description>
<maml:para>This cmdlet is available only in the cloud-based service.</maml:para>
<maml:para>Use the Get-HostedConnectionFilterPolicy cmdlet to view the settings of connection filter policies in your cloud-based organization. Note : We recommend that you use the Exchange Online PowerShell V2 module to connect to Exchange Online PowerShell. For instructions, see Connect to Exchange Online PowerShell (https://docs.microsoft.com/powershell/exchange/connect-to-exchange-online-powershell).</maml:para>
<maml:para>For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax (https://docs.microsoft.com/powershell/exchange/exchange-cmdlet-syntax).</maml:para>
</maml:description>
Attached is a topic and the resulting XML file for inspection. platyPSissue.zip
Steps to reproduce
-
Take a markdown topic that contains a line of text in the SYNOPSIS section that contains a
**Note**
paragraph. -
Run the following command:
New-ExternalHelp -Path "<Path to markdown topic"> -OutputPath "<Output folder>"
Expected behavior
The line of text that starts with **Note**
should be contained within its own <maml:para></maml:para>
tag.
Actual behavior
The line of text that starts with **Note**
is not contained within its own <maml:para></maml:para>
tag. It's treated as if it's a second sentence in the previous line of text
Environment data
- platyPS 0.14.1
- Windows 10 Enterprise 20H2
- Windows PowerShell 5.1
@chrisda Can you test this with https://github.com/PowerShell/platyPS/releases/tag/v2.0.0-preview1. They may have been fixed.
@sdwheeler, no joy.
I updated to v2.0.0-Preivew1 that's available in the PSGallery, and the behavior is the same (see the attached XML file).
<maml:description>
<maml:para>This cmdlet is available only in the cloud-based service.</maml:para>
<maml:para>Use the Get-HostedConnectionFilterPolicy cmdlet to view the settings of connection filter policies in your cloud-based organization. Note : We recommend that you use the Exchange Online PowerShell V2 module to connect to Exchange Online PowerShell. For instructions, see Connect to Exchange Online PowerShell (https://docs.microsoft.com/powershell/exchange/connect-to-exchange-online-powershell).</maml:para>
<maml:para>For information about the parameter sets in the Syntax section below, see Exchange cmdlet syntax (https://docs.microsoft.com/powershell/exchange/exchange-cmdlet-syntax).</maml:para>
</maml:description>
</command:details>
<maml:description>
Also noting that this is related to Issue #429.
Hey @chrisda! We plan on having this functionality working in Preview 3. #538
Related to #429 Retested Microsoft.PowerShell.PlatyPS v1. Current conversion to MAML removes empty lines in examples. Newlines are correct for all other description fields.