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

Book copies code not displayed due to mdbook bug #32

Open
perrycate opened this issue Jun 30, 2018 · 5 comments
Open

Book copies code not displayed due to mdbook bug #32

perrycate opened this issue Jun 30, 2018 · 5 comments
Labels
bug Something isn't working upstream block Blocked by something we do not control

Comments

@perrycate
Copy link

perrycate commented Jun 30, 2018

https://rustwasm.github.io/book/hello-world.html

Some code on this page is incorrect, and is different from the source code. Presumably it was changed at some point and the site wasn't updated? Here is the offending snippet:

# #![allow(unused_variables)]
#fn main() {
#[no_mangle]
pub extern fn add_one(a: u32) -> u32 {
    a + 1
}
#}
@mtn
Copy link

mtn commented Jun 30, 2018

Assuming the code you're displaying is the result of using the "copy snippet" button (seems like it, since it displays fine), this is actually a bug upstream in mdbook (there's an open issue at the moment).

@perrycate
Copy link
Author

Actually, I wasn't copying the snippet, that's just how it was displayed. I just realized though that NoScript was active on the page. Once I disabled NoScript it displayed fine and the code was correct. I'm not sure how many people might view the page with javascript disabled, but here's what it looked like:

screenshot_20180630_141814

@mtn
Copy link

mtn commented Jun 30, 2018

Ah okay. Once that issue is resolved, this will be fixed as well. I haven't looked too much into how it'd be solved, but if you're interested it can be found here.

@mgattozzi mgattozzi added bug Something isn't working upstream block Blocked by something we do not control labels Jul 3, 2018
@mgattozzi mgattozzi changed the title Github.io site is out of date Book copies code not displayed due to mdbook bug Jul 3, 2018
@mgattozzi
Copy link
Contributor

Since we know the root cause and there's an issue for upstream I've changed the title name and added some labels, but until this gets changed in mdbook there's not much we can do about it. Thanks for bringing it to our attention though! :D

@yoyomo
Copy link

yoyomo commented Oct 17, 2022

fixed this in rust-lang/mdBook#1911 (comment) !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream block Blocked by something we do not control
Projects
None yet
Development

No branches or pull requests

4 participants