Skip to content

Conversation

@ehuss
Copy link
Contributor

@ehuss ehuss commented Oct 26, 2025

This fixes an issue with how mdman was generating HTML for command-line options. It was incorrectly stripping the <p> tag in the description of the flag when the description had multiple blocks. The code was assuming the description was just a single paragraph, but that isn't correct when there are multiple paragraphs or other block-level elements like lists. This resulted in broken HTML tags.

The solution here is to stop stripping the <p> tags from the description, and instead to just use CSS to fix the spacing that it creates. (The specific CSS here will be part of mdbook 0.5.)

This will be required for mdbook 0.5 because it is stricter about having properly balanced HTML tags.

ehuss added 3 commits October 26, 2025 15:14
This test illustrates that the HTML is generated incorrectly with a
`</p>` tag.
The logic for stripping the `<p>` tag in the option description was not
considering that the description may contain other block elements. This
changes it so that it no longer strips the `<p>` tag. This was done due
to some spacing issues which are better resolved with CSS (and is
resolved in mdbook 0.5).
This rebuilds all the man pages with the fixed mdman `<p>` tag handling
to address the broken HTML. This includes a small CSS change to keep the
intended rendering.
@rustbot
Copy link
Collaborator

rustbot commented Oct 26, 2025

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 26, 2025
Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Confirmed that the generated pages look the same as before.

Would you mind sharing which mdbook change will fix this?

View changes since this review

@weihanglo weihanglo added this pull request to the merge queue Oct 27, 2025
Merged via the queue into rust-lang:master with commit 28b79ea Oct 27, 2025
25 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 27, 2025
@ehuss
Copy link
Contributor Author

ehuss commented Oct 27, 2025

The change is rust-lang/mdBook#2844 where it now parses HTML tags.

bors added a commit to rust-lang/rust that referenced this pull request Oct 29, 2025
Update cargo submodule

11 commits in 344c4567c634a25837e3c3476aac08af84cf9203..6c1b6100343691341b9e76c5acc594e78220f963
2025-10-15 15:01:32 +0000 to 2025-10-28 16:27:52 +0000
- feat(build-analysis): JSONL-based logging infra (rust-lang/cargo#16150)
- feat: support array of any types in Cargo config (rust-lang/cargo#16103)
- test(git): add more fetch-index backend interop  (rust-lang/cargo#16162)
- feat(git): support shallow fetch for Git CLI backend (rust-lang/cargo#16156)
- Fix mdman to not incorrectly strip `<p>` tags (rust-lang/cargo#16158)
- chore(triagebot): enable range-diff and review-changes-since (rust-lang/cargo#16152)
- Avoid specifying which version will change behavior (rust-lang/cargo#16153)
- Make shell completion variables private. (rust-lang/cargo#16144)
- More warning conversions (rust-lang/cargo#16143)
- Bump openssl-src to 300.3.5.4+3.5.4 (rust-lang/cargo#16140)
- build: remove duplicate dependency, consolidate over unicode-ident (rust-lang/cargo#16137)
@rustbot rustbot added this to the 1.93.0 milestone Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants