Markdown Blocks and Code
Markdown rendering reference for blockquotes, rules, code blocks, tables, and raw HTML with source examples.
Contents
This is part 2 of the Markdown rendering reference.
Series:
- Basics
- Blocks, code, tables, and HTML (this post)
- Admonitions, footnotes, and mixed formatting
Blockquotes
Rendered:
Keep content simple first, then optimize structure.
Second paragraph inside the same quote.
- Quoted list item
- Another quoted list item
Nested quote level 2
Source:
> Keep content simple first, then optimize structure.
>
> Second paragraph inside the same quote.
>
> - Quoted list item
> - Another quoted list item
>
> > Nested quote level 2
Horizontal Rule
Rendered:
Source:
---
Code
Rendered:
Inline code example: fmt.Println("hello")
Indented code block:
line one (indented code)
line two (indented code)
Fenced code block (Go):
package main
import "fmt"
func main() {
fmt.Println("hello from goblogger")
}
Fenced code block (bash):
make test
make build
./dist/goblogger
Source:
Inline code example: `fmt.Println("hello")`
Indented code block:
line one (indented code)
line two (indented code)
Fenced code block (Go):
```go
package main
import "fmt"
func main() {
fmt.Println("hello from goblogger")
}
```
Fenced code block (bash):
```bash
make test
make build
./dist/goblogger
```
Tables
Rendered:
| Field | Value | Notes |
|---|---|---|
| Status | Active | Default test row |
| Type | Markdown test | Covers tables |
| Count | 3 | Numeric text |
Alignment table:
| Left | Center | Right |
|---|---|---|
| a | b | 1 |
| long text | centered | 99 |
Source:
| Field | Value | Notes |
| ---- | ---- | ---- |
| Status | Active | Default test row |
| Type | Markdown test | Covers tables |
| Count | 3 | Numeric text |
Alignment table:
| Left | Center | Right |
| :--- | :----: | ----: |
| a | b | 1 |
| long text | centered | 99 |
Raw HTML (Unsafe Renderer Enabled)
Rendered:
Expandable details block
This uses raw HTML and should render because the renderer enables unsafe HTML.
Marked text via HTML tag
Source:
<details>
<summary>Expandable details block</summary>
<p>This uses raw HTML and should render because the renderer enables unsafe HTML.</p>
</details>
<mark>Marked text via HTML tag</mark>
Prev: Part 1: Basics