sirthias / pegdown

A pure-Java Markdown processor based on a parboiled PEG parser supporting a number of extensions
http://pegdown.org
Apache License 2.0
1.29k stars 218 forks source link

Table generates extra white spaces #71

Open vmassol opened 11 years ago

vmassol commented 11 years ago

Input:

    col1   | col2   |
    -------|--------|
    cell11 | cell12 |
    cell21 | cell22 |

will generate TextNode events with extra trailing whitespaces. For example I get TextNode("col1 ") instead of TextNode("col1") which I was expecting.

In this case whitespaces are not supposed to be meaningful and should not appear in the AST model IMO.

Now maybe you're doing this so that the AST can be serialized back into MD and thus generate exactly what the user had entered? If this is the case then I guess I'll have to do all the heavy processing in my Serializer... (I was hoping to avoid this ;)).

Let me know what's your take on this and please close the issue if you consider it invalid.

vmassol commented 11 years ago

FTR I've implemented a bridge between pegdown and XWiki Rendering here: https://github.com/xwiki/xwiki-rendering/tree/master/xwiki-rendering-syntaxes/xwiki-rendering-syntax-markdown

This allows XWiki Rendering to support the Markdown syntax. Thanks for your work!

vmassol commented 9 years ago

I was hoping that someone from the pegdown project could comment on this. Been 2 years now without answer :) Thanks

sirthias commented 9 years ago

I think the extra whitespace is a bug. It definitely hasn't been put in as result from a design decision.