Skip to content

Export-MarkdownCommandHelp renders .LINK entries as unusable markdown links #858

Description

@bravo-kernel

Prerequisites

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

Steps to reproduce

@'
function Test-Links {
    <#
        .SYNOPSIS
            A synopsis.
        .DESCRIPTION
            A description.
        .LINK
            https://example.com/docs
        .LINK
            about_CommonParameters
    #>
    [CmdletBinding()] param()
}
'@ | Set-Content Links.psm1

Import-Module ./Links.psm1
New-CommandHelp -CommandInfo (Get-Command Test-Links) |
    Export-MarkdownCommandHelp -OutputFolder . -Force

Expected behavior

## RELATED LINKS

- [https://example.com/docs](https://example.com/docs)
- about_CommonParameters


Bare URLs use the URI as the link text (the platyPS 0.14 behavior); text-only entries render as plain list items.

Actual behavior

## RELATED LINKS

- [](https://example.com/docs)
- [about_CommonParameters]()


Bare URLs produce a link without clickable text (invisible on most sites); text-only entries produce a link without a target.

Error details

No error thrown.

Suggested fix: use the URI as the link text when no text is available, and render text-only entries as plain list items instead of empty-target links.

Environment data

- Microsoft.PowerShell.PlatyPS 1.0.2
- PowerShell 7.5.8

Version

1.0.2

Visuals

No response

Additionally

Found while migrating Alt3.Docusaurus.Powershell to the v2 pipeline; downstream tracking: alt3/Docusaurus.Powershell#248

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions