Markdown not escaping link id

Christopher Biagini chris at assortedgeekery.com
Wed Oct 13 15:54:41 EDT 2004


On Oct 13, 2004, at 12:00 PM, John Gruber wrote:

> The only reason it doesn't work this way is that I thought perhaps
> some people would like to indent their link defs, to make them stand
> out from regular paragraphs.

Yes!

> I think people who do this will have to
> make do using two or three spaces, however.

For me, issues like this are actually one of the biggest sources of 
"the think of it" in Markdown-formatted documents.

In previous versions of Markdown, I'd always get caught up because I 
tend to introduce blockquotes with a colon at the end of the preceding 
line, and then indent them by a tab--triggering a code block. Now, 
other elements of the document are being turned into code blocks.  Each 
time it happens, I have to concern myself with Markdown syntax--which 
kind of wrecks the beauty of it all.

What's worse is that this syntax--colons, indenting, whatever--doesn't 
look like anything in particular. It's natural for the writer (well, me 
at least) to indent things like lists and quotations by one tab, simply 
because it's convenient and it looks right. Same goes for link 
definitions. I guess it depends on how often you write code examples, 
but I find that the structure that Markdown's new syntax imposes on my 
documents isn't worth the convenience of it making code blocks 
automatically.

Note that blockquotes don't have this problem--they're clearly defined 
with the conventional `>>`. Indeed, even code *spans* don't have this 
problem, because they too are so clearly defined. Why not require a 
clear definition for code blocks as well? Perhaps something like 
preceding each line in the block with a `|` character. This would 
eliminate any ambiguity in the syntax, and also allow the writer to 
structure the document any way he pleases.

Andy's example would then look like this:

	| [1]: http://daringfireball.net

This also has the added benefit of making code blocks stand out to a 
reader who's looking at a Markdown document that hasn't been converted 
yet.

	[1]: http://example.com "This is a real link def"

			* And these are real list items
			* And these are real list items
	
	|  [1]: http://example.com "This is example link syntax"
	|
	|  * And example list syntax
	|  * And example list syntax
	|  * And example list syntax


This is all just my two cents, of course. Markdown is an incredible 
tool as-is, but Andy's question just happened to strike a chord for me.

--Chris Biagini



More information about the Markdown-discuss mailing list