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

Sintax highlighting of ?Sized rust code is invalid #2416

Open
sgued opened this issue Jan 21, 2024 · 1 comment
Open

Sintax highlighting of ?Sized rust code is invalid #2416

sgued opened this issue Jan 21, 2024 · 1 comment

Comments

@sgued
Copy link
Contributor

sgued commented Jan 21, 2024

Bug Report

Environment

Zola version: 18.0

Expected Behavior

In a rust code block, in a template, ?Sized is valid and should be highlighted correctly.

image

Current Behavior

image

Step to reproduce

Build a site with syntax highlighting enable, and include the following valid rust code block:

pub struct Testing<T: ?Sized> {
    testing: T,
}

Workaround

This workaround fully disables highlighting of "invalid" code, so it may not be suitable for everyone.
Use css styles and add the following CSS, loaded after the syntax theme itself:

// Fix bad syntax highlighting of ?Sized
.z-invalid {
  color: inherit;
  background-color: inherit;
}

.z-illegal {
  color: inherit;
  background-color: inherit;
}
@Keats
Copy link
Collaborator

Keats commented Jan 21, 2024

It's a known issue: #1787

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants