Do not add playpen boilerplate quick_main! is used
code snippets using quick_main! macro from error-chain https://docs.rs/error-chain/0.10.0/error_chain/macro.quick_main.html no longer have `fn main` implicitly added
This commit is contained in:
parent
0443f8a709
commit
c99ce06370
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue