Skip to content

Conversation

@lolbinarycat
Copy link
Contributor

@lolbinarycat lolbinarycat commented Dec 7, 2025

I believe the reason we were doing this before was that write_html_fmt adds a \n after each

element.

I have worked around this by making white-space:pre-wrap apply only to the contents of each paragraph, so the inserted whitespace between paragraphs is not included.

Perhaps a better solution would be getting rid of pre-wrap entirely, and instead inserting
events in place of newlines, but that would be a significantly larger change.

fixes #149732

r? @GuillaumeGomez

I believe the reason we were doing this before was that
write_html_fmt adds a \n after each <p> element.
I have worked around this by making white-space:pre-wrap apply
only to the contents of each paragraph, so the inserted whitespace
between paragraphs is not included.

Perhaps a better solution would be getting rid of pre-wrap entirely,
and instead inserting <br> events in place of newlines, but that
would be a significantly larger change.
@rustbot
Copy link
Collaborator

rustbot commented Dec 7, 2025

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @lolbinarycat

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Dec 7, 2025
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
failures:

---- html::markdown::tests::test_markdown_html_escape stdout ----

thread 'html::markdown::tests::test_markdown_html_escape' (57774) panicked at src/librustdoc/html/markdown/tests.rs:475:9:
assertion `left == right` failed: original: `Struct<'a, T>`
  left: "<p><code>Struct&lt;'a, T&gt;</code></p>\n"
 right: "<code>Struct&lt;'a, T&gt;</code>"
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed::<alloc::string::String, &str>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Newlines in deprecation warning are handled strangely - double newlines are stripped completely

4 participants