<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-336308386934546555.post735938443884589256..comments</id><updated>2010-01-28T05:07:44.171+08:00</updated><title type='text'>Comments on C for Coding: Markdown and an Introduction to Parsing Expression...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.cforcoding.com/feeds/735938443884589256/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default'/><link rel='alternate' type='text/html' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html'/><author><name>William Shields</name><uri>http://www.blogger.com/profile/18356811199950883367</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-336308386934546555.post-7043850550269887230</id><published>2010-01-28T05:07:44.171+08:00</published><updated>2010-01-28T05:07:44.171+08:00</updated><title type='text'>In looking at what else is out there, you're also ...</title><content type='html'>In looking at what else is out there, you&amp;#39;re also looking at Pandoc, right?  If nothing else the page http://code.google.com/p/pandoc/wiki/PandocVsMarkdownPl should be full of helpful corner cases to test.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/7043850550269887230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/7043850550269887230'/><link rel='alternate' type='text/html' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html?showComment=1264626464171#c7043850550269887230' title=''/><author><name>dtm</name><uri>http://dtm.livejournal.com/</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html' ref='tag:blogger.com,1999:blog-336308386934546555.post-735938443884589256' source='http://www.blogger.com/feeds/336308386934546555/posts/default/735938443884589256' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-336308386934546555.post-5914332226980671418</id><published>2010-01-25T22:17:18.249+08:00</published><updated>2010-01-25T22:17:18.249+08:00</updated><title type='text'>Thank.  You.  So.  Much.  

