-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
rustdoc: don't strip <p> from stability notes #149741
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
base: main
Are you sure you want to change the base?
rustdoc: don't strip <p> from stability notes #149741
Conversation
|
Some changes occurred in HTML/CSS/JS. |
This comment has been minimized.
This comment has been minimized.
15636e0 to
ba1a361
Compare
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.
|
Wouldn't it be simpler to replace |
|
@GuillaumeGomez do you mean pre-parsing? that wouldn't work bc we disable inline html support for depreciation notes. honestly i'm tempted to say we should just completely break this over an edition, making it use normal markdown handling and telling people to escape their html tags and use |
|
Yeah, that would make more sense. |
|
I think I'll just go ahead and implement that change for EditionFuture, then add a class for the legacy word wrap behavior. Hopefully when edition 2027 is being drafted up someone greps for EditionFuture and finds that? I guess we could add the maybe-future-edition label to the issue to make it easier to find? Some might find it odd to make edition changes this far in advance, but I think it's a good idea in order to avoid crunch time. |
|
I think so too. Although I wonder if we really need to put it behind an edition change. Might be worth discussing with the team, don't you think? Eventually that will allow you to have less work to do. 😉 |
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
events in place of newlines, but that would be a significantly larger change.
fixes #149732
r? @GuillaumeGomez