platyPS icon indicating copy to clipboard operation
platyPS copied to clipboard

New-ExternalHelp removes specific carriage returns

Open chrisda opened this issue 3 years ago • 5 comments

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

  1. Take a markdown topic that contains a line of text in the SYNOPSIS section that contains a **Note** paragraph.

  2. 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 avatar Feb 26 '21 18:02 chrisda

@chrisda Can you test this with https://github.com/PowerShell/platyPS/releases/tag/v2.0.0-preview1. They may have been fixed.

sdwheeler avatar Jul 26 '21 16:07 sdwheeler

@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>

Microsoft.Exchange.TransportMailflow-Help.xml.zip

chrisda avatar Aug 26 '21 22:08 chrisda

Also noting that this is related to Issue #429.

chrisda avatar Aug 26 '21 22:08 chrisda

Hey @chrisda! We plan on having this functionality working in Preview 3. #538

theJasonHelmick avatar Aug 30 '21 17:08 theJasonHelmick

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.

sdwheeler avatar May 24 '24 18:05 sdwheeler