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

Improved support of TABLE #31

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

guyplusplus
Copy link

@guyplusplus guyplusplus commented Apr 21, 2021

  • migrated to node v5
  • upgraded inclusion of turndown npm package to 7.0.0
  • support tables with caption and colgroup elements
  • support conversion of a multi-lines cell to a single line cell
  • support pipe character | escape in a table cell
  • fix support for tables with no row
  • support for colspan
  • nested table inside a table render as is, gfm is not applied
  • added more test cases accordingly

@ct1735x
Copy link

ct1735x commented Jun 18, 2021

Thank you so much! These changes really helped me a lot!!

@guyplusplus
Copy link
Author

guyplusplus commented Jun 26, 2021

NPM package created until pull request is approved (and maintained)
https://www.npmjs.com/package/@guyplusplus/turndown-plugin-gfm

@alexanderadam
Copy link

NPM package created until pull request is approved (and maintained)
https://www.npmjs.com/package/@guyplusplus/turndown-plugin-gfm

That's great.
Maybe you can also point this PR to the other maintained fork?
I'm sure that @laurent22 would be more than happy to accept your PR (and maybe even some maintenance help).

This way, users won't be struggling which fork should be used.

@laurent22
Copy link

In fact we now publish two packages, which are used by the Joplin apps, but are generic enough that they should work in any environment:

https://www.npmjs.com/package/@joplin/turndown

https://www.npmjs.com/package/@joplin/turndown-plugin-gfm

Code is still MIT, and available there:

https://github.com/laurent22/joplin/tree/dev/packages/turndown

https://github.com/laurent22/joplin/tree/dev/packages/turndown-plugin-gfm

@guyplusplus
Copy link
Author

Sounds a good plan, especially after the dependencies to Joplin in the package have been removed couple weeks ago (reason why I did create my own fork).

Just couple things:

  • right now the package is a directory part of a bigger project, better split so that the npm package / repo can have its own life
  • this package shall follow closely the turndown new releases

I plan to add the following new features, to be discussed if makes sense and on the details:

  • support rowspan to generate a pure MD table (with empty cells)
  • add a new output option for "No HTML" so that HTML is not included nor generated in the output. In particular for tables where gfm is quite limited. Joplin can opt-out. When enabling it, it would mean no
    nor HTML nested table, which would be replaced as an ugly long line...

@laurent22 what do you think?

@laurent22
Copy link

For information, our Turndown plugins are now part of the official Joplin repository:

https://github.com/laurent22/joplin/tree/dev/packages/turndown

https://github.com/laurent22/joplin/tree/dev/packages/turndown-plugin-gfm

They are both still maintained and under the same MIT license. We accept pull requests.

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

Successfully merging this pull request may close these issues.

4 participants