I was trying to write ...</title><content type='html'>Thank.  You.  So.  Much.  &lt;br /&gt;&lt;br /&gt;I was trying to write markdown in ANTLR and I was pulling my hair out because I felt like I was missing something essential, but this definitely clears things up.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/5914332226980671418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/5914332226980671418'/><link rel='alternate' type='text/html' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html?showComment=1264429038249#c5914332226980671418' title=''/><author><name>Scott Frazer</name><uri>http://www.blogger.com/profile/18169057624973689937</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html' ref='tag:blogger.com,1999:blog-336308386934546555.post-735938443884589256' source='http://www.blogger.com/feeds/336308386934546555/posts/default/735938443884589256' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-336308386934546555.post-5297085659035308476</id><published>2010-01-25T00:55:39.849+08:00</published><updated>2010-01-25T00:55:39.849+08:00</updated><title type='text'>Hi - I'm the author of peg-markdown, and also of t...</title><content type='html'>Hi - I&amp;#39;m the author of peg-markdown, and also of two other PEG-based markdown parsers: lunamark, in lua (http://github.com/jgm/lunamark), and markdown-peg, in Haskell (http://github.com/jgm/markdown-peg).  So I understand about itches you can&amp;#39;t scratch.  It wouldn&amp;#39;t be hard at all to extend peg-markdown or lunamark to parse other wiki-like formats, but I haven&amp;#39;t gotten around to that.&lt;br /&gt;&lt;br /&gt;PEG isn&amp;#39;t *quite* capable of parsing markdown, so I had to resort to some workarounds.  For example, the markdown syntax for inline code is:  for any n, a sequence of n backticks, then a string of characters (possibly including backticks) ended by a sequence of n backticks.  (I&amp;#39;m simplifying; there are also some optional spaces.)  It&amp;#39;s easy enough in a PEG to specify this rule for any particular n, but there&amp;#39;s no way to specify it for arbitrary n.  I dealt with this in peg-markdown by limiting n to 1-5, which should be enough for any conceivable ordinary use.  In lunamark, I was able to implement the full rule, because the luapeg library is more powerful than standard PEG.&lt;br /&gt;&lt;br /&gt;I dealt with quotations, lists, and other constructs that embed lists of block elements by running the parser again on them, recursively.  This isn&amp;#39;t ideal, but I couldn&amp;#39;t think of another way to do it with PEG.&lt;br /&gt;&lt;br /&gt;As for memory usage, it&amp;#39;s true that PEG parsers use a lot; peg-markdown uses about 4M of heap space while parsing a 179K file.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/5297085659035308476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/5297085659035308476'/><link rel='alternate' type='text/html' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html?showComment=1264352139849#c5297085659035308476' title=''/><author><name>John MacFarlane</name><uri>http://johnmacfarlane.net</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html' ref='tag:blogger.com,1999:blog-336308386934546555.post-735938443884589256' source='http://www.blogger.com/feeds/336308386934546555/posts/default/735938443884589256' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-336308386934546555.post-6934078392523343734</id><published>2010-01-24T22:45:42.272+08:00</published><updated>2010-01-24T22:45:42.272+08:00</updated><title type='text'>Whoops, forgot to add that PEG parsers aren't real...</title><content type='html'>Whoops, forgot to add that PEG parsers aren&amp;#39;t really suitable for use on webservers (where Markdown is most often found) because of their large memory footprints. A malicious user could try to DoS the server by submitting large slabs of text, rapidly exhausting the memory resources.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/6934078392523343734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/6934078392523343734'/><link rel='alternate' type='text/html' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html?showComment=1264344342272#c6934078392523343734' title=''/><author><name>Wincent Colaiuta</name><uri>https://wincent.com/</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html' ref='tag:blogger.com,1999:blog-336308386934546555.post-735938443884589256' source='http://www.blogger.com/feeds/336308386934546555/posts/default/735938443884589256' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-336308386934546555.post-890536131372794267</id><published>2010-01-24T22:41:58.948+08:00</published><updated>2010-01-24T22:41:58.948+08:00</updated><title type='text'>Hi. I'm the author of a wikitext-to-html translato...</title><content type='html'>Hi. I&amp;#39;m the author of a wikitext-to-html translator (see http://wikitext.rubyforge.org/ for details) and while wiki markup is not Markdown it does share some characteristics.&lt;br /&gt;&lt;br /&gt;I also looked at using ANTLR and in the end could only use it for the lexing part, not the parsing, because it really is best suited for well-formed computer languages where syntax errors are usually considered fatal and the translator is not expected to magically recover.&lt;br /&gt;&lt;br /&gt;The problem with Markdown and wikitext, apart from its context-sensitivity, is that it isn&amp;#39;t a programming language and input is often not well-formed.&lt;br /&gt;&lt;br /&gt;So quite close to the beginning of development I came to the conclusion that I was going to need a hand-coded parser. Later on I dumped ANTLR for the lexing and replaced it with  Ragel as it was much faster.&lt;br /&gt;&lt;br /&gt;I do have an interest in PEG and in fact one of my projects includes a flexible PEG parser generator (see http://walrus.wincent.com/ for info), but for unreliable, error-prone input like this kind of markup I still think hand-coded parsers are the only way to go.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/890536131372794267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/890536131372794267'/><link rel='alternate' type='text/html' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html?showComment=1264344118948#c890536131372794267' title=''/><author><name>Wincent Colaiuta</name><uri>https://wincent.com/</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html' ref='tag:blogger.com,1999:blog-336308386934546555.post-735938443884589256' source='http://www.blogger.com/feeds/336308386934546555/posts/default/735938443884589256' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-336308386934546555.post-536490141475336364</id><published>2010-01-24T17:42:40.274+08:00</published><updated>2010-01-24T17:42:40.274+08:00</updated><title type='text'>Heh woops. Fixed. :)</title><content type='html'>Heh woops. Fixed. :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/536490141475336364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/536490141475336364'/><link rel='alternate' type='text/html' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html?showComment=1264326160274#c536490141475336364' title=''/><author><name>William Shields</name><uri>http://www.blogger.com/profile/18356811199950883367</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07140129710674369084'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html' ref='tag:blogger.com,1999:blog-336308386934546555.post-735938443884589256' source='http://www.blogger.com/feeds/336308386934546555/posts/default/735938443884589256' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-336308386934546555.post-2791937381034242593</id><published>2010-01-24T17:25:32.971+08:00</published><updated>2010-01-24T17:25:32.971+08:00</updated><title type='text'>"Scratch you can't itch"?</title><content type='html'>&amp;quot;Scratch you can&amp;#39;t itch&amp;quot;?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/2791937381034242593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/336308386934546555/735938443884589256/comments/default/2791937381034242593'/><link rel='alternate' type='text/html' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html?showComment=1264325132971#c2791937381034242593' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html' ref='tag:blogger.com,1999:blog-336308386934546555.post-735938443884589256' source='http://www.blogger.com/feeds/336308386934546555/posts/default/735938443884589256' type='text/html'/></entry></feed>