diff options
| author | bors <bors@rust-lang.org> | 2018-07-04 20:21:01 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-07-04 20:21:01 +0000 |
| commit | afaa40646542ca1e8fadb7e1d34197237e0fcd19 (patch) | |
| tree | 54ba3fcffed75bbca891eb65a004d1d843208568 /src/liballoc_system | |
| parent | 4af9132a022ebe4111395139d1a4e45e285d299a (diff) | |
| parent | ff2ff2b2b88f5948e1326809e70fbdf4db167097 (diff) | |
| download | rust-afaa40646542ca1e8fadb7e1d34197237e0fcd19.tar.gz rust-afaa40646542ca1e8fadb7e1d34197237e0fcd19.zip | |
Auto merge of #51803 - lucasem:rustdoc-code-hash-escape, r=GuillaumeGomez
rustdoc codeblock hash escape
So that docstring text such as the following (in a code block) can be created ergonomically:
```rust
let s = "
foo
# bar
baz
";
```
Such code in a docstring hide the <code> # bar</code> line.
Previously, using two consecutive hashes <code> ## bar</code> would turn the line into _shown_ `# bar`, losing the leading whitespace. A line of code like <code> # bar</code> (such as in the example above) **could not be represented** in the docstring text.
This commit makes the two consecutive hashes not also trim the leading whitespace — the two hashes simply **escape** into a single hash and do not hide the line, leaving the rest of that line unaffected. The new docstring text to achieve the above code block is:
```rust
/// ```
/// let s = "
/// foo
/// ## bar
/// baz
/// ";
/// ```
```
Diffstat (limited to 'src/liballoc_system')
0 files changed, 0 insertions, 0 deletions
