From c056df597ad5ee98d8a44206563d46d945210f8f Mon Sep 17 00:00:00 2001 From: Michal Budzynski Date: Wed, 13 Sep 2017 22:54:01 +0200 Subject: [PATCH] added `mdbook-runnable` infostring support makes `ignore`'d playpens runnable --- src/renderer/html_handlebars/hbs_renderer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index f33352c4..78640222 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -546,7 +546,7 @@ fn add_playpen_pre(html: &str, playpen_config: &PlaypenConfig) -> String { let classes = &caps[2]; 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 if playpen_config.is_editable() && classes.contains("editable") || text.contains("fn main") || text.contains("quick_main!") {