Parser question + Markdown "wysiwyg"

Bodhi bodhi at 5263.org
Wed Apr 21 07:00:31 EDT 2010


John, David, Albert, thanks for the suggestions.

On 21/04/2010, at 2:48 PM, John MacFarlane wrote:

>

> peg-markdown does construct a parse tree. If you apply the following

> patch, then 'make', then run 'markdown', you'll see the parse tree

> instead of the converted HTML. The parse tree doesn't include character

> offsets. I think it may be possible to change the code to include them;

> you'd have to check the peg/leg documentation.


I will investigate, and hopefully it doesn't get too complicated. I've done very little work with parsers and compilers, so it's a bit of a new experience for me.


> If you wanted to do the same for span-level markup, you'd be

> completely on your own. I'm sorry about that, but I never

> considered using discount as an interpreter instead of a compiler,

> and it would probably take a fairly extensive redesign to get it

> to work nicely without suffering a staggering performance penalty.


No no, thank you for pointing this out so I didn't go digging around for ages in discount!

Bodhi


More information about the Markdown-Discuss mailing list