1
Fork 0

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:
Andy Russell 2020-06-27 13:55:15 -04:00
parent 2002ebacfb
commit c3ee75d956
No known key found for this signature in database
GPG key ID: BE2221033EDBC374
5 changed files with 133 additions and 22 deletions

View file

@ -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)
}