Skip to content

Commit 19146c4

Browse files
authored
Merge pull request #2557 from ehuss/fix-playground-edition
Fix playground edition detection
2 parents 98abb22 + 66ded23 commit 19146c4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/theme/book.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ function playground_text(playground, hidden = true) {
111111
let text = playground_text(code_block);
112112
let classes = code_block.querySelector('code').classList;
113113
let edition = "2015";
114-
if(classes.contains("edition2018")) {
115-
edition = "2018";
116-
} else if(classes.contains("edition2021")) {
117-
edition = "2021";
118-
}
114+
classes.forEach(className => {
115+
if (className.startsWith("edition")) {
116+
edition = className.slice(7);
117+
}
118+
});
119119
var params = {
120120
version: "stable",
121121
optimize: "0",

0 commit comments

Comments
 (0)