Improved support of TABLE
- migrated to node v5
- upgraded inclusion of turndown npm package to 7.0.0
- support tables with
captionandcolgroupelements - 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
Thank you so much! These changes really helped me a lot!!
NPM package created until pull request is approved (and maintained) https://www.npmjs.com/package/@guyplusplus/turndown-plugin-gfm
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.
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
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?
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.