Citing the author of a blockquote using Markdown syntax

MarkdownCitations

Markdown Problem Overview


I am using the Symfony CMS and it uses Markdown for article writing. I need to do a blockquote of a quote from Benjamin Franklin and would like to have the quote followed by a citation beneath it, but right now all it does is blockquote the whole line. How does one do this in markdown syntax?

Markdown Solutions


Solution 1 - Markdown

Markdown has no dedicated citation syntax.

Your best bet is something like this:

> Quote here.
>
> -- <cite>Benjamin Franklin</cite>

which results in:

> Quote here. > > -- Benjamin Franklin

Solution 2 - Markdown

> The secret to creativity is knowing how to hide your sources. 
> -- <cite>[Albert Einstein][1]</cite>

[1]: http://www.quotedb.com/quotes/2112

If you have a style manual, use its guidelines to determine exactly where to place the citation, etc.

Output of Markdown + Smartypants for the above is

> The secret to creativity is knowing how to hide your sources. > -- Albert Einstein

Solution 3 - Markdown

> Quote

— Benjamin Franklin

According to the HTML Living Standard, attribution for the quotation must be placed outside the blockquote element.

> Attribution for the quotation, if any, must be placed outside the blockquote element.

HTML Standard: 4.4.4. The blockquote element

Note that the cite element represents the title of the work and must not be used to mark up people's names. For more detail check out HTML Standard: 4.5.6 The cite element.

Instead of the hyphen, it is common to use the em dash (U+2014). Many Markdown parsers support Unicode, which means you can write the em dash directly, instead of using HTML entities. Writing such characters directly improves readability, more tools will know what you want and not panic, and your document might be more portable as you are not bounding yourself to HTML.

Solution 4 - Markdown

Adding another sample here for reference. Generated from https://en.wikipedia.org/wiki/Special:CiteThisPage

> Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved to pass the new tests, only. 
>
> --- [Test-driven development. (2016, November 20). In Wikipedia, The Free Encyclopedia. Retrieved 23:45, November 20, 2016](https://en.wikipedia.org/w/index.php?title=Test-driven_development&oldid=750634597)

Produces the following:

> Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved to pass the new tests, only. > > --- Test-driven development. (2016, November 20). In Wikipedia, The Free Encyclopedia. Retrieved 23:45, November 20, 2016

Solution 5 - Markdown

1. Since any quote it is suppose to have a source, even if it is unknown.

2. Since a markdown > Quote is rendered as <blockquote><p>Quote</p></blockquote> and

> Quote1
>
> Quote2

is rendered as

<blockquote>
  <p>Quote1</p>
  <p>Quote2</p>
</blockquote>

My solution to this is always take the last <p></p> as source and handle it by css (in my case SCSS):

blockquote {
    p {
        display: inline;

        &:first-of-type {
            quotes: '\201C' '\201D' '\2018' '\2019';

            &::before {
                content: open-quote;
                margin-right: 0.1rem;
            }
        }

        &:last-of-type {
            quotes: '\201C' '\201D' '\2018' '\2019';
            font-style: italic;

            &::before {
                content: close-quote "\000A" "\2014" " ";
                white-space: pre;
                margin-left: 0.1rem;
                font-style: normal;
            }
        }
        
        // In case of a quote without a source.
        &:only-of-type {
            font-style: normal;
            quotes: '\201C' '\201D' '\2018' '\2019';

            &::before {
               content: open-quote;
               margin-right: 0.1rem;
            }

            &::after {
                content: close-quote;
                margin-left: 0.1rem;
            }
        }
    }
}

The \000A it the new line unicode character css format, it help to make the source in appear in the next line, if you don't want, just remove it and add some spaces there. The others are also unicode character css format.

Solution 6 - Markdown

Personally I prefer nesting a blockquote in a blockquote.

Here is how I like doing it:

> Quote here.
>
>> <cite>Benjamin Franklin</cite>

The output varies on how you style everything, but using plain `ol github look like this, which I personally think looks great!

enter image description here

https://gist.github.com/nahtnam/63e3a14acd0f02313ec0

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionCMS CriticView Question on Stackoverflow
Solution 1 - MarkdownceejayozView Answer on Stackoverflow
Solution 2 - MarkdownDarren MeyerView Answer on Stackoverflow
Solution 3 - MarkdowntouchmarineView Answer on Stackoverflow
Solution 4 - MarkdownDilini RajapakshaView Answer on Stackoverflow
Solution 5 - MarkdownUndefined BehaviorView Answer on Stackoverflow
Solution 6 - MarkdownnahtnamView Answer on Stackoverflow