Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: support table cell merging #29

Open
ec1oud opened this issue Dec 19, 2017 · 2 comments
Open

Feature request: support table cell merging #29

ec1oud opened this issue Dec 19, 2017 · 2 comments

Comments

@ec1oud
Copy link
Contributor

ec1oud commented Dec 19, 2017

That is, it should be possible for a cell to span multiple columns and maybe even multiple rows.

For example MultiMarkdown does it like this:

https://fletcher.github.io/MultiMarkdown-5/tables.html

I'd suggest to add columnSpan and rowSpan to MD_BLOCK_TD_DETAIL.

I'm trying to use md4c to add Markdown support to Qt (the table patch is https://codereview.qt-project.org/#/c/214901/ ) and this is the main low-hanging fruit I've seen so far, since QTextTable supports it already.

@mity
Copy link
Owner

mity commented Dec 26, 2017

I understand your motivation.

But, to be honest, I think that adopting too easily too many extensions (just because we can) would eventually result in a Markdown parser which gets much bigger, much less maintainable, and which would strongly contribute to Markdown syntax babel, making the overall situation worse, not better.

There seems to be absolutely no consensus that multiple pipes should be understood as cell spans. (MultiMarkdown even reports some error when trying to parse the 1st part of the table from its own documentation!)

For the multi-row cells, the situation is likely even worse because I have no idea how a reasonable syntax for it might look like, and there are probably even fewer Markdown implementations which attempt to support it.

Last but not least, if I understand you correctly, you want the feature because you can easily wire it to some feature of Qt and not because there are users who need it.

Taking it all together, under the current circumstances my motivation to implement this (or even merge such feature) is very close to zero.

@ec1oud
Copy link
Contributor Author

ec1oud commented Dec 26, 2017

As it is, I can detect that the cell is completely empty, but I wouldn't think it would be too hard for the parser to detect that the pipes are exactly adjacent without even whitespace between them. Maybe just set a flag then, and leave interpretation of the colspan up to the user?

Row merging might be too hard, I agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants