Blockquotes
===========

See [the spec](https://daringfireball.net/projects/markdown/syntax#blockquote)

Markdown uses email-style > characters for blockquoting. If you’re
familiar with quoting passages of text in an email message, then you
know how to create a blockquote in Markdown. It looks best if you hard
wrap the text and put a > before every line:
??basic

> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
> 
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.

    =>
    (div
      (blockquote
        (p "This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.")
        (p "Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.")))

Markdown allows you to be lazy and only put the > before the first line of a hard-wrapped paragraph:
[Note: The spec doesn't make clear whether this structure, missing the `>` between paragraphs,
should be taken to be a single blockquote.  I've taken it to be an acceptable interpretation
that it comes out as two.]
??lazy

> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.

> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
id sem consectetuer libero luctus adipiscing.

    =>
    (div
      (blockquote
       (p "This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus."))
      (blockquote
       (p "Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.")))

Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by adding additional levels of >:
??nested

> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.

    =>
    (div
      (blockquote
        (p "This is the first level of quoting.")
        (blockquote (p "This is nested blockquote."))
        (p "Back to the first level.")))

Blockquotes can contain other Markdown elements, including headers, lists, and code blocks:
??Other elements

> ## This is a header.
> 
> 1.   This is the first list item.
> 2.   This is the second list item.
> 
> Here's some example code:
> 
>     return shell_exec("echo $input | $markdown_script");

    =>
    (div
     (blockquote
      (h2 (a ((name "this-is-a-header")) "This is a header."))
      (ol
       (li "This is the first list item.")
       (li "This is the second list item."))
      (p "Here's some example code:")
      (pre "return shell_exec(\"echo $input | $markdown_script\");")))

Any decent text editor should make email-style quoting easy. For
example, with BBEdit, you can make a selection and choose Increase
Quote Level from the Text menu.

----
SPDX-FileCopyrightText: 2024 Norman Gray <https://nxg.me.uk>
SPDX-License-Identifier: BSD-2-Clause

