pegdown icon indicating copy to clipboard operation
pegdown copied to clipboard

Table generates extra white spaces

Open vmassol opened this issue 12 years ago • 3 comments

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 avatar Jan 10 '13 13:01 vmassol

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 avatar Jan 10 '13 13:01 vmassol

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

vmassol avatar Feb 14 '15 15:02 vmassol

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

sirthias avatar Feb 16 '15 10:02 sirthias