From 44dbeeb31ea42182180d0cbf83369c07a975deb1 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 2 Jul 2019 00:23:57 -0500 Subject: [PATCH] remove tables option --- docs/USING_ADVANCED.md | 2 -- lib/marked.js | 13 +------------ man/marked.1 | 5 +---- man/marked.1.txt | 11 ++++------- test/bench.js | 3 --- test/specs/run-spec.js | 2 +- 6 files changed, 7 insertions(+), 29 deletions(-) diff --git a/docs/USING_ADVANCED.md b/docs/USING_ADVANCED.md index 7978e330..fd9fbaf2 100644 --- a/docs/USING_ADVANCED.md +++ b/docs/USING_ADVANCED.md @@ -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.|

Asynchronous highlighting

diff --git a/lib/marked.js b/lib/marked.js index 2bd8b2f4..319a3c64 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -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 }; }; diff --git a/man/marked.1 b/man/marked.1 index 848b4424..5cc27ef8 100644 --- a/man/marked.1 +++ b/man/marked.1 @@ -8,7 +8,7 @@ marked \- a javascript markdown parser .B marked [\-o \fI\fP] [\-i \fI\fP] [\-\-help] [\-\-tokens] [\-\-pedantic] [\-\-gfm] -[\-\-breaks] [\-\-tables] [\-\-sanitize] +[\-\-breaks] [\-\-sanitize] [\-\-smart\-lists] [\-\-lang\-prefix \fI\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 diff --git a/man/marked.1.txt b/man/marked.1.txt index ea07ad36..56a8634b 100644 --- a/man/marked.1.txt +++ b/man/marked.1.txt @@ -4,10 +4,10 @@ NAME marked - a javascript markdown parser SYNOPSIS - marked [-o ] [-i ] [--help] [--tokens] - [--pedantic] [--gfm] [--breaks] [--tables] [--sanitize] - [--smart-lists] [--lang-prefix ] [--no-etc...] [--silent] - [filename] + marked [-o ] [-i ] [--help] [--tokens] [--pedantic] + [--gfm] [--breaks] [--sanitize] [--smart-lists] [--lang-prefix ] [--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. diff --git a/test/bench.js b/test/bench.js index 26ede38a..247728c5 100644 --- a/test/bench.js +++ b/test/bench.js @@ -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, diff --git a/test/specs/run-spec.js b/test/specs/run-spec.js index 02bcb043..a362af22 100644 --- a/test/specs/run-spec.js +++ b/test/specs/run-spec.js @@ -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');