-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #51803 - lucasem:rustdoc-code-hash-escape, r=GuillaumeG…
…omez 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 /// "; /// ``` ```
- Loading branch information
Showing
2 changed files
with
27 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters