Hi folks, I just wrote some Markdown which featured the following code snippets: <h1>TXJS 2011 Speakers</h1> <ul> <li><span>Brendan Eich</span></li> <li><span>Alex Russell</span></li> <li><span>Douglas Crockford</span></li> <li><span>Paul Irish</span></li> </ul> ul { list-style: square outside; color: #ccc; } li>span { color: #000; } The horrible styling above highlights the trailing whitespace a few lines from the end. I would love this to be converted to *two* code blocks rather than one. I realize that the fenced code extension provided by certain implementations makes it possible to generate `<pre><code>foo</code></pre>\n\n<pre><code>bar</code></pre>`, but it'd be nice to be able to achieve this within including a dozen tildes. :) Has anyone written a Markdown extension along these lines? David -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20110413/4ec5a5b2/attachment.html>
On Apr 13, 2011, at 5:59 PM, David Chambers wrote:> Hi folks, > > I just wrote some Markdown which featured the following code snippets: > > <h1>TXJS 2011 Speakers</h1> > <ul> > <li><span>Brendan Eich</span></li> > <li><span>Alex Russell</span></li> > <li><span>Douglas Crockford</span></li> > <li><span>Paul Irish</span></li> > </ul> > > ul { > list-style: square outside; > color: #ccc; > } > > li>span { > color: #000; > } > > The horrible styling above highlights the trailing whitespace a few > lines from the end. > > I would love this to be converted to two code blocks rather than one.How about putting a dummy html comment in the middle, like: Code block One <!-- two code blocks, please --> Code block Two -david parsons
Wondered what you were talking about until I switched over to viewing the message as HTML. In the plain-text portion, the trailing spaces were not present. Not safe to assume people don't read their plain-text. Especially on a Markdown discussion list. (Nor, if they do, that they'll see what you intend, since there's no standard specification for how to include HTML in email anyway.) </rant> On Apr 13, 2011, at 8:59 PM, David Chambers wrote:> <h1>TXJS 2011 Speakers</h1> > <ul> > <li><span>Brendan Eich</span></li> > <li><span>Alex Russell</span></li> > <li><span>Douglas Crockford</span></li> > <li><span>Paul Irish</span></li> > </ul> > > ul { > list-style: square outside; > color: #ccc; > } > > li>span { > color: #000; > } >
The short answer, in my experience, is no. When I've wanted to do something like that on my blog, I've rewritten it so I can put a little noncode (e.g., "Therefore," "And," "Later in the file") between the two code snippets. I suspect that a blank, unindented line between blocks doesn't create two code sections because it's impossible to visually distinguish between a between a blank line in the code and a blank line separating two bits of code. The only place where Markdown does something similar is with two (or more) spaces at the end of a line generate, a construct that can generate inadvertent <br /> tags. Dr. Drang