Skip to content

Either output a NewLine *before* output (in addition to after) or *don't* output one. #32

@RokeJulianLockhart

Description

@RokeJulianLockhart
  1. Summary of the new feature / enhancement

    Like Out-String should not append a trailing newline PowerShell#14444 (comment) explains, Show-Markdown appears to output an unnecessary [Environment]::NewLine after invocation, which makes it difficult to read (because it doesn't even use one before the output too). https://github.com/MicrosoftDocs/PowerShell-Docs/blob/6ff8e52c11aabb6ea5724a6bd2952adfb6f2df12/reference/7.5/Microsoft.PowerShell.Utility/Show-Markdown.md#syntax doesn't list a way to disable this.

  2. Proposed technical implementation details (optional)

    Don't emit a [Environment]::NewLine prepended to the output, or at the least, prepend one.

  3. Additional Information

    1. Reported here due to https://github.com/PowerShell/MarkdownRender/blob/d26903f1ba6efda8912662794977b4b718b5f68e/README.md?plain=1#L4:~:text=the%20component%20is%20used%20by%20%60show-markdown%60.

    2. I've tested this on:

      sudo snap install $(what-snap 'JSNnoJl3EqkMuWoy5Dgq8PMqZ0uNcpie' | awk '{print $2}') --classic --channel=latest/stable --revision 264 # https://forum.snapcraft.io/t/can-i-install-a-package-using-its-snap-id/39053/4?u=beedellrokejulianloc

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