Merge pull request #283 from budziq/quick_main

Do not add playpen boilerplate when using quick_main!
This commit is contained in:
Mathieu David 2017-05-18 09:29:57 +02:00 committed by GitHub
commit 7b6836b75e
1 changed files with 1 additions and 1 deletions

View File

@ -319,7 +319,7 @@ fn add_playpen_pre(html: String) -> String {
if classes.contains("language-rust") && !classes.contains("ignore") { if classes.contains("language-rust") && !classes.contains("ignore") {
// wrap the contents in an external pre block // wrap the contents in an external pre block
if text.contains("fn main") { if text.contains("fn main") || text.contains("quick_main!") {
format!("<pre class=\"playpen\">{}</pre>", text) format!("<pre class=\"playpen\">{}</pre>", text)
} else { } else {
// we need to inject our own main // we need to inject our own main