Merge pull request #440 from budziq/force_runnable

added `mdbook-runnable` infostring support
This commit is contained in:
Steve Klabnik 2017-09-14 12:48:29 -04:00 committed by GitHub
commit a3b6e549e2
1 changed files with 1 additions and 1 deletions

View File

@ -547,7 +547,7 @@ fn add_playpen_pre(html: &str, playpen_config: &PlaypenConfig) -> String {
let classes = &caps[2]; let classes = &caps[2];
let code = &caps[3]; let code = &caps[3];
if classes.contains("language-rust") && !classes.contains("ignore") { if (classes.contains("language-rust") && !classes.contains("ignore")) || classes.contains("mdbook-runnable") {
// wrap the contents in an external pre block // wrap the contents in an external pre block
if playpen_config.is_editable() && if playpen_config.is_editable() &&
classes.contains("editable") || text.contains("fn main") || text.contains("quick_main!") { classes.contains("editable") || text.contains("fn main") || text.contains("quick_main!") {