Note that there are some explanatory texts on larger screens.

plurals
  1. POHow would you go about parsing Markdown?
    text
    copied!<blockquote> <p>Edit: I recently learned about a project called CommonMark, which correctly identifies and deals with the ambiguities in the original Markdown specification. <a href="http://commonmark.org/" rel="noreferrer">http://commonmark.org/</a> It has great C# library support.</p> </blockquote> <p>You can find the syntax <a href="http://daringfireball.net/projects/markdown/syntax" rel="noreferrer">here</a>.</p> <p>The source that follows with the download is written in <a href="http://en.wikipedia.org/wiki/Perl" rel="noreferrer">Perl</a>, which I have no intentions of honoring. It is riddled with regular expressions, and it relies on <a href="http://en.wikipedia.org/wiki/MD5" rel="noreferrer">MD5</a> hashes to escape certain characters. Something is just wrong about that!</p> <p>I'm about to hard code a parser for <a href="http://en.wikipedia.org/wiki/Markdown" rel="noreferrer">Markdown</a>. What is experience with this?</p> <p>If you don't have anything meaningful to say about the actual parsing of Markdown, spare me the time. (This might sound harsh, but yes, I'm looking for insight, not a solution, that is, a third-party library).</p> <p>To help a bit with the answers, regular expressions are meant to <strong>identify patterns</strong>! NOT to parse an entire grammar. That people consider doing so is foobar.</p> <ul> <li>If you think about Markdown, it's fundamentally based around the concept of paragraphs.</li> <li>As such, a reasonable approach might be to split the input into paragraphs. </li> <li>There are many kinds of paragraphs, for example, heading, text, list, blockquote, and code.</li> <li>The challenge is thus to identify these paragraphs and in what context they occur.</li> </ul> <p>I'll be back with a solution, once I find it's worthy to be shared.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload