Skip to content

Commit

Permalink
Rollup merge of rust-lang#48964 - QuietMisdreavus:picket-fence, r=Gui…
Browse files Browse the repository at this point in the history
…llaumeGomez

tweak code fences in the rustdoc book

You can stack backticks to create "big code fences" if you're documenting some markdown and need to have code fences inside your code fences. This is especially important in this spot in the Rustdoc Book, because we're showing that using no language specifier on your code blocks is interpreted as using `rust`, but the code blocks here lose their code fences!

`````````markdown
``````markdown
Just showing some recursion, nbd.

```rust
println!("sup");
```
``````

(If you have edit powers in the rust-lang/rust repo, hit the edit button to view the source and see even more recursion :P)
`````````
  • Loading branch information
kennytm committed Mar 14, 2018
2 parents b5f102c + c802204 commit 57f7678
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/doc/rustdoc/src/documentation-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ running `rustdoc --test foo.rs` will extract this example, and then run it as a
Please note that by default, if no language is set for the block code, `rustdoc`
assumes it is `Rust` code. So the following:
``````markdown
```rust
let x = 5;
```
``````
is strictly equivalent to:
``````markdown
```
let x = 5;
```
``````

There's some subtlety though! Read on for more details.

Expand Down

0 comments on commit 57f7678

Please sign in to comment.