-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rustdoc no longer honours --default-theme #87263
Comments
@rustbot modify labels +A-rustdoc-js +regression-from-stable-to-nightly |
FTR, a faster test is available if you hae a browser which blocks cookies and web storage: then you can just reload the page, as it always shows whatever the docs' built-in default is. |
@ijackson does this also happen on beta? |
Beta is fine. |
The first bad nightly is
|
(FTR, @jyn514, I am 100% in favour of using Tera instead of all those |
I have found the problem: the generated HTML now says:
instead of
The formatting is of no consequence, but the changes of I suspect that this may be the result of Tera's autoescaping function. Things are subtle here (primarily because of the crazy way the names of I will look at the code and send an MR. |
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. @rustbot label -I-prioritize +P-medium |
…Gomez rustdoc: Restore --default-theme, etc, by restoring varname escaping In rust-lang#86157 cd0f931 Use Tera templates for rustdoc. dropped the following transformation from the keys of the default settings element's `data-` attribute names: .map(|(k, v)| format!(r#" data-{}="{}""#, k.replace('-', "_"), Escape(v))) The `Escape` part is indeed no longer needed, because Tera does that for us. But the massaging of `-` to `_` is needed, for the (bizarre) reasons explained in the new comments. I have tested that the default theme function works again for me. I have also verified that passing (in shell syntax) '--default-theme="zork&"' escapes the value in the HTML. Closes rust-lang#87263
Steps to reproduce
Expected results
The documentation appears in the "ayu" (dark) theme.
Observed results
The documentation appears in the default (light) theme.
Notes
This works on stable. I haven't bisected it or anything.
Empirically, changing the default theme once works for any one browser profile with the default firefox settings. AIUI the setting is intended to be recorded in web local storage. However, my firefox configuration does not permit use of web storage or cookies, so it does not work. This is one of the reasons for the
--default-theme
option's existence.FTR I see this message in my JS console which seems to support this hypothesis:
Request to access cookie or storage on “file:///home/rustcargo/Rustup/Game/vecdeque-stableix/target/doc/vecdeque_stableix/struct.IntoIter.html” was blocked because we are blocking all storage access requests.
Meta
The text was updated successfully, but these errors were encountered: