turndown icon indicating copy to clipboard operation
turndown copied to clipboard

Do not support table convert

Open thanksqq opened this issue 3 years ago • 6 comments

The tool cannot convert table, remove all table marks. We should convert table to this format:

aaa bbb ccc
1 2 3
4 5 6
7 8 9

thanksqq avatar Aug 04 '22 07:08 thanksqq

GitHub Flavoured Markdown extension supports it: https://github.com/domchristie/turndown-plugin-gfm.

phy25 avatar Dec 04 '22 17:12 phy25

You can solve this problem by plugin turndown-plugin-gfm. The usage method is as follows:

import TurndownService from 'turndown';
import { gfm } from 'turndown-plugin-gfm';

const td = new TurndownService();
td.use(gfm);

CALLMELARE avatar Feb 03 '23 06:02 CALLMELARE

turndown-plugin-gfm is outdated, the last version is from 2017 and it doesn't work now a days. I need another solution

RobertoPegoraro avatar Jun 19 '23 16:06 RobertoPegoraro

turndown-plugin-gfm is outdated, the last version is from 2017 and it doesn't work now a days. I need another solution

Did you find any other solution?

adamalfredsson avatar Aug 31 '23 14:08 adamalfredsson

turndown-plugin-gfm is outdated, the last version is from 2017 and it doesn't work now a days. I need another solution

Did you find any other solution?

Yeap using: joplin-turndown-plugin-gfm

// For Node.js 
var TurndownService = require('turndown')
var turndownPluginGfm = require('joplin-turndown-plugin-gfm')

var gfm = turndownPluginGfm.gfm
var turndownService = new TurndownService()
turndownService.use(gfm)
var markdown = turndownService.turndown(html)
console.log(markdown)

RobertoPegoraro avatar Aug 31 '23 16:08 RobertoPegoraro

Yes! that new gfm plugin is working. Need to update docs - but thanks!

shaipetel avatar Jan 02 '24 15:01 shaipetel