rustdoc: glue tokens before highlighting
Fixes #72684. This commit also modifies the signature of `Classifier::new` to avoid copying the source being highlighted.
This commit is contained in:
parent
2002ebacfb
commit
c3ee75d956
5 changed files with 133 additions and 22 deletions
|
@ -4525,7 +4525,12 @@ fn sidebar_foreign_type(buf: &mut Buffer, it: &clean::Item) {
|
|||
|
||||
fn item_macro(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Macro) {
|
||||
wrap_into_docblock(w, |w| {
|
||||
w.write_str(&highlight::render_with_highlighting(&t.source, Some("macro"), None, None))
|
||||
w.write_str(&highlight::render_with_highlighting(
|
||||
t.source.clone(),
|
||||
Some("macro"),
|
||||
None,
|
||||
None,
|
||||
))
|
||||
});
|
||||
document(w, cx, it)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue