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

Shawn Van Ittersum svicalifornia at gmail.com
Mon Oct 11 03:25:00 EDT 2010


As Eric pointed out, and Thomas announced before, the change occurred in 0.11 by making the leading '|' optional in table definitions.

I suggest again that this be solved by making kramdown ignore the contents of code blocks.  Then code blocks will, in a sense, be automatically "escaped."  Other instances of '|' to be ignored should be escaped by leading backslashes (\).

Shawn

On Sun, 10 Oct 2010 23:01:12 -0700, Matt Neuburg wrote:
> Thanks, Eric!
> 
> I guess, taking all of this into consideration, my suggestion on this 
> would be (1) escaping should work (2) nbsp; should not be emitted if 
> I've asked for numeric entities (3) it might be really cool if it 
> were possible optionally to turn OFF this new feature, i.e. table 
> lines without leading pipes.
> 
> Let's see what Thomas thinks. m.
> 
> On Oct 10, 2010, at 10:38 PM, Eric Sunshine wrote:
> 
>> The leading '|' on table lines became optional here: 
>> http://github.com/gettalong/kramdown/commit/5354385d6bec8c89e4d8c2c2b76f6d07433800c7
>> 
>> -- ES
>> 
>> 
>> On 10/11/2010 1:18 AM, Matt Neuburg wrote:
>>> Presumably, that is what used to happen, since I've had that line 
>>> in my page for months and many versions of kramdown. This behavior 
>>> is evidently new with this version of kramdown. (I'm sorry I can't 
>>> be more specific to say what I mean by "this version", but the 
>>> previous two versions that I was using were both called 0.11.0 and 
>>> so is this one, even though they are all three quite different from 
>>> each other.)
>>> 
>>> The docs do say, in fact, "Note that literal pipe characters need 
>>> to be escaped, even if they occur in code spans!" Now, maybe that 
>>> was never there before - if it was there, I never noticed it. But 
>>> in fact I could not find any way of escaping these pipe characters 
>>> so as to solve the problem. I mean, look, there are only three 
>>> possibilities: escape the first, escape the second, and escape 
>>> both. But none of those prevents the problem. m.
>>> 
>>> 
>>> On Oct 10, 2010, at 9:03 AM, 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.
>>>> 
>>>> Shawn
>>>> 
>>>> On Sun, 10 Oct 2010 08:34:04 -0700, Matt Neuburg wrote:
>>>>> require 'kramdown'
>>>>> s =<<END
>>>>> The operator `||` is called logical-or.
>>>>> END
>>>>> puts Kramdown::Document.new(s).to_html
>>>>> 
>>>>> 
>>>>> What I expect:
>>>>> 
>>>>> <p>The operator....
>>>>> 
>>>>> What I get:
>>>>> 
>>>>> <table>
>>>>>  <tbody>
>>>>>    <tr>
>>>>>      <td>The operator `</td>
>>>>>      <td>&nbsp;</td>
>>>>>      <td>` is called logical-or.</td>
>>>>>    </tr>
>>>>>  </tbody>
>>>>> </table>
>>>>> 
>>>>> There are actually two errors here. One is that&nbsp; must never be
>>>>> emitted, since I am using kramdown in an XSLT-processing context and
>>>>> &nbsp; is not a legal XML entity. Asking for :numeric output of entities
>>>>> makes no difference.
>>>>> 
>>>>> 
>>>>> However, the obvious larger error is that the table-parser has suddenly
>>>>> taken over and thinks this is a table. This is a new error (i.e. 
>>>>> since the
>>>>> last release I was using). m.
>>>>> 
>>>>> Workarounds: none found! I can't think what to do aside from trying to
>>>>> revert to an earlier version of kramdown. m.
>>>>> 
>>>>> --
>>>>> matt neuburg, phd = matt at tidbits.com, http://www.tidbits.com/matt/
>>>>> pantes anthropoi tou eidenai oregontai phusei
>>>>> Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
>>>>> AppleScript: the Definitive Guide, 2nd edition
>>>>> http://www.tidbits.com/matt/default.html#applescriptthings
>>>>> Take Control of Exploring&  Customizing Snow Leopard
>>>>> http://tinyurl.com/kufyy8
>>>>> RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
>>>>> TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> kramdown-users mailing list
>>>>> kramdown-users at rubyforge.org
>>>>> http://rubyforge.org/mailman/listinfo/kramdown-users
>>>> _______________________________________________
>>>> kramdown-users mailing list
>>>> kramdown-users at rubyforge.org
>>>> http://rubyforge.org/mailman/listinfo/kramdown-users
>>> 
>>> _______________________________________________
>>> kramdown-users mailing list
>>> kramdown-users at rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/kramdown-users
>>> 
>> _______________________________________________
>> kramdown-users mailing list
>> kramdown-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/kramdown-users
> 
> _______________________________________________
> kramdown-users mailing list
> kramdown-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/kramdown-users


More information about the kramdown-users mailing list