Skip to content

Commit

Permalink
remove tables option
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Jul 2, 2019
1 parent d2e85d9 commit 44dbeeb
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 29 deletions.
2 changes: 0 additions & 2 deletions docs/USING_ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ marked.setOptions({
},
pedantic: false,
gfm: true,
tables: true,
breaks: false,
sanitize: false,
smartLists: true,
Expand Down Expand Up @@ -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>
Expand Down
13 changes: 1 addition & 12 deletions lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -1670,7 +1660,6 @@ marked.getDefaults = function() {
silent: false,
smartLists: false,
smartypants: false,
tables: true,
xhtml: false
};
};
Expand Down
5 changes: 1 addition & 4 deletions man/marked.1
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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
Expand Down
11 changes: 4 additions & 7 deletions man/marked.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
3 changes: 0 additions & 3 deletions test/bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ function runBench(options) {
// Non-GFM, Non-pedantic
marked.setOptions({
gfm: false,
tables: false,
breaks: false,
pedantic: false,
sanitize: false,
Expand All @@ -43,7 +42,6 @@ function runBench(options) {
// GFM
marked.setOptions({
gfm: true,
tables: false,
breaks: false,
pedantic: false,
sanitize: false,
Expand All @@ -57,7 +55,6 @@ function runBench(options) {
// Pedantic
marked.setOptions({
gfm: false,
tables: false,
breaks: false,
pedantic: true,
sanitize: false,
Expand Down
2 changes: 1 addition & 1 deletion test/specs/run-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 44dbeeb

Please sign in to comment.