mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-07-18 22:23:41 +09:00
Convert tables to markdown
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const turndown = require('turndown');
|
||||
const turndownPluginGfm = require('turndown-plugin-gfm');
|
||||
|
||||
function initTurndownService() {
|
||||
const turndownService = new turndown({
|
||||
@@ -7,6 +8,8 @@ function initTurndownService() {
|
||||
codeBlockStyle: 'fenced'
|
||||
});
|
||||
|
||||
turndownService.use(turndownPluginGfm.tables);
|
||||
|
||||
// preserve embedded tweets
|
||||
turndownService.addRule('tweet', {
|
||||
filter: node => node.nodeName === 'BLOCKQUOTE' && node.getAttribute('class') === 'twitter-tweet',
|
||||
|
||||
Reference in New Issue
Block a user