Bad Rust syntax highlighting

Since A display error of the forum - meta - The Rust Programming Language Forum also happens on Meta, it looks like this is a problem in Discourse, not just our install.

#[derive(Parser)]
pub struct Arg {
  #[arg(short, long, default_values_t = [66,77])] // here, the brackets seems mismatched.
  pub(crate) arg1: Vec<u32>
}

Discourse uses highlightjs.org for syntax highlighting. I tried putting your snippet into their demo at Demo - highlight.js and it seems like the same issue is present:

So the best thing is probably to report the issue upstream to them (if there isn’t already a matching issue)

8 Likes
5 Likes