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

Package readme display creates a <br> for every markdown newline, against markdown specification #8642

Closed
kzu opened this issue Jun 17, 2021 · 7 comments · Fixed by #8673
Closed
Assignees
Labels
help wanted UI improvement Low hanging fruit UI improvement Verified-Prod

Comments

@kzu
Copy link

kzu commented Jun 17, 2021

See the readme-provided badges on this package: https://www.nuget.org/packages/Devlooped.TableStorage/2.0.1.

image

The source readme is https://github.com/devlooped/TableStorage/blob/v2.0.1/readme.md.

Notice how github.com does not add newlines even if the badges are defined in the readme source in separate lines (but without an empty line break between them), and instead just considers the line break as a single whitespace instead:

image

snip of source readme:

![Icon](https://raw.githubusercontent.com/devlooped/TableStorage/main/assets/img/icon-32.png) TableStorage
============

[![Version](https://img.shields.io/nuget/v/Devlooped.TableStorage.svg?color=royalblue)](https://www.nuget.org/packages/Devlooped.TableStorage)
[![Downloads](https://img.shields.io/nuget/dt/Devlooped.TableStorage.svg?color=green)](https://www.nuget.org/packages/Devlooped.TableStorage)
[![License](https://img.shields.io/github/license/devlooped/TableStorage.svg?color=blue)](https://github.com/devlooped/TableStorage/blob/main/LICENSE)
[![Build](https://github.com/devlooped/TableStorage/workflows/build/badge.svg?branch=main)](https://github.com/devlooped/TableStorage/actions)

Repository pattern with POCO object support for storing to Azure/CosmosDB Table Storage

I'd expect the nuget.org render to follow more closely with github.com in this particular case, since it's not uncommon for projects to provide several such badges and forcing to put them all without line breaks (as I had to do for this package) hinders source readability and maintainability. I think it's also the more common markdown behavior for single line breaks.

@nkolev92 nkolev92 transferred this issue from NuGet/Home Jun 17, 2021
@skofman1 skofman1 added this to the Sprint 2021-07 milestone Jun 21, 2021
@skofman1 skofman1 added UI improvement Low hanging fruit UI improvement help wanted labels Jun 21, 2021
@skofman1
Copy link
Contributor

@kzu , thanks for reporting! We will take a look in July. If you are interested in sending a PR we will gladly work with you on merging and shipping this change.

@kzu
Copy link
Author

kzu commented Jun 21, 2021

Sure thing! Which repo has the code for the gallery?

@lyndaidaii
Copy link
Contributor

lyndaidaii commented Jun 21, 2021

@kzu, here is repo: https://github.com/NuGet/NuGetGallery
I will work with you to ship this change once you have PR ready.
Let me know if you need anything, thanks!

@joelverhagen joelverhagen changed the title Package readme display forces new line between images/badges Package readme display forces new line between images/badges or when there is newlines in the source Jun 29, 2021
@joelverhagen
Copy link
Member

Another similar report, simply based on newline behavior in text. From our assessment, this seems to be the same root cause as #8647.

@kzu
Copy link
Author

kzu commented Jul 10, 2021

Yes, indeed this is just a case of creating a <br> for every newline in the markdown, which is something explicitly called out in the markdown specification as something that should not be done. See:

The implication of the “one or more consecutive lines of text” rule is that Markdown supports “hard-wrapped” text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type’s “Convert Line Breaks” option) which translate every line break character in a paragraph into a
tag.

See https://www.nuget.org/packages/dotnet-gcm/ for another example.

@kzu kzu changed the title Package readme display forces new line between images/badges or when there is newlines in the source Package readme display creates a <br> for every markdown newline, against markdown specification Jul 10, 2021
@flobernd
Copy link

flobernd commented Aug 2, 2022

@lyndaidaii This still seems to happen (again) when uploading a package to nuget.org. Could you please check that again?

@jozefizso
Copy link
Contributor

This issue should be reopened as Nuget creates new lines against the Markdown spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted UI improvement Low hanging fruit UI improvement Verified-Prod
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants