You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the compiler error index, like in other parts of the documentation, it is possible to click a 'Run' button to open a playground containing the code from a <code> block. Unlike in other parts of the documentation, this does not work, and opens the same page in a new tab instead.
The issue in the page's HTML is that the href attribute of the a element that shows the button is blank:
rustdoc: Improve playground run buttons
The main change is to stop using javascript to generate the URLs and use
rustdoc instead.
This also adds run buttons to the error index examples.
You can test the changes at https://ollie27.github.io/rust_doc_test/.
Fixes#36621Fixes#36910
In the compiler error index, like in other parts of the documentation, it is possible to click a 'Run' button to open a playground containing the code from a
<code>
block. Unlike in other parts of the documentation, this does not work, and opens the same page in a new tab instead.The issue in the page's HTML is that the
href
attribute of thea
element that shows the button is blank:<a class="test-arrow" target="_blank" href="">Run</a>
.In other parts of the documentation (e.g. the rust reference), this is not the case:
<a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=fn%20main()%20%7B%0A%20%20%20%20let%20a%20%3D%20%22foobar%22%3B%0Alet%20b%20%3D%20%22foo%5C%0A%20%20%20%20%20%20%20%20%20bar%22%3B%0A%0Aassert_eq!(a%2Cb)%3B%0A%7D">Run</a>
.This is likely an issue in the HTML generation, but I have not pinned down where exactly the generation goes wrong.
The text was updated successfully, but these errors were encountered: