Display rustdoc pulldown switch warnings everytime
This commit is contained in:
@@ -1826,8 +1826,6 @@ fn render_markdown(w: &mut fmt::Formatter,
|
|||||||
prefix: &str,
|
prefix: &str,
|
||||||
scx: &SharedContext)
|
scx: &SharedContext)
|
||||||
-> fmt::Result {
|
-> fmt::Result {
|
||||||
// We only emit warnings if the user has opted-in to Pulldown rendering.
|
|
||||||
let output = if render_type == RenderType::Pulldown {
|
|
||||||
// Save the state of USED_ID_MAP so it only gets updated once even
|
// Save the state of USED_ID_MAP so it only gets updated once even
|
||||||
// though we're rendering twice.
|
// though we're rendering twice.
|
||||||
let orig_used_id_map = USED_ID_MAP.with(|map| map.borrow().clone());
|
let orig_used_id_map = USED_ID_MAP.with(|map| map.borrow().clone());
|
||||||
@@ -1851,12 +1849,9 @@ fn render_markdown(w: &mut fmt::Formatter,
|
|||||||
scx.markdown_warnings.borrow_mut().push((span, md_text.to_owned(), differences));
|
scx.markdown_warnings.borrow_mut().push((span, md_text.to_owned(), differences));
|
||||||
}
|
}
|
||||||
|
|
||||||
pulldown_output
|
write!(w, "<div class='docblock'>{}{}</div>",
|
||||||
} else {
|
prefix,
|
||||||
format!("{}", Markdown(md_text, RenderType::Hoedown))
|
if render_type == RenderType::Pulldown { pulldown_output } else { hoedown_output })
|
||||||
};
|
|
||||||
|
|
||||||
write!(w, "<div class='docblock'>{}{}</div>", prefix, output)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn document_short(w: &mut fmt::Formatter, item: &clean::Item, link: AssocItemLink,
|
fn document_short(w: &mut fmt::Formatter, item: &clean::Item, link: AssocItemLink,
|
||||||
|
|||||||
Reference in New Issue
Block a user