mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
rustdoc: don't give depreciation notes special handling
This commit is contained in:
@@ -109,13 +109,15 @@ pub(crate) struct MarkdownWithToc<'a> {
|
||||
pub(crate) edition: Edition,
|
||||
pub(crate) playground: &'a Option<Playground>,
|
||||
}
|
||||
/// A tuple struct like `Markdown` that renders the markdown escaping HTML tags
|
||||
|
||||
/// A struct like `Markdown` that renders the markdown escaping HTML tags
|
||||
/// and includes no paragraph tags.
|
||||
pub(crate) struct MarkdownItemInfo<'a> {
|
||||
pub(crate) content: &'a str,
|
||||
pub(crate) links: &'a [RenderedLink],
|
||||
pub(crate) ids: &'a mut IdMap,
|
||||
}
|
||||
|
||||
/// A tuple struct like `Markdown` that renders only the first paragraph.
|
||||
pub(crate) struct MarkdownSummaryLine<'a>(pub &'a str, pub &'a [RenderedLink]);
|
||||
|
||||
@@ -1497,10 +1499,10 @@ pub(crate) fn write_into(self, mut f: impl fmt::Write) -> fmt::Result {
|
||||
let p = SpannedLinkReplacer::new(p, links);
|
||||
let p = footnotes::Footnotes::new(p, existing_footnotes);
|
||||
let p = TableWrapper::new(p.map(|(ev, _)| ev));
|
||||
let p = p.filter(|event| {
|
||||
!matches!(event, Event::Start(Tag::Paragraph) | Event::End(TagEnd::Paragraph))
|
||||
});
|
||||
html::write_html_fmt(&mut f, p)
|
||||
// in legacy wrap mode, strip <p> elements to avoid them inserting newlines
|
||||
html::write_html_fmt(&mut f, p)?;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ fn t(input: &str, expect: &str) {
|
||||
let mut idmap = IdMap::new();
|
||||
let mut output = String::new();
|
||||
MarkdownItemInfo::new(input, &[], &mut idmap).write_into(&mut output).unwrap();
|
||||
assert_eq!(output, expect, "original: {}", input);
|
||||
assert_eq!(output, format!("<p>{}</p>\n", expect), "original: {}", input);
|
||||
}
|
||||
|
||||
t("`Struct<'a, T>`", "<code>Struct<'a, T></code>");
|
||||
|
||||
@@ -1585,7 +1585,6 @@ so that we can apply CSS-filters to change the arrow color in themes */
|
||||
color: var(--main-color);
|
||||
background-color: var(--stab-background-color);
|
||||
width: fit-content;
|
||||
white-space: pre-wrap;
|
||||
border-radius: 3px;
|
||||
display: inline;
|
||||
vertical-align: baseline;
|
||||
|
||||
@@ -30,3 +30,8 @@
|
||||
// 'Deprecated: shorthand reason: code$'
|
||||
#[deprecated = "shorthand reason: `code`"]
|
||||
pub struct X;
|
||||
|
||||
//@ matches deprecated/struct.Y.html '//*[@class="stab deprecated"]//p[1]' 'multiple'
|
||||
//@ matches deprecated/struct.Y.html '//*[@class="stab deprecated"]//p[2]' 'paragraphs'
|
||||
#[deprecated = "multiple\n\nparagraphs"]
|
||||
pub struct Y;
|
||||
|
||||
Reference in New Issue
Block a user