[kramdown-users] kramdown table-making has gone completely insane

Thomas Leitner t_leitner at gmx.at
Mon Oct 11 03:50:00 EDT 2010

On 2010-10-11 03:03 +1100 Shawn Van Ittersum wrote:
> More generally, I think that kramdown should ignore the contents of
> any code block or span.  I can't think of a good reason for kramdown
> to interpret the contents of code blocks.  If it didn't, then this
> table creation problem would go away.

kramdown does ignore the contents of code spans and code blocks.
However, the parsing code for tables would be much more complex and
slower if we were to check for pipes in code spans. For example, what
about this:

    cell 1 | cell 2 with a `code | span
    ending here` | cell 4

It is actually rather hard to trigger a table since *each* line needs
to have at least one pipe character *and* the table has to be on block
boundaries. For example, the following is not converted to a table:

    This is just some paragraph, showing the `|` character
    and explaining why this is not a table.

So the problem with the example from Matt is that the paragraph is so
short that it fits on one line. Therefore you need to escape the pipe
characters in such cases.

-- Thomas

More information about the kramdown-users mailing list