Merge pull request #2557 from ehuss/fix-playground-edition

Fix playground edition detection
This commit is contained in:
Eric Huss 2025-02-26 14:02:34 +00:00 committed by GitHub
commit 19146c403e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -111,11 +111,11 @@ function playground_text(playground, hidden = true) {
let text = playground_text(code_block);
let classes = code_block.querySelector('code').classList;
let edition = "2015";
if(classes.contains("edition2018")) {
edition = "2018";
} else if(classes.contains("edition2021")) {
edition = "2021";
}
classes.forEach(className => {
if (className.startsWith("edition")) {
edition = className.slice(7);
}
});
var params = {
version: "stable",
optimize: "0",