Fixes markdown rendering details where Gitea deviated from GitHub unintentionally, and adds a `/devtest/markdown` page to review markdown rendering. - Paragraphs get the intended 1.5 line height - Blockquotes, alerts and definition lists no longer inherit browser default margins - Loose task lists keep their spacing, the checkbox renders inside the paragraph like on GitHub - Footnote references render as `[1]` so adjacent ones stay apart without CSS - Code in headings, headings in summaries, nested ordered lists, tables, `<mark>`, alert icons and `<hr>` follow GitHub Co-authored-by: bircni <bircni@icloud.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3.9 KiB
Markdown
Text
Inline elements
Text with bold, italic, strikethrough, inline code, a link, an autolink https://gitea.com and Ctrl+C.
H2O, x2, marked, inserted, HTML, sample output, variable, small, quote
and emoji 👍 🎉.
Paragraphs
A paragraph with a soft line break
continues on the same line, while a hard break
starts a new line.
A second paragraph that is long enough to wrap onto multiple lines, so that the line height of paragraphs can be compared with the line height of list items further below.
Headings
Heading 1 with code
Heading 2 with code
Heading 3 with code
Heading 4 with code
Heading 5 with code
Heading 6 with code
Horizontal rule
Text above the rule.
Text below the rule.
Quotes
Blockquote
A blockquote with a paragraph.
A nested blockquote.
- A list in a blockquote
- Another item
code in a blockquote
Alerts
Note
Useful information that users should know, even when skimming content.
Tip
Helpful advice for doing things better or more easily.
Important
Key information users need to know to achieve their goal.
Warning
Urgent info that needs immediate user attention to avoid problems.
Caution
Advises about risks or negative outcomes of certain actions.
A second paragraph in an alert.
Lists
Tight list
- Item one
- Item two
- Nested item
- Deeper nested item
- Nested item
- Item three
Loose list
-
Item one
-
Item two with a second paragraph
The second paragraph.
-
Item three
Ordered list
- Item one
- Item two
- Nested item
- Deeper nested item
- Nested item
- Item three
Ordered list with type
- Item one
- Nested item with
type="a" - Another nested item
- Nested item with
Ordered list with start
- Item five
- Item six
Code block in list
- A tight item with a code block:
const a = 1; - Item after the code block
Task list
- Unchecked task
- Checked task
- Nested task
- Normal item
- Ordered task
- Ordered checked task
Loose task list
-
Loose task
-
Loose checked task
A second paragraph in a loose task.
Right-to-left task list
-
משימה
-
משימה שהושלמה
Code
Code blocks
package main
func main() {
println("hello")
}
A plain code block with a long line that needs to scroll horizontally: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
An indented code block
Math
Inline math E = mc^2 in a sentence.
\sum_{i=1}^n x_i
Tables
Table
| Left | Center | Right |
|---|---|---|
code |
1 | 1.00 |
| text | 22 | 22.00 |
| longer cell content | 333 | 333.00 |
| 4444 | 4444.00 |
Table with paragraphs
| Header | Header |
|---|---|
Paragraph in a cell | Text in a cell |
Other
Details
Closed details
Hidden content.
Open details
Visible content.
Heading in summary
Hidden content.
Definition list
- Term
- Definition
- First term
- Second term
- Shared definition