remove tables option

This commit is contained in:
Tony Brix 2019-07-02 00:23:57 -05:00
parent d2e85d9b34
commit 44dbeeb31e
6 changed files with 7 additions and 29 deletions

View File

@ -25,7 +25,6 @@ marked.setOptions({
},
pedantic: false,
gfm: true,
tables: true,
breaks: false,
sanitize: false,
smartLists: true,
@ -56,7 +55,6 @@ console.log(marked(markdownString));
|silent |`boolean` |`false` |v0.2.7 |If true, the parser does not throw any exception.|
|smartLists |`boolean` |`false` |v0.2.8 |If true, use smarter list behavior than those found in `markdown.pl`.|
|smartypants |`boolean` |`false` |v0.2.9 |If true, use "smart" typographic punctuation for things like quotes and dashes.|
|tables |`boolean` |`true` |v0.2.7 |If true and `gfm` is true, use [GFM Tables extension](https://github.github.com/gfm/#tables-extension-).|
|xhtml |`boolean` |`false` |v0.3.2 |If true, emit self-closing HTML tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML.|
<h2 id="highlight">Asynchronous highlighting</h2>

View File

@ -101,12 +101,6 @@ block.gfm = merge({}, block.normal, {
table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/
});
/**
* GFM + Tables Block Grammar
*/
block.tables = merge({}, block.gfm);
/**
* Pedantic grammar (original John Gruber's loose markdown specification)
*/
@ -149,11 +143,7 @@ function Lexer(options) {
if (this.options.pedantic) {
this.rules = block.pedantic;
} else if (this.options.gfm) {
if (this.options.tables) {
this.rules = block.tables;
} else {
this.rules = block.gfm;
}
this.rules = block.gfm;
}
}
@ -1670,7 +1660,6 @@ marked.getDefaults = function() {
silent: false,
smartLists: false,
smartypants: false,
tables: true,
xhtml: false
};
};

View File

@ -8,7 +8,7 @@ marked \- a javascript markdown parser
.B marked
[\-o \fI<output>\fP] [\-i \fI<input>\fP] [\-\-help]
[\-\-tokens] [\-\-pedantic] [\-\-gfm]
[\-\-breaks] [\-\-tables] [\-\-sanitize]
[\-\-breaks] [\-\-sanitize]
[\-\-smart\-lists] [\-\-lang\-prefix \fI<prefix>\fP]
[\-\-no\-etc...] [\-\-silent] [\fIfilename\fP]
@ -72,9 +72,6 @@ Enable github flavored markdown.
.BI \-\-breaks
Enable GFM line breaks. Only works with the gfm option.
.TP
.BI \-\-tables
Enable GFM tables. Only works with the gfm option.
.TP
.BI \-\-sanitize
Sanitize output. Ignore any HTML input.
.TP

View File

@ -4,10 +4,10 @@ NAME
marked - a javascript markdown parser
SYNOPSIS
marked [-o <output>] [-i <input>] [--help] [--tokens]
[--pedantic] [--gfm] [--breaks] [--tables] [--sanitize]
[--smart-lists] [--lang-prefix <prefix>] [--no-etc...] [--silent]
[filename]
marked [-o <output>] [-i <input>] [--help] [--tokens] [--pedantic]
[--gfm] [--breaks] [--sanitize] [--smart-lists] [--lang-prefix <pre-
fix>] [--no-etc...] [--silent] [filename]
DESCRIPTION
marked is a full-featured javascript markdown parser, built for speed.
@ -56,9 +56,6 @@ OPTIONS
--breaks
Enable GFM line breaks. Only works with the gfm option.
--tables
Enable GFM tables. Only works with the gfm option.
--sanitize
Sanitize output. Ignore any HTML input.

3
test/bench.js vendored
View File

@ -29,7 +29,6 @@ function runBench(options) {
// Non-GFM, Non-pedantic
marked.setOptions({
gfm: false,
tables: false,
breaks: false,
pedantic: false,
sanitize: false,
@ -43,7 +42,6 @@ function runBench(options) {
// GFM
marked.setOptions({
gfm: true,
tables: false,
breaks: false,
pedantic: false,
sanitize: false,
@ -57,7 +55,6 @@ function runBench(options) {
// Pedantic
marked.setOptions({
gfm: false,
tables: false,
breaks: false,
pedantic: true,
sanitize: false,

View File

@ -35,7 +35,7 @@ function runSpecs(title, dir, showCompletionTable, options) {
});
}
runSpecs('GFM', './gfm', true, { gfm: true, pedantic: false, tables: true, headerIds: false });
runSpecs('GFM', './gfm', true, { gfm: true, pedantic: false, headerIds: false });
runSpecs('CommonMark', './commonmark', true, { gfm: false, pedantic: false, headerIds: false });
runSpecs('Original', './original', false, { gfm: false, pedantic: true });
runSpecs('New', './new');