[ANN] vfmd

Michel Fortin michel.fortin at michelf.ca
Thu Sep 26 14:14:43 EDT 2013


Le 26-sept.-2013 à 12:17, Roopesh Chander <roop at forwardbias.in> a écrit :


> I'm pleased to announce the vfmd project to you all.

>

> vfmd is a variant of Markdown with a well-defined specification. The spec

> is ready - I'm working on a testsuite at present and intend to start making

> a working implementation after that.

>

> http://vfmd.github.io/

>

> I'm looking forward to knowing what you think. I'd especially like to hear

> from Michel Fortin and John MacFarlane, who have tried to define the

> Markdown syntax unambiguously in a spec or grammar before.



Great. You've written a parser in prose. I'm impressed that you managed to have captured a lot of subtleties of the language within a formal spec. Seriously, how much time did you put into that?

Ok, commenting as I read <http://vfmd.github.io/vfmd-spec/specification/>:


> A U+0009 (TAB) character in the input shall be treated as four consecutive U+0020 (SPACE) characters.


No. That's often not the case. If I write "*" followed by tab to begin a line, that tab represents three spaces, not four. The number of spaces represented by a tab is 4-(column_number modulo 4). But you probably knew that. ;-)

About paragraphs:


> 10. If none of the above conditions apply, then the block-element start line marks the start of a block-element of type paragraph.

>



> In order to find the block-element end line, we need to make use of a HTML parser. [...]


Oh oh... have you thought about code spans? If I write something like this:

This is `<pre>`.

Now the end tag: `</pre>`.

with your block-level algorithm that does not take code spans into account, the HTML parser would make the above a single paragraph instead of two. The same could happen if you had tag-like things in the tile of a link, or with partial tags:

This is `<sp`.

Now ending the tag: `an>`.

Or a comment.

You could either instruct the HTML parser to ignore span-level tags while you're trying to delimit blocks, or you need the parser to be aware of span-level Markdown syntax (basically parsing span-level syntax at the same time you're delimiting your paragraphs).

... or you could try to be less clever and ask the user to start the paragraph with a block-level tag if he wants to use block-level HTML elements (like Markdown.pl and PHP Markdown do).

- - -

I don't have more time to read the rest of your spec right now. But I like the way it goes. I'll post more comments later.


--
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca



More information about the Markdown-Discuss mailing list