Skip to content

Commit ba4c07c

Browse files
GH Actions RunnerGH Actions Runner
authored andcommitted
publish: Merge pull request #34 from rust-lang/ci-fix
generated from commit bd69f0f
1 parent 1ca040f commit ba4c07c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+829
-1886
lines changed

404.html

Lines changed: 6 additions & 43 deletions
Large diffs are not rendered by default.

about-this-guide.html

Lines changed: 9 additions & 44 deletions
Large diffs are not rendered by default.

book.js

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,12 @@ function playground_text(playground) {
108108

109109
let text = playground_text(code_block);
110110
let classes = code_block.querySelector('code').classList;
111-
let has_2018 = classes.contains("edition2018");
112-
let edition = has_2018 ? "2018" : "2015";
113-
111+
let edition = "2015";
112+
if(classes.contains("edition2018")) {
113+
edition = "2018";
114+
} else if(classes.contains("edition2021")) {
115+
edition = "2021";
116+
}
114117
var params = {
115118
version: "stable",
116119
optimize: "0",
@@ -133,7 +136,15 @@ function playground_text(playground) {
133136
body: JSON.stringify(params)
134137
})
135138
.then(response => response.json())
136-
.then(response => result_block.innerText = response.result)
139+
.then(response => {
140+
if (response.result.trim() === '') {
141+
result_block.innerText = "No output";
142+
result_block.classList.add("result-no-output");
143+
} else {
144+
result_block.innerText = response.result;
145+
result_block.classList.remove("result-no-output");
146+
}
147+
})
137148
.catch(error => result_block.innerText = "Playground Communication: " + error.message);
138149
}
139150

@@ -151,12 +162,13 @@ function playground_text(playground) {
151162
if (window.ace) {
152163
// language-rust class needs to be removed for editable
153164
// blocks or highlightjs will capture events
154-
Array
155-
.from(document.querySelectorAll('code.editable'))
165+
code_nodes
166+
.filter(function (node) {return node.classList.contains("editable"); })
156167
.forEach(function (block) { block.classList.remove('language-rust'); });
157168

158169
Array
159-
.from(document.querySelectorAll('code:not(.editable)'))
170+
code_nodes
171+
.filter(function (node) {return !node.classList.contains("editable"); })
160172
.forEach(function (block) { hljs.highlightBlock(block); });
161173
} else {
162174
code_nodes.forEach(function (block) { hljs.highlightBlock(block); });
@@ -359,7 +371,14 @@ function playground_text(playground) {
359371
});
360372

361373
themePopup.addEventListener('click', function (e) {
362-
var theme = e.target.id || e.target.parentElement.id;
374+
var theme;
375+
if (e.target.className === "theme") {
376+
theme = e.target.id;
377+
} else if (e.target.parentElement.className === "theme") {
378+
theme = e.target.parentElement.id;
379+
} else {
380+
return;
381+
}
363382
set_theme(theme);
364383
});
365384

code-considerations/breaking-changes/behavior.html

Lines changed: 9 additions & 46 deletions
Large diffs are not rendered by default.

code-considerations/breaking-changes/fundamental.html

Lines changed: 9 additions & 46 deletions
Large diffs are not rendered by default.

code-considerations/breaking-changes/new-trait-impls.html

Lines changed: 11 additions & 48 deletions
Large diffs are not rendered by default.

code-considerations/breaking-changes/prelude.html

Lines changed: 10 additions & 47 deletions
Large diffs are not rendered by default.

code-considerations/breaking-changes/summary.html

Lines changed: 9 additions & 46 deletions
Large diffs are not rendered by default.

code-considerations/design/must-use.html

Lines changed: 9 additions & 46 deletions
Large diffs are not rendered by default.

code-considerations/design/public-apis.html

Lines changed: 9 additions & 46 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)