axodotdev / axodotdev/cargo-dist

Perform line un-wrapping on Markdown release notes

Open
#218 3 comments 1 reaction 0 assignees View on GitHub
feature request
Dominant language
Rust
Stars
2.1k
Forks
149
Avg merge
1d 11h
Merged PRs (30d)
32

Description

Many authors of `CHANGELOG.md`/`RELEASES.md` files (including the maintainers of `cargo-dist` itself!) insert newlines in long paragraphs in order to wrap them at 80-ish columns. When GitHub renders such Markdown when a user views an `.md` file in a repository, the newlines are converted into spaces, and wrapping is handled by the user's browser, as we all expect. However, when GitHub renders Markdown in the body of a GitHub release (or in an issue/PR comment or a few other places), the intra-paragraph newlines are rendered as hard line breaks. As a result, a CHANGELOG section like the below:

```markdown
# v1.2.3 (2023-04-16)

- Foo all the bars, and make sure the gnusto is no longer cleesh.
Fixes [#1](https://github.com/octocat/Spoon-Knife/issues/1) via
[PR #2](https://github.com/octocat/Spoon-Knife/pull/2)
(by [@some-user](https://github.com/some-user))
```

ends up looking like this in the release that `cargo-dist` creates:

> - Foo all the bars, and make sure the gnusto is no longer cleesh.
> Fixes [#1](https://github.com/octocat/Spoon-Knife/issues/1) via
> [PR #2](https://github.com/octocat/Spoon-Knife/pull/2)
> (by [@some-user](https://github.com/some-user))

I think we can agree this is suboptimal.

I therefore request that `cargo-dist` either unwrap or be given an option to unwrap Markdown paragraphs when generating release notes.

Contributor guide

Open the contributing guide

Research direction

Use the CHANGELOG.md/RELEASES.md example as input and inspect the generated GitHub release body. Verify how the release-note generation path handles wrapped Markdown paragraphs and intentional hard breaks. Done means the shown list item's intra-paragraph wrapping renders as spaces without changing other Markdown structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
release
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.