What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

Premise

I've noticed this with blockquotes. Suppose you have a user who posts a bit of log (I'll omit the blockquote for effect):

Server lookup complete 11-20 12:33:14.503 I/AirMail ( 2555): Connecting... 11-20 12:33:14.523 I/AirMail ( 2555): Connecting changed: connected=true, network type=WIFI 11-20 12:33:16.473 D/dalvikvm( 2555): GC_FOR_MALLOC freed 3495 objects / 249160 bytes in 80ms

and the original (blockquoted):

Server lookup complete
11-20 12:33:14.503 I/AirMail ( 2555): Connecting...
11-20 12:33:14.523 I/AirMail ( 2555): Connecting changed: connected=true, network type=WIFI
11-20 12:33:16.473 D/dalvikvm( 2555): GC_FOR_MALLOC freed 3495 objects / 249160 bytes in 80ms

Oops, all them lines get wrapped if not blockquoted. Blockquote it, but you still don't get individual lines. Obviously that's because line feeds don't translate to HTML, you need <br/> after each line.

You could use <pre> but it's not well known (I think?) and there's no shortcut for it.

Markdown suggests using > before every line. There's also a nice feature for quickly blockquoting a lot of text (ctrl-q), but this has nasty effects:

Server lookup complete 11-20 12:33:14.463 I/AirMail ( 2555): Connecting to 184.72.156.89:1227 11-20 12:33:14.473 I/AirMail ( 2555): Connection aborted, shutting down. Network type=WIFI 11-20 12:33:14.503 I/AirMail ( 2555): Connecting... 11-20 12:33:14.523 I/AirMail ( 2555): Connecting changed: connected=true, network type=WIFI 11-20 12:33:16.473 D/dalvikvm( 2555): GC_FOR_MALLOC freed 3495 objects / 249160 bytes in 80ms

I know the Markdown documentation says > is used to emulate e-mail style quoting, but for one, I've never seen it used like this on SO, and for two, even in e-mail, it's fugly.

Proposal

What I suggest is making ctrl-q put the > mark before each line and put a nice <br/> after each line. That way, that log posted won't look like a huge block of garbage, but rather a block that's readable and somewhat more like the original.

share|improve this question
2  
Random sidenote: You can put two spaces after each line instead of <br/> to add a line wrap –  Michael Mrozek Nov 27 '10 at 17:36

2 Answers 2

up vote 1 down vote accepted

This is essentially the same suggestion as treating single line breaks in the markdown source as <br>s. The problem is this (not the text, that's from Wikipedia, but the wrapping):

Related (X)HTML elements include the <q> and <cite> elements for shorter, probably in-line, quotations and for citations
respectively. An (X)HTML attribute specific to the <blockquote> and <q> elements is cite= where the provenance of the
material quoted may be given. If the quotation is in a language other than that of the main document, lang= and maybe dir=
attributes may be relevant to specify the language of the quoted text and perhaps its direction, left-to-right or right-to-left.

Relationship to some wiki markup and usage In many Wiki markup languages, the semantics and effect of HTML <blockquote> is
different from the use of an initial colon in a paragraph, which may be translated into an HTML dd element enclosed within a
dl element. (That is a ‘data definition’ within a ‘definition list’, without there being any preceding ‘data term’ or dt
element).

share|improve this answer
    
I don't even have the possibility of viewing the source here... Nevertheless, we can see that what affects the line wrapping is the TEXTAREA wrapping, which is totally pointless, since the text is only going to be in a TEXTAREA for an infinitely small portion of its lifetime. There's got to be some sane way around this... –  MPelletier Nov 27 '10 at 17:08
    
@MPelletier: Sure you can view the source -- and the wrapping is the wrapping of the original text as I pasted it in (admittedly wrapped to a width of about 120 chars to prove the point), and then simulating your suggested behavior, i.e. making blockquotes treat line breaks as line breaks. –  balpha Nov 27 '10 at 17:20
    
In other words: It might be workable for your case of someone posting a log, but in the usual (and intended) case of inserting a quote, this would totally do the wrong thing. –  balpha Nov 27 '10 at 17:23
    
I had not seen it that way, that text, web-preformated, would indeed reformat. There really is no sane way out of this. OK, thanks for the explanation. –  MPelletier Nov 27 '10 at 19:23

Blockquote is incorrect. You should be using <pre> for this, or a code block -- though code blocks would cause unwanted syntax highlighting at the moment.

share|improve this answer
    
For some unfathomable reason I thought <pre> was shunned. Glad to know that's the way to go. Thanks! –  MPelletier Nov 27 '10 at 23:56

You must log in to answer this question.

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