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

No syntax highlighting, only in Firefox, and only on newer built crates #359

Closed
rossmacarthur opened this issue May 28, 2019 · 6 comments
Closed

Comments

@rossmacarthur
Copy link

rossmacarthur commented May 28, 2019

I can't figure out why this is happening.

  • Only happens on https://docs.rs not https://doc.rust-lang.org/std/
  • Happens on multiple crates but not all. It appears to only happen on crates built after a certain date (all older crates seem to be fine).
  • I am using Firefox 67.0 (64-bit) on macOS Mojave.
  • I have factory reset my Firefox, so deleted all addons, cookies, history, cache, everything and it still happens.
  • If I download the crate and run cargo doc or cargo +nightly doc I have no problems.
  • Not related to internet connection, happens on all networks.
  • No errors in console or anything.

Examples

https://docs.rs/url/1.7.2/url/

Screenshot 2019-05-28 at 07 41 22

https://docs.rs/url/1.7.1/url/

Screenshot 2019-05-28 at 07 42 28

@GuillaumeGomez
Copy link
Member

The strange thing is that the rules are present but don't seem to be applied. I have no idea what's going on...

@rossmacarthur
Copy link
Author

rossmacarthur commented May 29, 2019

This appears to be related to the "Source Code Pro" font. If I disable it, then the syntax highlighting works. I'm not sure if this is Firefox or a mismatch between font files and supported font-weights.

If I change the CSS from

@font-face {
 font-family:'Source Code Pro';
 font-style:normal;
 font-weight:400;
 src:url("SourceCodePro-Regular.woff") format('woff');
}

and use my local version

@font-face {
 font-family:'Source Code Pro';
 font-style:normal;
 font-weight:400;
 src:local("Source Code Pro");
}

It works perfectly

GIF of me changing the font

@GuillaumeGomez
Copy link
Member

cc @nical

@Manishearth
Copy link
Member

We ... uh, fixed this when we updated Source Code Pro. I'm not sure why it's broken again.

@Manishearth
Copy link
Member

Wait, we fixed this in rustdoc. docs.rs may not have updated its fonts

@rossmacarthur
Copy link
Author

I no longer have this issue.

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

3 participants