Markdown Blockquotes

Blockquotes are used to quote others' words, highlight important information, or create special content areas. This chapter will detail various uses of blockquotes.

Basic Syntax

Use the > symbol to create blockquotes:

> This is a blockquote text.

Effect:

This is a blockquote text.

Multi-line Quotes

Continuous Quotes

Use > on each line:

> First line of quote.
> Second line of quote.
> Third line of quote.

Effect:

First line of quote. Second line of quote. Third line of quote.

Paragraph Quotes

Quotes containing multiple paragraphs:

> First paragraph of quote.
>
> Second paragraph of quote.

Effect:

First paragraph of quote.

Second paragraph of quote.

Nested Quotes

Use multiple > to create nested quotes:

> First level quote
>> Second level quote
>>> Third level quote

Effect:

First level quote

Second level quote

Third level quote

Practical Application

> Original text:
>> This is the quoted content.
>
> My comment: This point makes sense.

Other Elements in Quotes

Headings in Quotes

> ## Quote Heading
>
> This is quote content.

Effect:

Quote Heading

This is quote content.

Lists in Quotes

> List in quote:
>
> - Item one
> - Item two
> - Item three

Effect:

List in quote:

  • Item one
  • Item two
  • Item three

Code in Quotes

> Use the following command:
>
> ```bash
> npm install
> ```

Effect:

Use the following command:

npm install
> For more information visit [official documentation](https://example.com).

Effect:

For more information visit official documentation.

Quote Styles

Warning Box

> ⚠️ **Warning**
>
> This is a warning message, please pay attention!

Effect:

⚠️ Warning

This is a warning message, please pay attention!

Tip Box

> 💡 **Tip**
>
> This is a helpful tip.

Effect:

💡 Tip

This is a helpful tip.

Note Box

> ⚡ **Note**
>
> This is content that needs special attention.

Effect:

Note

This is content that needs special attention.

Info Box

> ℹ️ **Information**
>
> This is an information prompt.

Effect:

ℹ️ Information

This is an information prompt.

Quote Application Scenarios

1. Quote Famous Sayings

> "Life is like a box of chocolates, you never know what you're going to get."
>
> — Forrest Gump

Effect:

"Life is like a box of chocolates, you never know what you're going to get."

— Forrest Gump

2. Quote Literature

> Research shows that Markdown can improve writing efficiency by 30%.
>
> — Technical Writing Guide, 2024

3. Highlight Important Points

> **Important Tip**
>
> Please back up your data before performing this operation.

4. Code Comments

> **Note:** The following code only applies to Python 3.6+
>
> ```python
> def hello():
>     print("Hello, World!")
> ```

5. Version Notes

> **v2.0 New Features**
>
> - Dark mode support
> - Performance optimization
> - Fixed known issues

Custom Quote Styles

Use HTML and CSS

<blockquote style="border-left: 4px solid #42b983; padding-left: 1em; color: #42b983;">
This is a custom-styled blockquote.
</blockquote>

Use div Container

<div style="background-color: #f0f0f0; padding: 1em; border-radius: 5px;">
<strong>Tip:</strong> This is a custom tip box.
</div>

Quote Best Practices

1. Keep it Concise

✅ Recommended
> Short quotes are easier to read.

❌ Not Recommended
> This is a very very very very very very very very very very very very very very very very very very very long quote text.

2. Clearly Indicate Source

✅ Recommended
> "Knowledge is power."
>
> — Francis Bacon

❌ Not Recommended
> "Knowledge is power."

3. Use Nesting Appropriately

✅ Recommended
> Original
>> Quote

❌ Not Recommended
> Level 1
>> Level 2
>>> Level 3
>>>> Level 4 (too deep)

4. Blank Lines Before and After Quotes

✅ Recommended
This is the main text.

> This is a quote.

This is the main text.

❌ Not Recommended
This is the main text.
> This is a quote.
This is the main text.

Special Quote Formats

GitHub Style Alerts

Some platforms support special alert syntax:

> [!NOTE]
> This is a note.

> [!TIP]
> This is a tip.

> [!IMPORTANT]
> This is important information.

> [!WARNING]
> This is a warning message.

> [!CAUTION]
> This requires caution.

VitePress Style Alerts

::: tip
This is a tip
:::

::: warning
This is a warning
:::

::: danger
This is a danger warning
:::

::: info
This is information
:::

Quotes Combined with Other Elements

Quotes + Task Lists

> **Todo Items**
>
> - [x] Complete documentation
> - [ ] Code review
> - [ ] Deployment

Quotes + Tables

> **Configuration Parameters**
>
> | Parameter | Description | Default |
> |-----------|-------------|---------|
> | port | Port number | 3000 |
> | host | Host address | localhost |

Quotes + Images

> **Preview**
>
> ![Preview image](image.png)

Semantic Use of Quotes

Quote Others' Opinions

> As Einstein said: "Imagination is more important than knowledge."

Quote Document Content

> According to official documentation:
>
> Markdown is a lightweight markup language.

Highlight Important Information

> ⚠️ **Important**
>
> This operation cannot be undone, proceed with caution.

Supplementary Notes

> **Additional Note**
>
> This feature was introduced in version 2.0.

Common Questions

Space After Quote Symbol

It's recommended to add a space after >:

✅ Recommended
> Quote content

❌ Not Recommended
>Quote content

Blank Lines in Quotes

Blank lines in quotes also need >:

✅ Recommended
> First paragraph
>
> Second paragraph

❌ Not Recommended
> First paragraph

> Second paragraph

End of Quote

A blockquote ends with a blank line:

> This is a quote

This is the main text

Practice Exercises

Try creating the following quotes:

  1. A simple blockquote
  2. A quote containing multiple paragraphs
  3. A nested quote
  4. A quote containing a list
  5. A warning-style quote box

Quote Shortcuts

VS Code

  • Select text, then search "Toggle Block Comment" in command palette

Typora

  • Ctrl/Cmd + Shift + Q: Create blockquote

Obsidian

  • Ctrl/Cmd + <: Create blockquote

Summary

Blockquotes are important formatting tools in Markdown that can be used for:

  • Quoting others' words and opinions
  • Highlighting important information and warnings
  • Creating special content areas
  • Improving document readability

Using blockquotes properly can make your documents clearer and more professional.

Next: Learn detailed usage of Markdown Code.