Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RokeJulianLockhart opened this issue Apr 13, 2024 · 0 comments

Comments

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Apr 13, 2024

  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
@RokeJulianLockhart RokeJulianLockhart changed the title Either output a NewLine before output (in addition to after) or don't output one. Either output a NewLine *before* output (in addition to after) or *don't* output one. Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant