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 text = playground_text(code_block);
let classes = code_block.querySelector('code').classList; let classes = code_block.querySelector('code').classList;
let edition = "2015"; let edition = "2015";
if(classes.contains("edition2018")) { classes.forEach(className => {
edition = "2018"; if (className.startsWith("edition")) {
} else if(classes.contains("edition2021")) { edition = className.slice(7);
edition = "2021"; }
} });
var params = { var params = {
version: "stable", version: "stable",
optimize: "0", optimize: "0",