mirror of
https://github.com/rust-lang/mdBook
synced 2024-12-14 23:02:34 +00:00
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
1 changed files with 1 additions and 1 deletions
|
@ -319,7 +319,7 @@ fn add_playpen_pre(html: String) -> String {
|
|||
if classes.contains("language-rust") && !classes.contains("ignore") {
|
||||
// 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)
|
||||
} else {
|
||||
// we need to inject our own main
|
||||
|
|
Loading…
Reference in a new issue