Add section on line breaks to Markdown documentation, update mathematical expressions too (#53662)
Co-authored-by: Jules <19994093+jules-p@users.noreply.github.com>
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 24 KiB |
@@ -199,6 +199,44 @@ Some text I want to provide a direct link to, but which doesn't have its own hea
|
|||||||
> [!TIP]
|
> [!TIP]
|
||||||
> Custom anchors are not considered by the automatic naming and numbering behavior of automatic heading links.
|
> Custom anchors are not considered by the automatic naming and numbering behavior of automatic heading links.
|
||||||
|
|
||||||
|
## Line breaks
|
||||||
|
|
||||||
|
If you're writing in issues, pull requests, or discussions in a repository, {% data variables.product.github %} will render a line break automatically:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
This example
|
||||||
|
Will span two lines
|
||||||
|
```
|
||||||
|
|
||||||
|
However, if you are writing in an .md file, the example above would render on one line without a line break. To create a line break in an .md file, you will need to include one of the following:
|
||||||
|
|
||||||
|
* Include two spaces at the end of the first line.
|
||||||
|
<pre>
|
||||||
|
This example
|
||||||
|
Will span two lines
|
||||||
|
</pre>
|
||||||
|
* Include a backslash at the end of the first line.
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
This example\
|
||||||
|
Will span two lines
|
||||||
|
```
|
||||||
|
|
||||||
|
* Include an HTML single line break tag at the end of the first line.
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
This example<br/>
|
||||||
|
Will span two lines
|
||||||
|
```
|
||||||
|
|
||||||
|
If you leave a blank line between two lines, both .md files and Markdown in issues, pull requests, and discussions will render the two lines separated by the blank line:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
This example
|
||||||
|
|
||||||
|
Will have a blank line separating both lines
|
||||||
|
```
|
||||||
|
|
||||||
## Images
|
## Images
|
||||||
|
|
||||||
You can display an image by adding <kbd>!</kbd> and wrapping the alt text in `[ ]`. Alt text is a short text equivalent of the information in the image. Then, wrap the link for the image in parentheses `()`.
|
You can display an image by adding <kbd>!</kbd> and wrapping the alt text in `[ ]`. Alt text is a short text equivalent of the information in the image. Then, wrap the link for the image in parentheses `()`.
|
||||||
|
|||||||
@@ -42,12 +42,14 @@ This sentence uses $\` and \`$ delimiters to show math inline: $`\sqrt{3x-1}+(1+
|
|||||||
|
|
||||||
To add a math expression as a block, start a new line and delimit the expression with two dollar symbols `$$`.
|
To add a math expression as a block, start a new line and delimit the expression with two dollar symbols `$$`.
|
||||||
|
|
||||||
|
>[!TIP] If you're writing in an .md file, you will need to use specific formatting to create a line break, such as ending the line with a backslash as shown in the example below. For more information on line breaks in Markdown, see "[AUTOTITLE](/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#line-breaks)."
|
||||||
|
|
||||||
```text
|
```text
|
||||||
**The Cauchy-Schwarz Inequality**
|
**The Cauchy-Schwarz Inequality**\
|
||||||
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
|
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
{% ifversion math-fenced-blocks %}
|
{% ifversion math-fenced-blocks %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user