9

I'm not sure if this would fall under a matter of opinion or not, I don't expect there to be a specific golden rule that must be followed.

I'm curious on when it's appropriate/best to use the "blockquote". The other formatting tools available are easy to understand and most likely are better used from what I've seen.

In most cases that I've seen "blockquote" used is for quoting a large text from a document, however, I've also seen it used to quote an error obtained when running a script. More so I've notice the latter method presented using code samples.

This question arose when I edited a question where the OP had his error listed as a normal text, so I went ahead and edited (along with other parts of the questions) into "code sample". Shortly after, another person, edited the same error using "blockqutoe"

So it really comes down to what's the case that makes it more presentable when asking or answering questions.

5
  • 2
    I'm editing my answers until I think they look pretty and concise. Jun 16, 2015 at 20:44
  • Shortly after, another person, edited the same error using "blockqutoe" - It is weird that an edit like that would get accepted. Were there other edits along with that or was that the only thing changed?
    – BSMP
    Jun 16, 2015 at 21:02
  • @BSMP that's the only thing he edited. The person had a higher rep than me. I didn't want to link that specific issue because my question is more about "blockquote" in general.
    – Leb
    Jun 16, 2015 at 21:15
  • Leb, assuming it was this question that you mean, it could be that you made the error an inline code block. Which looks ugly. If you look at the review of your edit you will see that the editor after you was actually a reviewer- They selected "Improve" which accepted your edit, but he then changed the error to be a quote. Really, that or a code block is fine, but an inline code block looks ugly. Use regular with highlighting off, or blockquote.
    – Kendra
    Jun 16, 2015 at 21:56
  • @Kendra, I really wasn't trying to point out any one specific post, hence the reason I didn't mention it in my original question. Reason for my question is that I see blockquote used throughout questions/answers without consistency. Did my edit needed improvement? Sure, but I'm not here to complain. I'm simply trying to find a good use for that formatting. As mentioned below and by you, code block with highlighting is a better alternative.
    – Leb
    Jun 16, 2015 at 23:45

2 Answers 2

7

It really depends on the specific situation, and it's usually a matter of opinion. Obviously, blockquotes are used for large quotes from text or documentation, but some also use them for errors.

The reason for this is typically something along the lines of "Well, the error is not code, but it's not something I wrote as part of my question, so I should probably use something to distinguish it from the rest of the text." It also may have something to do with the fact that error messages may have syntax coloring applied to them if used as part of a code block.

Personally, I prefer to use a code block without syntax coloring applied, like this:

[Error] Uncaught SyntaxError: Unexpected token ILLEGAL

Source:

<!-- language: lang-none -->

    [Error] Uncaught SyntaxError: Unexpected token ILLEGAL
3
  • 2
    Would be nice if we had something like 'language: wrap' which is just the same as an unhighlighted code-block, but allows wrapping if a line gets too long... Jun 16, 2015 at 21:04
  • 1
    I think that would be better use a code block without syntax coloring applied, it does present it better than "blockquote". But I agree, in the end it is a matter of opinion.
    – Leb
    Jun 16, 2015 at 21:17
  • 1
    If the error is a couple of sentences with no code keywords, I'll use a blockquote; if it's short and full of weird punctuation, I'll use a lang-none code block. If it's somewhere either side of that, I'll use my best judgement.
    – TRiG
    Jul 31, 2018 at 16:39
5

You might equally ask when should the HTML blockquote element (<blockquote>) be used, as you might reasonably expect the HTML rendering of the markdown to use an HTML blockquote element. Fortunately, there is some guidance from the W3C:

The blockquote element represents a section that is quoted from another source. Content inside a blockquote must be quoted from another source

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .