Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Rust) Mismatched brackets in complex attribute #4032

Open
notriddle opened this issue Apr 3, 2024 · 4 comments
Open

(Rust) Mismatched brackets in complex attribute #4032

notriddle opened this issue Apr 3, 2024 · 4 comments
Labels
bug help welcome Could use help from community language

Comments

@notriddle
Copy link

Describe the issue
On an attribute with nested brackets, the ending brackets aren't highlighted the same as the starting brackets.

Which language seems to have the issue?
Rust

Are you using highlight or highlightAuto?
Discourse seems to use highlight.

Sample Code to Reproduce
image

Expected behavior

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

GitHub highlights this correctly, but highlight.js doesn't.

Additional context

https://users.rust-lang.org/t/a-display-error-of-the-forum/109255

https://meta.discourse.org/t/bad-rust-syntax-highlighting/302236

@notriddle notriddle added bug help welcome Could use help from community language labels Apr 3, 2024
@ryzen-xp
Copy link

/assign

@ryzen-xp
Copy link

hello @notriddle ,
Please assign me this issue .

@notriddle
Copy link
Author

I can't. Not a project member.

ryzen-xp added a commit to ryzen-xp/highlight.js that referenced this issue Oct 21, 2024
@joshgoebel
Copy link
Member

@ryzen-xp If you wanted to submit that PR here we could work on cleaning it up a a bit and getting it merged into main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community language
Projects
None yet
Development

No branches or pull requests

3 participants