turndown-plugin-gfm
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -73,3 +73,8 @@ var turndownPluginGfm = (function (exports) { | ||
rules.table = { | ||
filter: 'table', | ||
// Only convert tables with a heading row. | ||
// Tables with no heading row are kept using `keep` (see below). | ||
filter: function (node) { | ||
return node.nodeName === 'TABLE' && isHeadingRow(node.rows[0]) | ||
}, | ||
replacement: function (content) { | ||
@@ -127,2 +132,5 @@ // Ensure there are no blank lines | ||
function tables (turndownService) { | ||
turndownService.keep(function (node) { | ||
return node.nodeName === 'TABLE' && !isHeadingRow(node.rows[0]) | ||
}); | ||
for (var key in rules) turndownService.addRule(key, rules[key]); | ||
@@ -129,0 +137,0 @@ } |
@@ -74,3 +74,8 @@ 'use strict'; | ||
rules.table = { | ||
filter: 'table', | ||
// Only convert tables with a heading row. | ||
// Tables with no heading row are kept using `keep` (see below). | ||
filter: function (node) { | ||
return node.nodeName === 'TABLE' && isHeadingRow(node.rows[0]) | ||
}, | ||
replacement: function (content) { | ||
@@ -128,2 +133,5 @@ // Ensure there are no blank lines | ||
function tables (turndownService) { | ||
turndownService.keep(function (node) { | ||
return node.nodeName === 'TABLE' && !isHeadingRow(node.rows[0]) | ||
}); | ||
for (var key in rules) turndownService.addRule(key, rules[key]); | ||
@@ -130,0 +138,0 @@ } |
@@ -70,3 +70,8 @@ var highlightRegExp = /highlight-(?:text|source)-([a-z0-9]+)/; | ||
rules.table = { | ||
filter: 'table', | ||
// Only convert tables with a heading row. | ||
// Tables with no heading row are kept using `keep` (see below). | ||
filter: function (node) { | ||
return node.nodeName === 'TABLE' && isHeadingRow(node.rows[0]) | ||
}, | ||
replacement: function (content) { | ||
@@ -124,2 +129,5 @@ // Ensure there are no blank lines | ||
function tables (turndownService) { | ||
turndownService.keep(function (node) { | ||
return node.nodeName === 'TABLE' && !isHeadingRow(node.rows[0]) | ||
}); | ||
for (var key in rules) turndownService.addRule(key, rules[key]); | ||
@@ -126,0 +134,0 @@ } |
@@ -74,3 +74,8 @@ 'use strict'; | ||
rules.table = { | ||
filter: 'table', | ||
// Only convert tables with a heading row. | ||
// Tables with no heading row are kept using `keep` (see below). | ||
filter: function (node) { | ||
return node.nodeName === 'TABLE' && isHeadingRow(node.rows[0]) | ||
}, | ||
replacement: function (content) { | ||
@@ -128,2 +133,5 @@ // Ensure there are no blank lines | ||
function tables (turndownService) { | ||
turndownService.keep(function (node) { | ||
return node.nodeName === 'TABLE' && !isHeadingRow(node.rows[0]) | ||
}); | ||
for (var key in rules) turndownService.addRule(key, rules[key]); | ||
@@ -130,0 +138,0 @@ } |
@@ -70,3 +70,8 @@ var highlightRegExp = /highlight-(?:text|source)-([a-z0-9]+)/; | ||
rules.table = { | ||
filter: 'table', | ||
// Only convert tables with a heading row. | ||
// Tables with no heading row are kept using `keep` (see below). | ||
filter: function (node) { | ||
return node.nodeName === 'TABLE' && isHeadingRow(node.rows[0]) | ||
}, | ||
replacement: function (content) { | ||
@@ -124,2 +129,5 @@ // Ensure there are no blank lines | ||
function tables (turndownService) { | ||
turndownService.keep(function (node) { | ||
return node.nodeName === 'TABLE' && !isHeadingRow(node.rows[0]) | ||
}); | ||
for (var key in rules) turndownService.addRule(key, rules[key]); | ||
@@ -126,0 +134,0 @@ } |
{ | ||
"name": "turndown-plugin-gfm", | ||
"description": "Turndown plugin to add GitHub Flavored Markdown extensions.", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Dom Christie", | ||
@@ -6,0 +6,0 @@ "main": "lib/turndown-plugin-gfm.cjs.js", |
24306
315230
695