I am doing unit-tests for Maruku and every once in a while I run into some doubts. I am posting a lot to the list, but all of these messages should be in-topic (tell me if not). Consider the input: --- `There is a literal backtick (\`) here.` `There is a literal backtick (\\`) here.` ``There is a literal backtick (`) here.`` --- The documentation says that line 2 and 3 are equivalent. (http://maruku.rubyforge.org/markdown_syntax.html#code) But this is Markdown.pl's result: --- <p><code>There is a literal backtick (\</code>) here.`</p> <p><code>There is a literal backtick (\\</code>) here.`</p> <p><code>There is a literal backtick (`) here.</code></p> --- Question 1: How do you do escaping in code blocks in your implementation? Question 2: How should I do escaping in my implementation? Question 2: What is the Markdown syntax for representing: 1) an inline code span whose string is "`" (only a backtick) 2) an inline code span whose string is "\" (only a backslash) ? -- Andrea Censi "Life is too important to be taken seriously" (Oscar Wilde) Web: http://www.dis.uniroma1.it/~censi
Andrea Censi <andrea at censi.org> wrote on 12/30/06 at 11:13 AM:> Consider the input: > --- > `There is a literal backtick (\`) here.` > > `There is a literal backtick (\\`) here.` > > ``There is a literal backtick (`) here.`` > --- > > The documentation says that line 2 and 3 are equivalent. > (http://maruku.rubyforge.org/markdown_syntax.html#code)Unless I'm forgetting something, the documentation is wrong. Or, more specifically, it is outdated. The idea is that there are no escapes in code spans. Just like with code blocks, the contents are treated literally. That means the only character you have to worry about escaping is ?`? itself, and instead of escaping it with a backslash or something, the rule is just that you increase the number of backticks used as the code span delimiters such that if the contents of the code span contains N consecutive backticks, you use N+1 backticks to delimit the span. This way it's really easy to include snippets of code that already contain backslashes.> Question 1: > How do you do escaping in code blocks in your implementation?I don't.> Question 2: > How should I do escaping in my implementation?You shouldn't.> Question 2: > What is the Markdown syntax for representing: > 1) an inline code span whose string is "`" (only a backtick)`` ` ``> 2) an inline code span whose string is "\" (only a backslash) > ?`\` -J.G.
A. Pagaltzis <pagaltzis at gmx.de> wrote on 12/31/06 at 3:50 PM:> For that matter, the current beta build of Markdown.pl is no > longer available from the site either; all links I tried are 404.Try: http://daringfireball.net/projects/download_files/Markdown_1.0.2b7.tbz -J.G.
403 Forbidden, for me just now. On 12/31/06, John Gruber <gruber at fedora.net> wrote:> A. Pagaltzis <pagaltzis at gmx.de> wrote on 12/31/06 at 3:50 PM: > > > For that matter, the current beta build of Markdown.pl is no > > longer available from the site either; all links I tried are 404. > > Try: > > http://daringfireball.net/projects/download_files/Markdown_1.0.2b7.tbz > > -J.G.