Skip to content

Markdown Formatting Issues #830

Description

@TrisBits

Prerequisites

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

Steps to reproduce

Issue occurs if the comment-based help, does not include a .LINK section.

Comment-based Help to produce test scenarios.

Scenario 1 - .LINK present but left empty

function Test-Cmdlet {
    <#
    .SYNOPSIS
    Testing of comment-based help.

    .DESCRIPTION
    This is utilized to test Microsoft.PowerShell.PlatyPS.

    .PARAMETER Test
    A placehoder parameter for testing documentation output.

    .EXAMPLE
    Test-Cmdlet -Name "MyName"

    .EXAMPLE
    This is example text before the command.
    Test-Cmdlet -Name 'MyName'

    .INPUTS

    .OUTPUTS

    .NOTES

    .LINK
    #>

    param (
        [Parameter(Mandatory=$false, HelpMessage="A parameter for platyPS testing purposes.")]
        [string]$Name
    )

    Write-Host 'This is a test.'
}

Scenario 2 - .LINK not present

function Test-Cmdlet {
    <#
    .SYNOPSIS
    Testing of comment-based help.

    .DESCRIPTION
    This is utilized to test Microsoft.PowerShell.PlatyPS.

    .PARAMETER Test
    A placehoder parameter for testing documentation output.

    .EXAMPLE
    Test-Cmdlet -Name "MyName"

    .EXAMPLE
    This is example text before the command.
    Test-Cmdlet -Name 'MyName'

    .INPUTS

    .OUTPUTS

    .NOTES
    #>

    param (
        [Parameter(Mandatory=$false, HelpMessage="A parameter for platyPS testing purposes.")]
        [string]$Name
    )

    Write-Host 'This is a test.'
}

Scenario 3 - .NOTE has information

function Test-Cmdlet {
    <#
    .SYNOPSIS
    Testing of comment-based help.

    .DESCRIPTION
    This is utilized to test Microsoft.PowerShell.PlatyPS.

    .PARAMETER Test
    A placehoder parameter for testing documentation output.

    .EXAMPLE
    Test-Cmdlet -Name "MyName"

    .EXAMPLE
    This is the example text before the command.
    Test-Cmdlet -Name 'MyName'

    .INPUTS

    .OUTPUTS

    .NOTES
    This is a sample note.

    .LINK
    #>

    param (
        [Parameter(Mandatory=$false, HelpMessage="A parameter for platyPS testing purposes.")]
        [string]$Name
    )

    Write-Host 'This is a test.'
}
    $newMarkdownCommandHelpSplat = @{
        ModuleInfo = Get-Module MySample
        OutputFolder = '.'
        HelpVersion = '0.0.1'
        WithModulePage = $true
    }

    New-MarkdownCommandHelp @newMarkdownCommandHelpSplat

Expected behavior

Scenario 1 Expected:

Image

Scenario 2 Expected:

Image

Scenario 3 Expected:

Image

Actual behavior

Scenario 1 Result - An empty bullet point is produced in RELATED LINKS

Image

Scenario 2 Result - The RELATED LINKS placeholder is created as expected, but an extra space is added at end of file

Image

Scenario 3 Result - When NOTES has a value, an extra space is added

Image

Error details

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.12
PSEdition                      Core
GitCommitId                    7.4.12
OS                             Microsoft Windows 10.0.26100
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

1.0.1

Visuals

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Comment-Based-HelpIssue deals with conversion of comment-based help

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions