Last Updated:
Tags: Markdown
Markdown officially supports Blockquotes.
To add a blockquote, add a >
before every line of the text:
> This is the first paragraph of the quote
>
> This is the second paragraph of the quote
which will be rendered as:
This is the first paragraph of the quote
This is the second paragraph of the quote
You can also add a single >
before a paragraph, if it is contained within a single line.
> This is all the same paragraph. All of the text remains on the same line in the Markdown file.
which will be rendered as:
This is all the same paragraph. All of the text remains on the same line in the Markdown file.
You can nest blockquotes with additional >
characters.
> This is the first level of quotes
>> This is the second level of quotes
> Now back to the first level
which will be rendered as:
This is the first level of quotes
This is the second level of quotes
Now back to the first level
You can also use the blockquote >
character in combination with other Markdown elements.
> * This is list item
> * and so is this
which will be rendered as:
- This is list item
- and so is this
While the Markdown blockquote syntax is handy, there's another way to create quotes using inline HTML, which is officially supported by Markdown.
So instead of using the >
character, I instead wrap quotes in a <blockquote>
html element,
<blockquote>This is my quote, and I don't have to worry about how it interacts with the other Markdown elements in the file</blockquote>
Which will of course create the following html:
This is my quote, and I don't have to worry about how it interacts with the other Markdown elements in the file
Alternatively, if you want an inline quote, the <q>
html element also works:
This isn't my quote <q>but this is </q>. Not my quote again.
Which is rendered in html as:
This isn't my quote but this is
. Not my quote again.
Markdown is so powerful because of it's flexibility. The Markdown blockquote syntax provides a handy shortcut (the >
character) to provide Markdown quotations, but Markdown's support for inline HTML allows for an alternative way to quote within Markdown.
You don't have to stick to just one either!
I usually use <q>
elements whenever I copy/paste text into my Markdown notes, to serve as a reminder that I didn't write the text myself.
I also find that using the >
character can cause problems with copy/paste, especially in text that I'm frequently editing. So I usually only use the >
character when I don't expect the text to change much (like this post).
If you haven't been using inline <q>
and <blockquote>
elements in your Markdown, give it a try!