From 05e5309ea21615270c3f05982bfa56f0cbed99ba Mon Sep 17 00:00:00 2001 From: Tyler Akins Date: Fri, 13 Jul 2012 21:18:39 -0500 Subject: [PATCH 001/459] Initial commit of demo page Works in Chrome on Linux. Haven't tried with IE yet. --- www/demo.css | 153 +++++++++++++++++++++++++++++++ www/demo.html | 244 ++++++++++++++++++++++++++++++++++++++++++++++++++ www/demo.js | 105 ++++++++++++++++++++++ 3 files changed, 502 insertions(+) create mode 100644 www/demo.css create mode 100644 www/demo.html create mode 100644 www/demo.js diff --git a/www/demo.css b/www/demo.css new file mode 100644 index 00000000..fed6e03f --- /dev/null +++ b/www/demo.css @@ -0,0 +1,153 @@ +html, body { + margin: 0; + padding: 0; + font-family: Helvetica, Arial, Verdana, sans-serif; + background-color: #DDF; + height: 100%; +} + +textarea { + font-family: monospace; +} + +#header { + margin: 0; + padding: 0.4em 0 0 0; + text-align: center; + color: #002; +} + +#header h1 { + font-size: 2em; +} + +#header * { + margin: 0; + padding: 0; + line-height: 1em; + font-weight: 100; +} + +#header a { + color: #005; + position: relative; + z-index: 20; +} + +#bothContainers { + position: absolute; + top: 0; + bottom: 0; + margin-top: 2.4em; + width: 100%; +} + +#leftContainer, #rightContainer { + margin: 0; + padding: 0; + position: absolute; + width: 48.5%; + top: 0; + bottom: 0; +} + +#leftContainer { + float: left; + left: 1%; +} + +#rightContainer { + float: right; + right: 1%; +} + +#rightContainer > * { + float: right; +} + +.label { + margin: 0; + padding: 0; + position: relative; + width: 100%; + display: block; +} + +.label * { + position: relative; + font-weight: 900; +} + +.label span { + color: #444; +} + +#outputType { + display: block; + margin-left: auto; + font-weight: 900; + font-family: Arial, Verdana, sans-serif; + background-color: #dacccc; + color: #444; + border: 1px solid #999; +} + +.pane { + margin: 1.6em 0em 0.2em; + padding: 0.6em; + background-color: #eee; + display: block; + border: 1px solid #000; + top: 0; + bottom: 0; + left: 0; + right: 0; + position: absolute; + overflow: auto; +} + +#previewPane { + background-color: #f3eeee; +} + +#outputPane { + background-color: #6c6666; + color: #fff; + display: none; +} + +#syntaxPane { + background-color: #e6dede; + background-color: #f7ecec; + display: none; +} + +#inputPane { + background-color: #fff; +} + +#previewPane { + padding: 0; +} + +#previewPane > * { + margin-left: 4px; + margin-right: 4px; +} + +#previewPane > blockquote { + margin-left: 3em; +} + +#previewPane > :first-child { + margin-top: 4px; /* pane padding */ +} + +#previewPane * { + line-height: 1.4em; +} + +#previewPane code { + font-size: 1.3em; +} + diff --git a/www/demo.html b/www/demo.html new file mode 100644 index 00000000..4181e077 --- /dev/null +++ b/www/demo.html @@ -0,0 +1,244 @@ + + + Marked Demo Page + + + + + + + + +
+
+
+ Input +
+ +
+ +
+
+ +
+ +
+ + + + + +
+
+ + diff --git a/www/demo.js b/www/demo.js new file mode 100644 index 00000000..36668a4d --- /dev/null +++ b/www/demo.js @@ -0,0 +1,105 @@ +$(function () { + var $inputElem = $('#input'); + var $outputTypeElem = $('#outputType'); + var $previewElem = $('#preview'); + var $htmlElem = $('#html'); + var $lexerElem = $('#lexer'); + var $syntaxElem = $('#syntax'); + var inputDirty = true; + var $activeElem = null; + + if (top.document.location.href.match(/\?blank=1$/)) { + $inputElem.val(''); + } + + $outputTypeElem.change(function () { + $('#rightContainer .pane').hide(); + $activeElem = $('#' + $outputTypeElem.val()).show(); + }).change(); + + var noticeChange = function () { + inputDirty = true; + }; + $inputElem. + change(noticeChange). + keyup(noticeChange). + keypress(noticeChange). + keydown(noticeChange); + + var jsonString = function (input) { + var output = (input + ''). + replace(/\n/g, '\\n'). + replace(/\r/g, '\\r'). + replace(/\t/g, '\\t'). + replace(/\f/g, '\\f'). + replace(/[\\"']/g, '\\$&'). + replace(/\u0000/g, '\\0'); + return '"' + output + '"'; + }; + + var getScrollSize = function () { + var e = $activeElem[0]; + + return e.scrollHeight - e.clientHeight; + }; + var getScrollPercent = function () { + var size = getScrollSize(); + + if (size <= 0) { + return 1; + } + + return $activeElem.scrollTop() / size; + }; + var setScrollPercent = function (percent) { + $activeElem.scrollTop(percent * getScrollSize()); + }; + + var delayTime = 1; + var checkForChanges = function () { + if (inputDirty) { + inputDirty = false; + var startTime = new Date(); + + // Save scroll position + var scrollPercent = getScrollPercent(); + + // Convert + var markdown = $inputElem.val(); + var lexed = marked.lexer(markdown); + + // Grab lexed output and convert to a string before the parser + // destroys the data + var lexedList = []; + + for (var i = 0; i < lexed.length; i ++) { + var lexedLine = []; + for (var j in lexed[i]) { + lexedLine.push(j + ":" + jsonString(lexed[i][j])); + } + lexedList.push("{" + lexedLine.join(", ") + "}"); + } + + var parsed = marked.parser(lexed); + + // Assign + $previewElem.html(parsed); + $htmlElem.val(parsed); + $lexerElem.val(lexedList.join("\n")); + + // Set the scroll percent + setScrollPercent(scrollPercent); + + var endTime = new Date(); + delayTime = endTime - startTime; + if (delayTime < 50) { + delayTime = 50; + } else if (delayTime > 500) { + delayTime = 1000; + } + } + window.setTimeout(checkForChanges, delayTime); + }; + checkForChanges(); + setScrollPercent(0); +}); From f9e817d9fb5097fcb603a78612c2114b3ff0705f Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 15 Nov 2015 19:45:26 +0100 Subject: [PATCH 002/459] return null on non-string input --- lib/marked.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/marked.js b/lib/marked.js index 03251f3c..8ab79819 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1144,6 +1144,9 @@ function merge(obj) { */ function marked(src, opt, callback) { + // return null in case of non valid input + if (typeof src != 'string') return null; + if (callback || typeof opt === 'function') { if (!callback) { callback = opt; From afb3c556846bb2c612f2a29f70988b4e4cad4bec Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Wed, 16 Dec 2015 15:07:05 -0500 Subject: [PATCH 003/459] Added missing input flag without the input flag the CLI errors out --- man/marked.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/marked.1 b/man/marked.1 index b9bdc8c2..f3785335 100644 --- a/man/marked.1 +++ b/man/marked.1 @@ -23,7 +23,7 @@ cat in.md | marked > out.html .TP echo "hello *world*" | marked .TP -marked \-o out.html in.md \-\-gfm +marked \-o out.html -i in.md \-\-gfm .TP marked \-\-output="hello world.html" \-i in.md \-\-no-breaks From ff032bd83e7b4b7016a3fd2a574ee9f8252af150 Mon Sep 17 00:00:00 2001 From: Otto Jongerius Date: Sun, 24 Jan 2016 15:57:51 +1100 Subject: [PATCH 004/459] Values in example do not always match defaults. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index efa71aaa..57f16161 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ console.log(marked('I am using __markdown__.')); // Outputs:

I am using markdown.

``` -Example setting options with default values: +Example setting options: ```js var marked = require('marked'); From 82de6baed0a9df90b1d8b5570102acafa0c2e035 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Fri, 6 Oct 2017 20:40:21 -0400 Subject: [PATCH 005/459] Document the xhtml option --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 09f8ec33..9ed68f8e 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,8 @@ marked.setOptions({ pedantic: false, sanitize: false, smartLists: true, - smartypants: false + smartypants: false, + xhtml: false }); console.log(marked('I am using __markdown__.')); @@ -267,6 +268,13 @@ Default: `false` Use "smart" typograhic punctuation for things like quotes and dashes. +### xhtml + +Type: `boolean` +Default: `false` + +Self-close the tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML. + ## Access to lexer and parser You also have direct access to the lexer and parser if you so desire. From 1ec0bf387f2f4795217c787f49facff5e5cc9ecc Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 2 Jan 2018 15:10:01 +0100 Subject: [PATCH 006/459] print more descriptive error messages when source is undefined (as in #979) --- lib/marked.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 8ab79819..e6f8804e 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1144,8 +1144,13 @@ function merge(obj) { */ function marked(src, opt, callback) { - // return null in case of non valid input - if (typeof src != 'string') return null; + // throw error in case of non string input + if (typeof src == 'undefined' || src === null) + throw new Error('marked(): input parameter is undefined or null'); + if (typeof src != 'string') + throw new Error('marked(): input parameter is of type ' + + Object.prototype.toString.call(src) + ', string expected'); + if (callback || typeof opt === 'function') { if (!callback) { From b2a07608e102b4e7a164c99b9231b954a1efcec3 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 18 Oct 2014 13:04:16 +0200 Subject: [PATCH 007/459] fix backticks in inline code (fixes #312) --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 8fc72b3a..873427bc 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -458,7 +458,7 @@ var inline = { nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, - code: /^(`+)([\s\S]*?[^`])\1(?!`)/, + code: /^(`+)(\s*)([\s\S]*?[^`]?)\2\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, del: noop, text: /^[\s\S]+?(?=[\\ Date: Fri, 12 Jan 2018 17:28:57 +0100 Subject: [PATCH 008/459] add tests for codespans with backticks in them --- test/new/nested_code.html | 8 ++++++++ test/new/nested_code.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/test/new/nested_code.html b/test/new/nested_code.html index c3705920..c28a1628 100644 --- a/test/new/nested_code.html +++ b/test/new/nested_code.html @@ -1 +1,9 @@

hi ther `` ok ```

+ +

`

+ +

There is a literal backtick (`) here.

+ +

A backtick-delimited string in a code span: `foo`

+ +

Please don't use any <blink> tags.

\ No newline at end of file diff --git a/test/new/nested_code.md b/test/new/nested_code.md index 910e3d46..adde4177 100644 --- a/test/new/nested_code.md +++ b/test/new/nested_code.md @@ -1 +1,9 @@ ````` hi ther `` ok ``` ````` + +`` ` `` + +``There is a literal backtick (`) here.`` + +A backtick-delimited string in a code span: `` `foo` `` + +Please don't use any `` tags. \ No newline at end of file From de73c390389985c55e7d34cb8866a9c9b1d8b757 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Mon, 28 Jul 2014 13:17:42 +0200 Subject: [PATCH 009/459] strip unused argument (introduced in 2636f85) --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 8fc72b3a..ace6a7f8 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -936,7 +936,7 @@ Parser.parse = function(src, options) { */ Parser.prototype.parse = function(src) { - this.inline = new InlineLexer(src.links, this.options, this.renderer); + this.inline = new InlineLexer(src.links, this.options); this.tokens = src.reverse(); var out = ''; From 31dffdeb236ea406c9c3712f16e19942352d3811 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Mon, 28 Jul 2014 13:22:09 +0200 Subject: [PATCH 010/459] pass only the textual part as the 'raw' argument for heading renderer --- lib/marked.js | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index ace6a7f8..2134db51 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -909,6 +909,32 @@ Renderer.prototype.text = function(text) { return text; }; +/** + * TextRenderer + * returns only the textual part of the token + */ + +function TextRenderer() {} + +// no need for block level renderers + +TextRenderer.prototype.strong = +TextRenderer.prototype.em = +TextRenderer.prototype.codespan = +TextRenderer.prototype.del = +TextRenderer.prototype.text = function (text) { + return text; +} + +TextRenderer.prototype.link = +TextRenderer.prototype.image = function(href, title, text) { + return '' + text; +} + +TextRenderer.prototype.br = function() { + return ''; +} + /** * Parsing & Compiling */ @@ -937,6 +963,8 @@ Parser.parse = function(src, options) { Parser.prototype.parse = function(src) { this.inline = new InlineLexer(src.links, this.options); + // use an InlineLexer with a TextRenderer to extract pure text + this.inlineText = new InlineLexer(src.links, merge({}, this.options, {renderer: new TextRenderer})); this.tokens = src.reverse(); var out = ''; @@ -993,7 +1021,7 @@ Parser.prototype.tok = function() { return this.renderer.heading( this.inline.output(this.token.text), this.token.depth, - this.token.text); + unescape(this.inlineText.output(this.token.text))); } case 'code': { return this.renderer.code(this.token.text, From 60738f834392d86ec48c4bc3c3d6b46e1a05b00f Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Mon, 28 Jul 2014 13:45:56 +0200 Subject: [PATCH 011/459] export TextRenderer for convenience --- lib/marked.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/marked.js b/lib/marked.js index 2134db51..a901e612 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1326,6 +1326,7 @@ marked.Parser = Parser; marked.parser = Parser.parse; marked.Renderer = Renderer; +marked.TextRenderer = TextRenderer; marked.Lexer = Lexer; marked.lexer = Lexer.lex; From 015327bea2500adaeea1ac73aa704492d5aa5027 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Mon, 15 Jan 2018 03:21:13 +0100 Subject: [PATCH 012/459] fix test accordingly --- test/new/links_reference_style.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/new/links_reference_style.html b/test/new/links_reference_style.html index 2ec1b41f..e12da3f2 100644 --- a/test/new/links_reference_style.html +++ b/test/new/links_reference_style.html @@ -48,7 +48,7 @@

[bar]

However, it can directly follow other block elements, such as headings

-

Foo

+

Foo

bar

From 379c2c22bfa2007af1ce231d7ca476e9bd1a441b Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Mon, 15 Jan 2018 03:30:43 +0100 Subject: [PATCH 013/459] add tests for clean heading IDs --- test/new/headings-id.html | 13 +++++++++++++ test/new/headings-id.md | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 test/new/headings-id.html create mode 100644 test/new/headings-id.md diff --git a/test/new/headings-id.html b/test/new/headings-id.html new file mode 100644 index 00000000..6f0ae49e --- /dev/null +++ b/test/new/headings-id.html @@ -0,0 +1,13 @@ + + +

Heading with some italic text

+ +

Or some strong

+ +

(which doesn't really make any difference, here)

+ +

Or even code

+ +

What about strikethrough

+ + \ No newline at end of file diff --git a/test/new/headings-id.md b/test/new/headings-id.md new file mode 100644 index 00000000..fa8a4d82 --- /dev/null +++ b/test/new/headings-id.md @@ -0,0 +1,14 @@ +### Heading with a [link](http://github.com/) + +### Heading with some _italic text_ + +### Or some **strong** +(which doesn't really make any difference, here) + +### Or even `code` + +### What about ~~strikethrough~~ + +## And a ref [link][destination] + +[destination]: /some/url "link to nowhere" \ No newline at end of file From 958777e9fe442d93e033dab6188c78fa5b08f49c Mon Sep 17 00:00:00 2001 From: AndyTheGiant Date: Mon, 15 Jan 2018 18:16:54 +0100 Subject: [PATCH 014/459] remove unused flags --- lib/marked.js | 2 -- marked.min.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 8fc72b3a..336ab069 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1006,13 +1006,11 @@ Parser.prototype.tok = function() { , i , row , cell - , flags , j; // header cell = ''; for (i = 0; i < this.token.header.length; i++) { - flags = { header: true, align: this.token.align[i] }; cell += this.renderer.tablecell( this.inline.output(this.token.header[i]), { header: true, align: this.token.align[i] } diff --git a/marked.min.js b/marked.min.js index a97240a8..1883d019 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/chjj/marked */ -(function(){"use strict";function e(e){this.tokens=[],this.tokens.links={},this.options=e||p.defaults,this.rules=u.normal,this.options.gfm&&(this.options.tables?this.rules=u.tables:this.rules=u.gfm)}function t(e,t){if(this.options=t||p.defaults,this.links=e,this.rules=c.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=c.breaks:this.rules=c.gfm:this.options.pedantic&&(this.rules=c.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||p.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function o(e,t){return g[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?g[" "+e]=e+"/":g[" "+e]=e.replace(/[^\/]*$/,"")),e=g[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[\s\S]*/,"$1")+t:e+t}function h(){}function a(e){for(var t,n,r=1;rAn error occurred:

"+s(c.message+"",!0)+"
";throw c}}var u={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:h,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:h,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:h,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};u.bullet=/(?:[*+-]|\d+\.)/,u.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,u.item=l(u.item,"gm")(/bull/g,u.bullet)(),u.list=l(u.list)(/bull/g,u.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+u.def.source+")")(),u.blockquote=l(u.blockquote)("def",u.def)(),u._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",u.html=l(u.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,u._tag)(),u.paragraph=l(u.paragraph)("hr",u.hr)("heading",u.heading)("lheading",u.lheading)("blockquote",u.blockquote)("tag","<"+u._tag)("def",u.def)(),u.normal=a({},u),u.gfm=a({},u.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),u.gfm.paragraph=l(u.paragraph)("(?!","(?!"+u.gfm.fences.source.replace("\\1","\\2")+"|"+u.list.source.replace("\\1","\\3")+"|")(),u.tables=a({},u.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=u,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,p,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(h),p!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<([^ <>]+(@|:\/)[^ <>]+)>/,url:h,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:h,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,c.link=l(c.link)("inside",c._inside)("href",c._href)(),c.reflink=l(c.reflink)("inside",c._inside)(),c.normal=a({},c),c.pedantic=a({},c.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),c.gfm=a({},c.normal,{escape:l(c.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(c.text)("]|","~]|")("|","|https?://|")()}),c.breaks=a({},c.gfm,{br:l(c.br)("{2,}","*")(),text:l(c.gfm.text)("{2,}","*")()}),t.rules=c,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=s(":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1])),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
'+(n?e:s(e,!0))+"\n
\n":"
"+(n?e:s(e,!0))+"\n
"},n.prototype.blockquote=function(e){return"
\n"+e+"
\n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},n.prototype.paragraph=function(e){return"

    "+e+"

    \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!f.test(e)&&(e=o(this.options.baseUrl,e));var l='
    "},n.prototype.image=function(e,t,n){this.options.baseUrl&&!f.test(e)&&(e=o(this.options.baseUrl,e));var r=''+n+'":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s,i="",l="";for(n="",e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function o(e,t){return g[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?g[" "+e]=e+"/":g[" "+e]=e.replace(/[^\/]*$/,"")),e=g[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[\s\S]*/,"$1")+t:e+t}function h(){}function a(e){for(var t,n,r=1;rAn error occurred:

    "+s(c.message+"",!0)+"
    ";throw c}}var u={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:h,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:h,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:h,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};u.bullet=/(?:[*+-]|\d+\.)/,u.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,u.item=l(u.item,"gm")(/bull/g,u.bullet)(),u.list=l(u.list)(/bull/g,u.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+u.def.source+")")(),u.blockquote=l(u.blockquote)("def",u.def)(),u._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",u.html=l(u.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,u._tag)(),u.paragraph=l(u.paragraph)("hr",u.hr)("heading",u.heading)("lheading",u.lheading)("blockquote",u.blockquote)("tag","<"+u._tag)("def",u.def)(),u.normal=a({},u),u.gfm=a({},u.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),u.gfm.paragraph=l(u.paragraph)("(?!","(?!"+u.gfm.fences.source.replace("\\1","\\2")+"|"+u.list.source.replace("\\1","\\3")+"|")(),u.tables=a({},u.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=u,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,p,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(h),p!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<([^ <>]+(@|:\/)[^ <>]+)>/,url:h,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:h,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,c.link=l(c.link)("inside",c._inside)("href",c._href)(),c.reflink=l(c.reflink)("inside",c._inside)(),c.normal=a({},c),c.pedantic=a({},c.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),c.gfm=a({},c.normal,{escape:l(c.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(c.text)("]|","~]|")("|","|https?://|")()}),c.breaks=a({},c.gfm,{br:l(c.br)("{2,}","*")(),text:l(c.gfm.text)("{2,}","*")()}),t.rules=c,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=s(":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1])),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:s(e,!0))+"\n
    \n":"
    "+(n?e:s(e,!0))+"\n
    "},n.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},n.prototype.paragraph=function(e){return"

    "+e+"

    \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!f.test(e)&&(e=o(this.options.baseUrl,e));var l='
    "},n.prototype.image=function(e,t,n){this.options.baseUrl&&!f.test(e)&&(e=o(this.options.baseUrl,e));var r=''+n+'":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,s,i="",l="";for(n="",e=0;e Date: Mon, 8 Jan 2018 22:10:00 +0100 Subject: [PATCH 015/459] add commonmark tests for link definitions --- test/new/cm_link_defs.html | 109 ++++++++++++++++++++++++++ test/new/cm_link_defs.md | 153 +++++++++++++++++++++++++++++++++++++ 2 files changed, 262 insertions(+) create mode 100644 test/new/cm_link_defs.html create mode 100644 test/new/cm_link_defs.md diff --git a/test/new/cm_link_defs.html b/test/new/cm_link_defs.html new file mode 100644 index 00000000..6fd925ba --- /dev/null +++ b/test/new/cm_link_defs.html @@ -0,0 +1,109 @@ +

    Example 159

    + +

    foo159

    + +

    Example 160

    + +

    foo160

    + +

    Example 161

    + +

    Foo161*bar]

    + +

    Example 162

    + +

    Foo162 bar

    + +

    Example 163

    + +

    foo163

    + +

    Example 164

    + +

    [foo164]: /url 'title

    +

    with blank line'

    +

    [foo164]

    + +

    Example 165

    + +

    foo165

    + +

    Example 166

    + +

    [foo166]:

    +

    [foo166]

    + +

    Example 167

    + +

    foo167

    + +

    Example 168

    + +

    foo168

    + +

    Example 169

    + +

    foo169

    + +

    Example 170

    + +

    Foo170

    + +

    Example 171

    + +

    αγω

    + +

    Example 172

    + +

    Example 173

    + +

    bar

    + +

    Example 174

    + +

    [foo174]: /url "title" ok

    + +

    Example 175

    + +

    "title" ok

    + +

    Example 176

    + +
    [foo176]: /url "title"
    +
    +

    [foo176]

    + +

    Example 177

    + +
    [foo177]: /url
    +
    +

    [foo177]

    + +

    Example 178

    + +

    Foo +[bar178]: /baz

    +

    [bar178]

    + +

    Example 179

    + +

    Foo179

    +
    +

    bar

    +
    + +

    Example 180

    + +

    foo180, +bar180, +baz180

    + +

    Example 181

    + +

    foo181

    +
    +
    \ No newline at end of file diff --git a/test/new/cm_link_defs.md b/test/new/cm_link_defs.md new file mode 100644 index 00000000..6d355a84 --- /dev/null +++ b/test/new/cm_link_defs.md @@ -0,0 +1,153 @@ +### Example 159 + +[foo159]: /url "title" + +[foo159] + +### Example 160 + + [foo160]: + /url + 'the title' + +[foo160] + +### Example 161 + +[Foo161*bar\]]:my_(url) 'title (with parens)' + +[Foo161*bar\]] + +### Example 162 + +[Foo162 bar]: + +'title' + +[Foo162 bar] + +### Example 163 + +[foo163]: /url ' +title +line1 +line2 +' + +[foo163] + +### Example 164 + +[foo164]: /url 'title + +with blank line' + +[foo164] + +### Example 165 + +[foo165]: +/url + +[foo165] + +### Example 166 + +[foo166]: + +[foo166] + +### Example 167 + +[foo167]: /url\bar\*baz "foo\"bar\baz" + +[foo167] + +### Example 168 + +[foo168] + +[foo168]: url + +### Example 169 + +[foo169] + +[foo169]: first +[foo169]: second + +### Example 170 + +[FOO170]: /url + +[Foo170] + +### Example 171 + +[ΑΓΩ]: /φου + +[αγω] + +### Example 172 + +[foo172]: /url + +### Example 173 + +[ +foo173 +]: /url +bar + +### Example 174 + +[foo174]: /url "title" ok + +### Example 175 + +[foo175]: /url +"title" ok + +### Example 176 + + [foo176]: /url "title" + +[foo176] + +### Example 177 + +``` +[foo177]: /url +``` + +[foo177] + +### Example 178 + +Foo +[bar178]: /baz + +[bar178] + +### Example 179 + +# [Foo179] +[foo179]: /url +> bar + +### Example 180 + +[foo180]: /foo-url "foo" +[bar180]: /bar-url + "bar" +[baz180]: /baz-url + +[foo180], +[bar180], +[baz180] + +### Example 181 + +[foo181] + +> [foo181]: /url \ No newline at end of file From 38f1b01036e84e1afc79937790bf1b6960d4d43b Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 9 Jan 2018 00:27:54 +0100 Subject: [PATCH 016/459] allow escaped or balanced square brackets in shortcut reflinks --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 8fc72b3a..87929841 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -455,7 +455,7 @@ var inline = { tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/, link: /^!?\[(inside)\]\(href\)/, reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, - nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, + nolink: /^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/, strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, code: /^(`+)([\s\S]*?[^`])\1(?!`)/, From c3e005908ea567ea61215089512b07b4ae019db2 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 9 Jan 2018 00:44:43 +0100 Subject: [PATCH 017/459] new rule for link definitions: allow for special chars in label and title, multiline --- lib/marked.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 87929841..e83b2a29 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -22,12 +22,19 @@ var block = { blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, - def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, + def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop, paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, text: /^[^\n]+/ }; +block._label = /(?:\[[^\]]*\]|\\[\[\]]|[^\\\[\]])+/; +block._title = /(?:"(?:\\"|[^"])*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/; +block.def = replace(block.def) + ('label', block._label) + ('title', block._title) + (); + block.bullet = /(?:[*+-]|\d+\.)/; block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; block.item = replace(block.item, 'gm') @@ -371,6 +378,7 @@ Lexer.prototype.token = function(src, top, bq) { // def if ((!bq && top) && (cap = this.rules.def.exec(src))) { src = src.substring(cap[0].length); + if (cap[3]) cap[3] = cap[3].substring(1,cap[3].length-1); this.tokens.links[cap[1].toLowerCase()] = { href: cap[2], title: cap[3] From d7597f173265dc8bf2c3d0aa0f39b9f0fbf5103c Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 9 Jan 2018 00:47:34 +0100 Subject: [PATCH 018/459] allow link definitions in blockquotes too --- lib/marked.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index e83b2a29..7dfdd4ee 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -155,7 +155,7 @@ Lexer.prototype.lex = function(src) { * Lexing */ -Lexer.prototype.token = function(src, top, bq) { +Lexer.prototype.token = function(src, top) { var src = src.replace(/^ +$/gm, '') , next , loose @@ -278,7 +278,7 @@ Lexer.prototype.token = function(src, top, bq) { // Pass `top` to keep the current // "toplevel" state. This is exactly // how markdown.pl works. - this.token(cap, top, true); + this.token(cap, top); this.tokens.push({ type: 'blockquote_end' @@ -347,7 +347,7 @@ Lexer.prototype.token = function(src, top, bq) { }); // Recurse. - this.token(item, false, bq); + this.token(item, false); this.tokens.push({ type: 'list_item_end' @@ -376,7 +376,7 @@ Lexer.prototype.token = function(src, top, bq) { } // def - if ((!bq && top) && (cap = this.rules.def.exec(src))) { + if (top && (cap = this.rules.def.exec(src))) { src = src.substring(cap[0].length); if (cap[3]) cap[3] = cap[3].substring(1,cap[3].length-1); this.tokens.links[cap[1].toLowerCase()] = { From f2ebbd1601f3822dedc0d2ccb0bc73a63484f3c8 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 9 Jan 2018 00:50:17 +0100 Subject: [PATCH 019/459] first link definition takes precedence --- lib/marked.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 7dfdd4ee..01e7e00f 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -165,6 +165,7 @@ Lexer.prototype.token = function(src, top) { , item , space , i + , tag , l; while (src) { @@ -379,10 +380,13 @@ Lexer.prototype.token = function(src, top) { if (top && (cap = this.rules.def.exec(src))) { src = src.substring(cap[0].length); if (cap[3]) cap[3] = cap[3].substring(1,cap[3].length-1); - this.tokens.links[cap[1].toLowerCase()] = { - href: cap[2], - title: cap[3] - }; + tag = cap[1].toLowerCase(); + if (!this.tokens.links[tag]) { + this.tokens.links[tag] = { + href: cap[2], + title: cap[3] + }; + } continue; } From a5c4889cf016b1520586153bea1b3f92d7c6d913 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 9 Jan 2018 16:23:47 +0100 Subject: [PATCH 020/459] link def labels cannot contain balanced brackets --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 01e7e00f..c311ff8b 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -28,7 +28,7 @@ var block = { text: /^[^\n]+/ }; -block._label = /(?:\[[^\]]*\]|\\[\[\]]|[^\\\[\]])+/; +block._label = /(?:\\[\[\]]|[^\[\]])+/; block._title = /(?:"(?:\\"|[^"])*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/; block.def = replace(block.def) ('label', block._label) From 9400980e16785fdfc727f5a126efae32a093410f Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Wed, 10 Jan 2018 01:31:05 +0100 Subject: [PATCH 021/459] paragraph rule: link defs cannot interrupt a paragraph --- lib/marked.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index c311ff8b..8279692a 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -24,7 +24,7 @@ var block = { html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop, - paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, + paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag))+)\n*/, text: /^[^\n]+/ }; @@ -69,7 +69,6 @@ block.paragraph = replace(block.paragraph) ('lheading', block.lheading) ('blockquote', block.blockquote) ('tag', '<' + block._tag) - ('def', block.def) (); /** From c7798f412bf6fb390eaf3024381c2207aea2ff5a Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 9 Jan 2018 00:36:48 +0100 Subject: [PATCH 022/459] exclude test 167 in link_defs that does not pass. FIXME --- test/new/cm_link_defs.html | 8 +++++++- test/new/cm_link_defs.md | 8 ++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/test/new/cm_link_defs.html b/test/new/cm_link_defs.html index 6fd925ba..dec397a7 100644 --- a/test/new/cm_link_defs.html +++ b/test/new/cm_link_defs.html @@ -39,7 +39,13 @@ line2

    Example 167

    -

    foo167

    +
    [foo167]: /url\bar\*baz "foo\"bar\baz"
    +
    +[foo167]
    +
    +should render to
    +
    +<p><a href="/url%5Cbar*baz" title="foo&quot;bar\baz">foo167</a></p>

    Example 168

    diff --git a/test/new/cm_link_defs.md b/test/new/cm_link_defs.md index 6d355a84..74684f21 100644 --- a/test/new/cm_link_defs.md +++ b/test/new/cm_link_defs.md @@ -59,9 +59,13 @@ with blank line' ### Example 167 -[foo167]: /url\bar\*baz "foo\"bar\baz" + [foo167]: /url\bar\*baz "foo\"bar\baz" -[foo167] + [foo167] + + should render to + +

    foo167

    ### Example 168 From 911780dcca8ebc91526d9a34b3220551662e8a9e Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Wed, 10 Jan 2018 01:22:20 +0100 Subject: [PATCH 023/459] fix def_blocks test: link reference definition cannot interrupt a paragraph + blockquote laziness rule, according to commonmark spec (see review of #974. Partial replay of 98ac7a4) --- test/new/def_blocks.html | 4 +++- test/new/def_blocks.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/new/def_blocks.html b/test/new/def_blocks.html index 14edc97a..5d8de49c 100644 --- a/test/new/def_blocks.html +++ b/test/new/def_blocks.html @@ -6,7 +6,8 @@
    -

    hello

    +

    hello +[2]: hello

    @@ -24,5 +25,6 @@

    foo bar +[5]: foo bar

    diff --git a/test/new/def_blocks.md b/test/new/def_blocks.md index 4d162929..f58fa4d3 100644 --- a/test/new/def_blocks.md +++ b/test/new/def_blocks.md @@ -17,5 +17,5 @@ > foo > bar -[1]: foo +[5]: foo > bar From aece9b27329b728ea81ec96b4e7d1a227c6b0ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D1=81=D1=82=D1=8F=20=D0=A2=D1=80=D0=B5=D1=82?= =?UTF-8?q?=D1=8F=D0=BA?= Date: Mon, 18 Dec 2017 23:44:19 +0200 Subject: [PATCH 024/459] Overwritten the test for a more precise wording. --- test/new/toplevel_paragraphs.html | 30 +++++++++++++++--------------- test/new/toplevel_paragraphs.md | 30 +++++++++++++++--------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/test/new/toplevel_paragraphs.html b/test/new/toplevel_paragraphs.html index 970c6f19..d15bfcce 100644 --- a/test/new/toplevel_paragraphs.html +++ b/test/new/toplevel_paragraphs.html @@ -1,30 +1,30 @@

    hello world - how are you - how are you

    + text after spaces + text after spaces

    -

    hello world

    -
    how are you
    +

    paragraph before code

    +
    text inside block code
    -

    hello world

    +

    paragraph before hr


    -

    hello world

    +

    paragraph before head with hash

    how are you

    -

    hello world

    +

    paragraph before head with equals

    how are you

    -

    hello world

    -

    how are you

    +

    paragraph before blockquote

    +

    text for blockquote

    -

    hello world

    -
    • how are you
    +

    paragraph before list

    +
    • text inside list
    -

    hello world

    -
    how are you
    +

    paragraph before div

    +
    text inside div
    -

    hello world -how are you

    +

    paragraph with span +text inside span

    hello world

    diff --git a/test/new/toplevel_paragraphs.md b/test/new/toplevel_paragraphs.md index 2c17c669..de29be75 100644 --- a/test/new/toplevel_paragraphs.md +++ b/test/new/toplevel_paragraphs.md @@ -2,35 +2,35 @@ gfm: true --- hello world - how are you - how are you + text after spaces + text after spaces -hello world +paragraph before code ``` -how are you +text inside block code ``` -hello world +paragraph before hr * * * -hello world +paragraph before head with hash # how are you -hello world +paragraph before head with equals how are you =========== -hello world -> how are you +paragraph before blockquote +> text for blockquote -hello world -* how are you +paragraph before list +* text inside list -hello world -
    how are you
    +paragraph before div +
    text inside div
    -hello world -how are you +paragraph with span +text inside span hello [world][how] From 1a71ae06bf5bc10391c66fd47426039a4c6616d0 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Wed, 10 Jan 2018 01:40:46 +0100 Subject: [PATCH 025/459] new blockquote rule: match any paragraph-like content up to next line (laziness rule), or anything on the current line. Change paragraph rule accordingly, and make it non-greedy --- lib/marked.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 8279692a..caf62932 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -19,12 +19,12 @@ var block = { heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, nptable: noop, lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, + blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop, - paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag))+)\n*/, + paragraph: /^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/, text: /^[^\n]+/ }; @@ -47,10 +47,6 @@ block.list = replace(block.list) ('def', '\\n+(?=' + block.def.source + ')') (); -block.blockquote = replace(block.blockquote) - ('def', block.def) - (); - block._tag = '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' @@ -67,10 +63,13 @@ block.paragraph = replace(block.paragraph) ('hr', block.hr) ('heading', block.heading) ('lheading', block.lheading) - ('blockquote', block.blockquote) ('tag', '<' + block._tag) (); +block.blockquote = replace(block.blockquote) + ('paragraph', block.paragraph) + (); + /** * Normal Block Grammar */ From f45dc385d9ba90fb8fd141f2fb0fee9db520d2d5 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Wed, 10 Jan 2018 01:52:33 +0100 Subject: [PATCH 026/459] match setext headings just before paragraphs, then only paragraph continuations are matched inside blockquotes (see http://spec.commonmark.org/0.28/#example-197) --- lib/marked.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index caf62932..cbdd0ecd 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -18,12 +18,12 @@ var block = { hr: /^( *[-*_]){3,} *(?:\n+|$)/, heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, nptable: noop, - lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop, + lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, paragraph: /^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/, text: /^[^\n]+/ }; @@ -244,17 +244,6 @@ Lexer.prototype.token = function(src, top) { continue; } - // lheading - if (cap = this.rules.lheading.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'heading', - depth: cap[2] === '=' ? 1 : 2, - text: cap[1] - }); - continue; - } - // hr if (cap = this.rules.hr.exec(src)) { src = src.substring(cap[0].length); @@ -422,6 +411,17 @@ Lexer.prototype.token = function(src, top) { continue; } + // lheading + if (cap = this.rules.lheading.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'heading', + depth: cap[2] === '=' ? 1 : 2, + text: cap[1] + }); + continue; + } + // top-level paragraph if (top && (cap = this.rules.paragraph.exec(src))) { src = src.substring(cap[0].length); From 399cf8235f2aee1c5ae432de859cc36aab8e30db Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Wed, 10 Jan 2018 02:21:43 +0100 Subject: [PATCH 027/459] add commonmark tests for blockquotes. Example 198 and 200 are disabled since they do not pass, FIXME --- test/new/cm_blockquotes.html | 239 +++++++++++++++++++++++++++++++++++ test/new/cm_blockquotes.md | 189 +++++++++++++++++++++++++++ 2 files changed, 428 insertions(+) create mode 100644 test/new/cm_blockquotes.html create mode 100644 test/new/cm_blockquotes.md diff --git a/test/new/cm_blockquotes.html b/test/new/cm_blockquotes.html new file mode 100644 index 00000000..363f4e21 --- /dev/null +++ b/test/new/cm_blockquotes.html @@ -0,0 +1,239 @@ +

    Example 191

    + +
    +

    Foo

    +

    bar +baz

    +
    + +

    Example 192

    + +

    The spaces after the > characters can be omitted:

    + +
    +

    Foo

    +

    bar +baz

    +
    + +

    Example 193

    + +

    The > characters can be indented 1-3 spaces:

    + +
    +

    Foo

    +

    bar +baz

    +
    + +

    Example 194

    + +

    Four spaces gives us a code block:

    + +
    > # Foo
    +> bar
    +> baz
    +
    + +

    Example 195

    + +

    The Laziness clause allows us to omit the > before paragraph continuation text:

    + +
    +

    Foo

    +

    bar +baz

    +
    + +

    Example 196

    + +

    A block quote can contain some lazy and some non-lazy continuation lines:

    + +
    +

    bar +baz +foo

    +
    + +

    Example 197

    + +

    Laziness only applies to lines that would have been continuations of paragraphs had they been prepended with block quote markers. For example, the > cannot be omitted in the second line of

    + +
    +

    foo

    +
    +
    + +

    without changing the meaning.

    + +

    Example 198

    + +
    Similarly, if we omit the `>` in the second line then the block quote ends after the first line:
    +
    +> - foo
    +- bar
    + +

    Example 199

    + +

    For the same reason, we can’t omit the > in front of subsequent lines of an indented or fenced code block:

    + +
    +
    foo
    +
    +
    +
    bar
    +
    + +

    Example 200

    + +
    > ```
    +foo
    +```
    +
    +<blockquote>
    +<pre><code></code></pre>
    +</blockquote>
    +<p>foo</p>
    +<pre><code></code></pre>
    +
    + +

    Example 201

    +
    > foo
    +    - bar
    +
    +<blockquote>
    +<p>foo
    +- bar</p>
    +</blockquote>
    +
    + +

    Example 202

    + +

    A block quote can be empty:

    + +
    +
    + +

    Example 203

    + +
    +
    + +

    Example 204

    + +

    A block quote can have initial or final blank lines:

    + +
    +

    foo

    +
    + + +

    Example 205

    + +

    A blank line always separates block quotes:

    + +
    +

    foo

    +
    +
    +

    bar

    +
    + +

    Example 206

    + +

    Consecutiveness means that if we put these block quotes together, we get a single block quote:

    + +
    +

    foo +bar

    +
    + +

    Example 207

    + +

    To get a block quote with two paragraphs, use:

    + +
    +

    foo

    +

    bar

    +
    + +

    Example 208

    + +

    Block quotes can interrupt paragraphs:

    + +

    foo

    +
    +

    bar

    +
    + +

    Example 209

    + +

    In general, blank lines are not needed before or after block quotes:

    + +
    +

    aaa

    +
    +
    +
    +

    bbb

    +
    + +

    Example 210

    + +

    However, because of laziness, a blank line is needed between a block quote and a following paragraph:

    + +
    +

    bar +baz

    +
    + +

    Example 211

    + +
    +

    bar

    +
    +

    baz

    + +

    Example 212

    + +
    +

    bar

    +
    +

    baz

    + +

    Example 213

    + +

    It is a consequence of the Laziness rule that any number of initial >s may be omitted on a continuation line of a nested block quote:

    + +
    +
    +
    +

    foo +bar

    +
    +
    +
    + +

    Example 214

    + +
    +
    +
    +

    foo +bar +baz

    +
    +
    +
    + +

    Example 215

    + +

    When including an indented code block in a block quote, remember that the block quote marker includes both the > and a following space. So five spaces are needed after the >:

    + +
    +
    code
    +
    +
    +
    +

    not code

    +
    diff --git a/test/new/cm_blockquotes.md b/test/new/cm_blockquotes.md new file mode 100644 index 00000000..95a317de --- /dev/null +++ b/test/new/cm_blockquotes.md @@ -0,0 +1,189 @@ +### Example 191 + +> # Foo +> bar +> baz + +### Example 192 + +The spaces after the `>` characters can be omitted: + +># Foo +>bar +> baz + +### Example 193 + +The `>` characters can be indented 1-3 spaces: + + > # Foo + > bar + > baz + +### Example 194 + +Four spaces gives us a code block: + + > # Foo + > bar + > baz + +### Example 195 + +The Laziness clause allows us to omit the `>` before paragraph continuation text: + +> # Foo +> bar +baz + +### Example 196 + +A block quote can contain some lazy and some non-lazy continuation lines: + +> bar +baz +> foo + +### Example 197 + +Laziness only applies to lines that would have been continuations of paragraphs had they been prepended with block quote markers. For example, the `>` cannot be omitted in the second line of + +> foo +--- + +without changing the meaning. + +### Example 198 + + Similarly, if we omit the `>` in the second line then the block quote ends after the first line: + + > - foo + - bar + +### Example 199 + +For the same reason, we can’t omit the `>` in front of subsequent lines of an indented or fenced code block: + +> foo + + bar + +### Example 200 + + > ``` + foo + ``` + +
    +
    +
    +

    foo

    +
    + +### Example 201 + + > foo + - bar + +
    +

    foo + - bar

    +
    + +### Example 202 + +A block quote can be empty: + +> + +### Example 203 + +> +> +> + +### Example 204 + +A block quote can have initial or final blank lines: + +> +> foo +> + +### Example 205 + +A blank line always separates block quotes: + +> foo + +> bar + +### Example 206 + +Consecutiveness means that if we put these block quotes together, we get a single block quote: + +> foo +> bar + +### Example 207 + +To get a block quote with two paragraphs, use: + +> foo +> +> bar + +### Example 208 + +Block quotes can interrupt paragraphs: + +foo +> bar + +### Example 209 + +In general, blank lines are not needed before or after block quotes: + +> aaa +*** +> bbb + +### Example 210 + +However, because of laziness, a blank line is needed between a block quote and a following paragraph: + +> bar +baz + +### Example 211 + +> bar + +baz + +### Example 212 + +> bar +> +baz + +### Example 213 + +It is a consequence of the Laziness rule that any number of initial `>`s may be omitted on a continuation line of a nested block quote: + +> > > foo +bar + +### Example 214 + +>>> foo +> bar +>>baz + +### Example 215 + +When including an indented code block in a block quote, remember that the block quote marker includes both the `>` and a following space. So five spaces are needed after the `>`: + +> code + +> not code From 2fa274284ea7e237608b947f3be03918eb31b5f1 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 20 Jan 2018 02:57:26 +0100 Subject: [PATCH 028/459] [lint] use eslint + standard rules to lint marked.js --- .eslintrc.json | 9 +++++++++ package.json | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..d3620792 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,9 @@ +{ + "extends": "standard", + "plugins": [ + "standard" + ], + "rules": { + "semi": "off" + } +} diff --git a/package.json b/package.json index 073a5ac8..66a90896 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,10 @@ "markdown": "*", "showdown": "*", "markdown-it": "*", + "eslint": "^4.15.0", + "eslint-config-standard": "^11.0.0-beta.0", + "eslint-plugin-node": "^5.2.1", + "eslint-plugin-standard": "^3.0.1", "front-matter": "^2.3.0", "glob-to-regexp": "0.3.0", "gulp": "^3.8.11", @@ -34,6 +38,7 @@ }, "scripts": { "test": "node test", - "bench": "node test --bench" + "bench": "node test --bench", + "lint": "node_modules/.bin/eslint lib/marked.js" } } From 15bcca64615323f6033629faec7b81ac52f0a6f9 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 20 Jan 2018 03:01:30 +0100 Subject: [PATCH 029/459] [lint] edit eslint rules to fit marked.js current code style --- .eslintrc.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index d3620792..22caa8ec 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,6 +4,12 @@ "standard" ], "rules": { - "semi": "off" + "semi": "off", + "space-before-function-paren": "off", + "operator-linebreak": ["error", "before", { "overrides": { "=": "after" } }], + "no-cond-assign": "off", + "no-useless-escape": "off", + "no-return-assign": "off", + "one-var": "off" } } From b2edbd646410a37d05333b683d67cf5f0ae6594c Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 20 Jan 2018 03:05:29 +0100 Subject: [PATCH 030/459] [lint] refactor replace() with an OOP approach. ESlint is happier. --- lib/marked.js | 102 ++++++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 49 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 8fc72b3a..173fba89 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -30,40 +30,40 @@ var block = { block.bullet = /(?:[*+-]|\d+\.)/; block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; -block.item = replace(block.item, 'gm') - (/bull/g, block.bullet) - (); +block.item = edit(block.item, 'gm') + .replace(/bull/g, block.bullet) + .getRegex(); -block.list = replace(block.list) - (/bull/g, block.bullet) - ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') - ('def', '\\n+(?=' + block.def.source + ')') - (); +block.list = edit(block.list) + .replace(/bull/g, block.bullet) + .replace('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') + .replace('def', '\\n+(?=' + block.def.source + ')') + .getRegex(); -block.blockquote = replace(block.blockquote) - ('def', block.def) - (); +block.blockquote = edit(block.blockquote) + .replace('def', block.def) + .getRegex(); block._tag = '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; -block.html = replace(block.html) - ('comment', //) - ('closed', /<(tag)[\s\S]+?<\/\1>/) - ('closing', /])*?>/) - (/tag/g, block._tag) - (); +block.html = edit(block.html) + .replace('comment', //) + .replace('closed', /<(tag)[\s\S]+?<\/\1>/) + .replace('closing', /])*?>/) + .replace(/tag/g, block._tag) + .getRegex(); -block.paragraph = replace(block.paragraph) - ('hr', block.hr) - ('heading', block.heading) - ('lheading', block.lheading) - ('blockquote', block.blockquote) - ('tag', '<' + block._tag) - ('def', block.def) - (); +block.paragraph = edit(block.paragraph) + .replace('hr', block.hr) + .replace('heading', block.heading) + .replace('lheading', block.lheading) + .replace('blockquote', block.blockquote) + .replace('tag', '<' + block._tag) + .replace('def', block.def) + .getRegex(); /** * Normal Block Grammar @@ -81,11 +81,11 @@ block.gfm = merge({}, block.normal, { heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ }); -block.gfm.paragraph = replace(block.paragraph) - ('(?!', '(?!' +block.gfm.paragraph = edit(block.paragraph) + .replace('(?!', '(?!' + block.gfm.fences.source.replace('\\1', '\\2') + '|' + block.list.source.replace('\\1', '\\3') + '|') - (); + .getRegex(); /** * GFM + Tables Block Grammar @@ -467,14 +467,14 @@ var inline = { inline._inside = /(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/; inline._href = /\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/; -inline.link = replace(inline.link) - ('inside', inline._inside) - ('href', inline._href) - (); +inline.link = edit(inline.link) + .replace('inside', inline._inside) + .replace('href', inline._href) + .getRegex(); -inline.reflink = replace(inline.reflink) - ('inside', inline._inside) - (); +inline.reflink = edit(inline.reflink) + .replace('inside', inline._inside) + .getRegex(); /** * Normal Inline Grammar @@ -496,13 +496,13 @@ inline.pedantic = merge({}, inline.normal, { */ inline.gfm = merge({}, inline.normal, { - escape: replace(inline.escape)('])', '~|])')(), + escape: edit(inline.escape).replace('])', '~|])').getRegex(), url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, del: /^~~(?=\S)([\s\S]*?\S)~~/, - text: replace(inline.text) - (']|', '~]|') - ('|', '|https?://|') - () + text: edit(inline.text) + .replace(']|', '~]|') + .replace('|', '|https?://|') + .getRegex() }); /** @@ -510,8 +510,8 @@ inline.gfm = merge({}, inline.normal, { */ inline.breaks = merge({}, inline.gfm, { - br: replace(inline.br)('{2,}', '*')(), - text: replace(inline.gfm.text)('{2,}', '*')() + br: edit(inline.br).replace('{2,}', '*').getRegex(), + text: edit(inline.gfm.text).replace('{2,}', '*').getRegex() }); /** @@ -1116,15 +1116,19 @@ function unescape(html) { }); } -function replace(regex, opt) { +function edit(regex, opt) { regex = regex.source; opt = opt || ''; - return function self(name, val) { - if (!name) return new RegExp(regex, opt); - val = val.source || val; - val = val.replace(/(^|[^\[])\^/g, '$1'); - regex = regex.replace(name, val); - return self; + return { + replace: function(name, val) { + val = val.source || val; + val = val.replace(/(^|[^\[])\^/g, '$1'); + regex = regex.replace(name, val); + return this; + }, + getRegex: function() { + return new RegExp(regex, opt); + } }; } From 7e1836f5472c01d851ea792dd3751a9950d3b186 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 20 Jan 2018 03:06:45 +0100 Subject: [PATCH 031/459] [lint] add parens to empty constructor calls --- lib/marked.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 173fba89..537b7528 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -522,7 +522,7 @@ function InlineLexer(links, options) { this.options = options || marked.defaults; this.links = links; this.rules = inline.normal; - this.renderer = this.options.renderer || new Renderer; + this.renderer = this.options.renderer || new Renderer(); this.renderer.options = this.options; if (!this.links) { @@ -917,7 +917,7 @@ function Parser(options) { this.tokens = []; this.token = null; this.options = options || marked.defaults; - this.options.renderer = this.options.renderer || new Renderer; + this.options.renderer = this.options.renderer || new Renderer(); this.renderer = this.options.renderer; this.renderer.options = this.options; } @@ -1289,7 +1289,7 @@ marked.defaults = { langPrefix: 'lang-', smartypants: false, headerPrefix: '', - renderer: new Renderer, + renderer: new Renderer(), xhtml: false, baseUrl: null }; From 6f8922e29656597fc11e4db5534b05697742c8ff Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 20 Jan 2018 03:10:46 +0100 Subject: [PATCH 032/459] [lint] add eslint indent rule --- .eslintrc.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.eslintrc.json b/.eslintrc.json index 22caa8ec..9d6f8d52 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,6 +5,11 @@ ], "rules": { "semi": "off", + "indent": ["warn", 2, { + "VariableDeclarator": { "var": 2 }, + "SwitchCase": 1, + "outerIIFEBody": 0 + }], "space-before-function-paren": "off", "operator-linebreak": ["error", "before", { "overrides": { "=": "after" } }], "no-cond-assign": "off", From 1a19028b66cb3e2ae4be48c8a3dd1d6d774780a9 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 20 Jan 2018 03:07:59 +0100 Subject: [PATCH 033/459] [lint] fix whitespace --- lib/marked.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 537b7528..6a025d30 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -436,8 +436,7 @@ Lexer.prototype.token = function(src, top, bq) { } if (src) { - throw new - Error('Infinite loop on byte: ' + src.charCodeAt(0)); + throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); } } @@ -526,8 +525,7 @@ function InlineLexer(links, options) { this.renderer.options = this.options; if (!this.links) { - throw new - Error('Tokens array requires a `links` property.'); + throw new Error('Tokens array requires a `links` property.'); } if (this.options.gfm) { @@ -581,8 +579,8 @@ InlineLexer.prototype.output = function(src) { if (cap[2] === '@') { text = escape( cap[1].charAt(6) === ':' - ? this.mangle(cap[1].substring(7)) - : this.mangle(cap[1]) + ? this.mangle(cap[1].substring(7)) + : this.mangle(cap[1]) ); href = this.mangle('mailto:') + text; } else { @@ -690,8 +688,7 @@ InlineLexer.prototype.output = function(src) { } if (src) { - throw new - Error('Infinite loop on byte: ' + src.charCodeAt(0)); + throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); } } @@ -1103,7 +1100,7 @@ function escape(html, encode) { } function unescape(html) { - // explicitly match decimal, hex, and named HTML entities + // explicitly match decimal, hex, and named HTML entities return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, function(_, n) { n = n.toLowerCase(); if (n === 'colon') return ':'; @@ -1176,7 +1173,6 @@ function merge(obj) { return obj; } - /** * Marked */ From d9c471e2658c15d5285eaedd15472c3470aad2e8 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 20 Jan 2018 03:08:44 +0100 Subject: [PATCH 034/459] [lint] fix var declarations --- lib/marked.js | 74 +++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 6a025d30..ec37bcf8 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -149,16 +149,16 @@ Lexer.prototype.lex = function(src) { */ Lexer.prototype.token = function(src, top, bq) { - var src = src.replace(/^ +$/gm, '') - , next - , loose - , cap - , bull - , b - , item - , space - , i - , l; + var src = src.replace(/^ +$/gm, ''), + next, + loose, + cap, + bull, + b, + item, + space, + i, + l; while (src) { // newline @@ -559,11 +559,11 @@ InlineLexer.output = function(src, links, options) { */ InlineLexer.prototype.output = function(src) { - var out = '' - , link - , text - , href - , cap; + var out = '', + link, + text, + href, + cap; while (src) { // escape @@ -700,8 +700,8 @@ InlineLexer.prototype.output = function(src) { */ InlineLexer.prototype.outputLink = function(cap, link) { - var href = escape(link.href) - , title = link.title ? escape(link.title) : null; + var href = escape(link.href), + title = link.title ? escape(link.title) : null; return cap[0].charAt(0) !== '!' ? this.renderer.link(href, title, this.output(cap[1])) @@ -737,10 +737,10 @@ InlineLexer.prototype.smartypants = function(text) { InlineLexer.prototype.mangle = function(text) { if (!this.options.mangle) return text; - var out = '' - , l = text.length - , i = 0 - , ch; + var out = '', + l = text.length, + i = 0, + ch; for (; i < l; i++) { ch = text.charCodeAt(i); @@ -998,13 +998,13 @@ Parser.prototype.tok = function() { this.token.escaped); } case 'table': { - var header = '' - , body = '' - , i - , row - , cell - , flags - , j; + var header = '', + body = '', + i, + row, + cell, + flags, + j; // header cell = ''; @@ -1042,8 +1042,8 @@ Parser.prototype.tok = function() { return this.renderer.blockquote(body); } case 'list_start': { - var body = '' - , ordered = this.token.ordered; + var body = '', + ordered = this.token.ordered; while (this.next().type !== 'list_end') { body += this.tok(); @@ -1157,9 +1157,9 @@ function noop() {} noop.exec = noop; function merge(obj) { - var i = 1 - , target - , key; + var i = 1, + target, + key; for (; i < arguments.length; i++) { target = arguments[i]; @@ -1186,10 +1186,10 @@ function marked(src, opt, callback) { opt = merge({}, marked.defaults, opt || {}); - var highlight = opt.highlight - , tokens - , pending - , i = 0; + var highlight = opt.highlight, + tokens, + pending, + i = 0; try { tokens = Lexer.lex(src, opt) From 565b4a0e5bb0cd6ea0e251676ffd249b5388ccf7 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 20 Jan 2018 03:10:00 +0100 Subject: [PATCH 035/459] [lint] make the outer function a recognizable IIFE --- lib/marked.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index ec37bcf8..6838fe03 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1312,9 +1312,7 @@ if (typeof module !== 'undefined' && typeof exports === 'object') { } else if (typeof define === 'function' && define.amd) { define(function() { return marked; }); } else { - this.marked = marked; + var exp = this || (typeof window !== 'undefined' ? window : global); + exp.marked = marked; } - -}).call(function() { - return this || (typeof window !== 'undefined' ? window : global); -}()); +})(); From 3bbcc885ddbdbd690febe35c0a81772c61e1b3d5 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 20 Jan 2018 03:21:46 +0100 Subject: [PATCH 036/459] [lint] fix already declared/unused variables --- lib/marked.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 6838fe03..0bf8fb26 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -149,8 +149,8 @@ Lexer.prototype.lex = function(src) { */ Lexer.prototype.token = function(src, top, bq) { - var src = src.replace(/^ +$/gm, ''), - next, + src = src.replace(/^ +$/gm, ''); + var next, loose, cap, bull, @@ -1003,13 +1003,11 @@ Parser.prototype.tok = function() { i, row, cell, - flags, j; // header cell = ''; for (i = 0; i < this.token.header.length; i++) { - flags = { header: true, align: this.token.align[i] }; cell += this.renderer.tablecell( this.inline.output(this.token.header[i]), { header: true, align: this.token.align[i] } @@ -1033,7 +1031,7 @@ Parser.prototype.tok = function() { return this.renderer.table(header, body); } case 'blockquote_start': { - var body = ''; + body = ''; while (this.next().type !== 'blockquote_end') { body += this.tok(); @@ -1042,8 +1040,8 @@ Parser.prototype.tok = function() { return this.renderer.blockquote(body); } case 'list_start': { - var body = '', - ordered = this.token.ordered; + body = ''; + var ordered = this.token.ordered; while (this.next().type !== 'list_end') { body += this.tok(); @@ -1052,7 +1050,7 @@ Parser.prototype.tok = function() { return this.renderer.list(body, ordered); } case 'list_item_start': { - var body = ''; + body = ''; while (this.next().type !== 'list_item_end') { body += this.token.type === 'text' @@ -1063,7 +1061,7 @@ Parser.prototype.tok = function() { return this.renderer.listitem(body); } case 'loose_item_start': { - var body = ''; + body = ''; while (this.next().type !== 'list_item_end') { body += this.tok(); From d79bbb68a09ad2bac9564ef57986a445e95ff7c6 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 20 Jan 2018 03:22:23 +0100 Subject: [PATCH 037/459] [lint] add amd environment to eslint to declare `define` global --- .eslintrc.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.eslintrc.json b/.eslintrc.json index 9d6f8d52..c1b87240 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -16,5 +16,10 @@ "no-useless-escape": "off", "no-return-assign": "off", "one-var": "off" + }, + "env": { + "node": true, + "browser": true, + "amd": true } } From e5527fbbf4f7d53c711140b316266c6c91a089b8 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 20 Jan 2018 03:23:50 +0100 Subject: [PATCH 038/459] [lint] auto-fix code style with `npm run lint` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 66a90896..ebeea81c 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,6 @@ "scripts": { "test": "node test", "bench": "node test --bench", - "lint": "node_modules/.bin/eslint lib/marked.js" + "lint": "node_modules/.bin/eslint --fix lib/marked.js" } } From d381127ca286ccd79652a916221444365c9fd055 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Mon, 22 Jan 2018 15:47:57 +0100 Subject: [PATCH 039/459] fix test case introduced in 4bbba32 --- test/new/cm_link_defs.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/new/cm_link_defs.html b/test/new/cm_link_defs.html index dec397a7..92450024 100644 --- a/test/new/cm_link_defs.html +++ b/test/new/cm_link_defs.html @@ -97,7 +97,7 @@ should render to

    Example 179

    -

    Foo179

    +

    Foo179

    bar

    From 6d974b1dbfabc0474dbe1adfd4c35435208eab35 Mon Sep 17 00:00:00 2001 From: Cory Forsyth Date: Fri, 7 Aug 2015 15:03:18 -0400 Subject: [PATCH 040/459] Do not autolink a trailing "!" in a URL * Expand gfm link tests to include all possible ending punctuation --- lib/marked.js | 2 +- test/new/gfm_links.html | 12 ++++++++++-- test/new/gfm_links.md | 10 +++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index f1d66ed4..4ded4855 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -507,7 +507,7 @@ inline.pedantic = merge({}, inline.normal, { inline.gfm = merge({}, inline.normal, { escape: replace(inline.escape)('])', '~|])')(), - url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, + url: /^(https?:\/\/[^\s<]+[^<.,:;"'!)\]\s])/, del: /^~~(?=\S)([\s\S]*?\S)~~/, text: replace(inline.text) (']|', '~]|') diff --git a/test/new/gfm_links.html b/test/new/gfm_links.html index 4f62ae1d..26f576d6 100644 --- a/test/new/gfm_links.html +++ b/test/new/gfm_links.html @@ -1,2 +1,10 @@ -

    This should be a link: -http://example.com/hello-world.

    +

    link with . http://example.com/hello-world. +link with ! http://example.com/hello-world! +link with : http://example.com/hello-world: +link with , http://example.com/hello-world, +link with ; http://example.com/hello-world; +link with ' http://example.com/hello-world' +link with " http://example.com/hello-world" +link with ) http://example.com/hello-world) +link with nothing http://example.com/hello-world +

    diff --git a/test/new/gfm_links.md b/test/new/gfm_links.md index c1336661..e37645db 100644 --- a/test/new/gfm_links.md +++ b/test/new/gfm_links.md @@ -1 +1,9 @@ -This should be a link: http://example.com/hello-world. +link with . http://example.com/hello-world. +link with ! http://example.com/hello-world! +link with : http://example.com/hello-world: +link with , http://example.com/hello-world, +link with ; http://example.com/hello-world; +link with ' http://example.com/hello-world' +link with " http://example.com/hello-world" +link with ) http://example.com/hello-world) +link with nothing http://example.com/hello-world From dc85deedb74ffab7abac8491fe538845768455d4 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Mon, 22 Jan 2018 18:59:17 +0100 Subject: [PATCH 041/459] add commonmark tests for autolinks --- test/new/cm_autolinks.html | 91 ++++++++++++++++++++++++++++++++++++ test/new/cm_autolinks.md | 96 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 test/new/cm_autolinks.html create mode 100644 test/new/cm_autolinks.md diff --git a/test/new/cm_autolinks.html b/test/new/cm_autolinks.html new file mode 100644 index 00000000..e7ae0ee4 --- /dev/null +++ b/test/new/cm_autolinks.html @@ -0,0 +1,91 @@ +

    Here are some valid autolinks:

    + +

    Example 565

    + +

    http://foo.bar.baz

    + +

    Example 566

    + +

    http://foo.bar.baz/test?q=hello&id=22&boolean

    + +

    Example 567

    + +

    irc://foo.bar:2233/baz

    + +

    Example 568

    + +

    Uppercase is also fine:

    + +

    MAILTO:FOO@BAR.BAZ

    + +

    Note that many strings that count as absolute URIs for purposes of this spec are not valid URIs, because their schemes are not registered or because of other problems with their syntax:

    + +

    Example 569

    + +

    a+b+c:d

    + +

    Example 570

    + +

    made-up-scheme://foo,bar

    + +

    Example 571

    + +

    http://../

    + +

    Example 572

    + +

    localhost:5001/foo

    + +

    Example 573

    + +

    Spaces are not allowed in autolinks:

    + +

    <http://foo.bar/baz bim>

    + +

    Example 574

    + +

    Backslash-escapes do not work inside autolinks:

    + +

    http://example.com/\[\

    + +

    Examples of email autolinks:

    + +

    Example 575

    + +

    foo@bar.example.com

    + +

    Example 576

    + +

    foo+special@Bar.baz-bar0.com

    + +

    Example 577

    + +

    Backslash-escapes do not work inside email autolinks:

    + +

    <foo+@bar.example.com>

    + +

    These are not autolinks:

    + +

    Example 578

    + +

    <>

    + +

    Example 579

    + +

    < http://foo.bar >

    + +

    Example 580

    + +

    <m:abc>

    + +

    Example 581

    + +

    <foo.bar.baz>

    + +

    Example 582

    + +

    http://example.com

    + +

    Example 583

    + +

    foo@bar.example.com

    \ No newline at end of file diff --git a/test/new/cm_autolinks.md b/test/new/cm_autolinks.md new file mode 100644 index 00000000..a19d830c --- /dev/null +++ b/test/new/cm_autolinks.md @@ -0,0 +1,96 @@ +--- +gfm: false +mangle: false +--- + +Here are some valid autolinks: + +### Example 565 + + + +### Example 566 + + + +### Example 567 + + + +### Example 568 + +Uppercase is also fine: + + + +Note that many strings that count as absolute URIs for purposes of this spec are not valid URIs, because their schemes are not registered or because of other problems with their syntax: + +### Example 569 + + + +### Example 570 + + + +### Example 571 + + + +### Example 572 + + + +### Example 573 + +Spaces are not allowed in autolinks: + + + +### Example 574 + +Backslash-escapes do not work inside autolinks: + + + +Examples of email autolinks: + +### Example 575 + + + +### Example 576 + + + +### Example 577 + +Backslash-escapes do not work inside email autolinks: + + + +These are not autolinks: + +### Example 578 + +<> + +### Example 579 + +< http://foo.bar > + +### Example 580 + + + +### Example 581 + + + +### Example 582 + +http://example.com + +### Example 583 + +foo@bar.example.com \ No newline at end of file From a8f2d7ff6ed391dc101eae7283c748987f6a0c28 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Mon, 22 Jan 2018 19:01:16 +0100 Subject: [PATCH 042/459] new rule for autolinks, adjust html rules accordingly. test 574 does not pass because of url encoding FIXME) --- lib/marked.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 4ded4855..011753b6 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -50,12 +50,12 @@ block.list = replace(block.list) block._tag = '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' - + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; + + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b'; block.html = replace(block.html) ('comment', //) ('closed', /<(tag)[\s\S]+?<\/\1>/) - ('closing', /])*?>/) + ('closing', /]*)*?\/?>/) (/tag/g, block._tag) (); @@ -460,9 +460,9 @@ Lexer.prototype.token = function(src, top) { var inline = { escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, - autolink: /^<([^ <>]+(@|:\/)[^ <>]+)>/, + autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, url: noop, - tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/, + tag: /^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/]*)*?\/?>/, link: /^!?\[(inside)\]\(href\)/, reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/, @@ -474,6 +474,14 @@ var inline = { text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; @@ -589,12 +597,8 @@ InlineLexer.prototype.output = function(src) { if (cap = this.rules.autolink.exec(src)) { src = src.substring(cap[0].length); if (cap[2] === '@') { - text = escape( - cap[1].charAt(6) === ':' - ? this.mangle(cap[1].substring(7)) - : this.mangle(cap[1]) - ); - href = this.mangle('mailto:') + text; + text = escape(this.mangle(cap[1])); + href = 'mailto:' + text; } else { text = escape(cap[1]); href = text; From b3769fc7a7d2029f5be271724740214a5e2687d1 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Mon, 22 Jan 2018 19:02:16 +0100 Subject: [PATCH 043/459] adjust mangle_xss test case to match commonmark output --- test/new/mangle_xss.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/new/mangle_xss.html b/test/new/mangle_xss.html index 83a7b355..3abcb67f 100644 --- a/test/new/mangle_xss.html +++ b/test/new/mangle_xss.html @@ -1,3 +1,3 @@ -

    <svg/onload="alert(1)"//@x

    +

    <<svg/onload="alert(1)"//@x>

    -

    bar"onclick="alert('XSS')"@foo

    +

    <bar"onclick="alert('XSS')"@foo>

    From 6cba7caad61bb5e09450b8a1277980be6be179b2 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 23 Jan 2018 04:25:30 +0100 Subject: [PATCH 044/459] add gfm tests for autolinks --- test/new/gfm_links.html | 69 ++++++++++++++++++++++++++++++++++++++++ test/new/gfm_links.md | 70 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) diff --git a/test/new/gfm_links.html b/test/new/gfm_links.html index 26f576d6..8247a35c 100644 --- a/test/new/gfm_links.html +++ b/test/new/gfm_links.html @@ -8,3 +8,72 @@ link with " http://example.com/hel link with ) http://example.com/hello-world) link with nothing http://example.com/hello-world

    + +

    Example 597

    + +

    The scheme http will be inserted automatically:

    + +

    www.commonmark.org

    +

    Example 598

    + +

    After a valid domain, zero or more non-space non-< characters may follow:

    + +

    Visit www.commonmark.org/help for more information.

    + +

    Example 599

    + +

    Trailing punctuation (specifically, ?, !, ., ,, :, *, _, and ~) will not be considered part of the autolink, though they may be included in the interior of the link:

    + +

    Visit www.commonmark.org.

    + +

    Visit www.commonmark.org/a.b.

    + +

    Example 600

    + +

    www.google.com/search?q=Markup+(business)

    + +

    (www.google.com/search?q=Markup+(business))

    + +

    Example 601

    + +

    www.google.com/search?q=(business))+ok

    + +

    Example 602

    + +

    www.google.com/search?q=commonmark&hl=en

    + +

    www.google.com/search?q=commonmark&

    + +

    Example 603

    + +

    < immediately ends an autolink.

    + +

    www.commonmark.org/he<lp

    + +

    Example 604

    + +

    http://commonmark.org

    + +

    (Visit https://encrypted.google.com/search?q=Markup+(business))

    + +

    Anonymous FTP is available at ftp://foo.bar.baz.

    + +

    Extended email autolinks:

    + +

    Example 605

    + +

    foo@bar.baz

    + +

    Example 606

    + +

    hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is.

    + +

    Example 607

    + +

    a.b-c_d@a.b

    + +

    a.b-c_d@a.b.

    + +

    a.b-c_d@a.b-

    + +

    a.b-c_d@a.b_

    diff --git a/test/new/gfm_links.md b/test/new/gfm_links.md index e37645db..f66ed151 100644 --- a/test/new/gfm_links.md +++ b/test/new/gfm_links.md @@ -7,3 +7,73 @@ link with ' http://example.com/hello-world' link with " http://example.com/hello-world" link with ) http://example.com/hello-world) link with nothing http://example.com/hello-world + +### Example 597 + +The scheme http will be inserted automatically: + +www.commonmark.org + +### Example 598 + +After a valid domain, zero or more non-space non-< characters may follow: + +Visit www.commonmark.org/help for more information. + +### Example 599 + +Trailing punctuation (specifically, ?, !, ., ,, :, \*, \_, and ~) will not be considered part of the autolink, though they may be included in the interior of the link: + +Visit www.commonmark.org. + +Visit www.commonmark.org/a.b. + +### Example 600 + +www.google.com/search?q=Markup+(business) + +(www.google.com/search?q=Markup+(business)) + +### Example 601 + +www.google.com/search?q=(business))+ok + +### Example 602 + +www.google.com/search?q=commonmark&hl=en + +www.google.com/search?q=commonmark& + +### Example 603 + +< immediately ends an autolink. + +www.commonmark.org/he Date: Tue, 23 Jan 2018 04:23:56 +0100 Subject: [PATCH 045/459] remove non-compliant test case --- test/new/gfm_links.html | 25 ++++++++++++++----------- test/new/gfm_links.md | 8 ++++++-- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/test/new/gfm_links.html b/test/new/gfm_links.html index 8247a35c..8752afad 100644 --- a/test/new/gfm_links.html +++ b/test/new/gfm_links.html @@ -1,13 +1,16 @@ -

    link with . http://example.com/hello-world. -link with ! http://example.com/hello-world! -link with : http://example.com/hello-world: -link with , http://example.com/hello-world, -link with ; http://example.com/hello-world; -link with ' http://example.com/hello-world' -link with " http://example.com/hello-world" -link with ) http://example.com/hello-world) -link with nothing http://example.com/hello-world -

    +

    link with . http://example.com/hello-world.

    + +

    link with ! http://example.com/hello-world!

    + +

    link with : http://example.com/hello-world:

    + +

    link with , http://example.com/hello-world,

    + +

    link with ; http://example.com/hello-world;

    + +

    link with ) http://example.com/hello-world)

    + +

    link with nothing http://example.com/hello-world

    Example 597

    @@ -76,4 +79,4 @@ link with nothing http://example.com/he

    a.b-c_d@a.b-

    -

    a.b-c_d@a.b_

    +

    a.b-c_d@a.b_

    \ No newline at end of file diff --git a/test/new/gfm_links.md b/test/new/gfm_links.md index f66ed151..f5060aa7 100644 --- a/test/new/gfm_links.md +++ b/test/new/gfm_links.md @@ -1,11 +1,15 @@ link with . http://example.com/hello-world. + link with ! http://example.com/hello-world! + link with : http://example.com/hello-world: + link with , http://example.com/hello-world, + link with ; http://example.com/hello-world; -link with ' http://example.com/hello-world' -link with " http://example.com/hello-world" + link with ) http://example.com/hello-world) + link with nothing http://example.com/hello-world ### Example 597 From 00f1f7a23916ef27186d0904635aa3509af63d47 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 23 Jan 2018 04:44:22 +0100 Subject: [PATCH 046/459] new gfm autolink rule: http/www URLs and email addresses --- lib/marked.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 011753b6..8fec4f59 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -515,11 +515,13 @@ inline.pedantic = merge({}, inline.normal, { inline.gfm = merge({}, inline.normal, { escape: replace(inline.escape)('])', '~|])')(), - url: /^(https?:\/\/[^\s<]+[^<.,:;"'!)\]\s])/, + url: replace(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/) + ('email', inline._email) + (), del: /^~~(?=\S)([\s\S]*?\S)~~/, text: replace(inline.text) (']|', '~]|') - ('|', '|https?://|') + ('|', '|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&\'*+/=?^_`{\\|}~-]+@|') () }); @@ -610,8 +612,17 @@ InlineLexer.prototype.output = function(src) { // url (gfm) if (!this.inLink && (cap = this.rules.url.exec(src))) { src = src.substring(cap[0].length); - text = escape(cap[1]); - href = text; + if (cap[2] === '@') { + text = escape(cap[0]); + href = 'mailto:' + text; + } else { + text = escape(cap[0]); + if (cap[1] === 'www.') { + href = 'http://' + text; + } else { + href = text; + } + } out += this.renderer.link(href, null, text); continue; } From 187d46f2944122f9525b2c745d3b54a8ba5f9c2d Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 23 Jan 2018 04:46:29 +0100 Subject: [PATCH 047/459] email address domain must contain at least a dot and must not end with dash or underscore --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 8fec4f59..2d2baca1 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -475,7 +475,7 @@ var inline = { }; inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; -inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/ +inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/ inline.autolink = replace(inline.autolink) ('scheme', inline._scheme) From ca455a68de13f5ad103336b765061b997652c7ac Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 23 Jan 2018 04:48:08 +0100 Subject: [PATCH 048/459] gfm autolinks: backpedal on trailing punctuation (see https://github.github.com/gfm/#extended-autolink-path-validation) --- lib/marked.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 2d2baca1..c8236e95 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -475,7 +475,7 @@ var inline = { }; inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; -inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/ +inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/; inline.autolink = replace(inline.autolink) ('scheme', inline._scheme) @@ -518,6 +518,7 @@ inline.gfm = merge({}, inline.normal, { url: replace(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/) ('email', inline._email) (), + _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, del: /^~~(?=\S)([\s\S]*?\S)~~/, text: replace(inline.text) (']|', '~]|') @@ -611,6 +612,7 @@ InlineLexer.prototype.output = function(src) { // url (gfm) if (!this.inLink && (cap = this.rules.url.exec(src))) { + cap[0] = this.rules._backpedal.exec(cap[0])[0]; src = src.substring(cap[0].length); if (cap[2] === '@') { text = escape(cap[0]); From f514b92b5bc4f7f03a2fc7becc46eec3af65a4df Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 23 Jan 2018 04:51:09 +0100 Subject: [PATCH 049/459] exclude test 607 in gfm_links, which does not pass FIXME --- test/new/gfm_links.html | 3 ++- test/new/gfm_links.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/new/gfm_links.html b/test/new/gfm_links.html index 8752afad..9058f2f2 100644 --- a/test/new/gfm_links.html +++ b/test/new/gfm_links.html @@ -79,4 +79,5 @@

    a.b-c_d@a.b-

    -

    a.b-c_d@a.b_

    \ No newline at end of file +
    a.b-c_d@a.b_
    +
    \ No newline at end of file diff --git a/test/new/gfm_links.md b/test/new/gfm_links.md index f5060aa7..86b9a3ee 100644 --- a/test/new/gfm_links.md +++ b/test/new/gfm_links.md @@ -80,4 +80,4 @@ a.b-c_d@a.b. a.b-c_d@a.b- -a.b-c_d@a.b_ + a.b-c_d@a.b_ From 49982e82cc18b10684760fb7f56f0fd6b40c7c9b Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 23 Jan 2018 04:52:04 +0100 Subject: [PATCH 050/459] disable gfm for old markdown.pl test case --- test/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index defd7f3b..491ae6b9 100644 --- a/test/index.js +++ b/test/index.js @@ -351,7 +351,7 @@ function fix() { fs.readdirSync(path.resolve(__dirname, 'original')).forEach(function(file) { var text = fs.readFileSync(path.resolve(__dirname, 'original', file)); - if (file === 'hard_wrapped_paragraphs_with_list_like_lines.md') { + if (path.extname(file) === '.md') { text = '---\ngfm: false\n---\n' + text; } From fac31ed978ded3a13735ea14180ca8d94dd80b5c Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 23 Jan 2018 16:51:46 +0100 Subject: [PATCH 051/459] allow matched double quotes in link definition title (markdown.pl behavior). Test literal_quotes_in_titles now passes. fixup! c3e00590 --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index f1d66ed4..5b41192d 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -29,7 +29,7 @@ var block = { }; block._label = /(?:\\[\[\]]|[^\[\]])+/; -block._title = /(?:"(?:\\"|[^"])*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/; +block._title = /(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/; block.def = replace(block.def) ('label', block._label) ('title', block._title) From 1c780b9985e533257cfd105035168f8ace002db2 Mon Sep 17 00:00:00 2001 From: kythyria Date: Tue, 29 Nov 2016 14:59:29 +0000 Subject: [PATCH 052/459] Fix the regexes for thematic breaks Commonmark and GFM both agree that -_- is literal characters, not
    , as all three characters must be the same. Also change the test harness to only look for .text and .html files since it was choking on vim's swapfiles. And add some tests to catch what this fixes. --- lib/marked.js | 4 ++-- test/index.js | 2 +- test/original/horizontal_rules.html | 14 ++++++++++++++ test/original/horizontal_rules.md | 27 +++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 63d45eb3..f3243b53 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -15,7 +15,7 @@ var block = { newline: /^\n+/, code: /^( {4}[^\n]+\n*)+/, fences: noop, - hr: /^( *[-*_]){3,} *(?:\n+|$)/, + hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, nptable: noop, blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, @@ -43,7 +43,7 @@ block.item = replace(block.item, 'gm') block.list = replace(block.list) (/bull/g, block.bullet) - ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') + ('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))') ('def', '\\n+(?=' + block.def.source + ')') (); diff --git a/test/index.js b/test/index.js index 491ae6b9..e3741069 100644 --- a/test/index.js +++ b/test/index.js @@ -37,7 +37,7 @@ function load(options) { list = fs .readdirSync(dir) .filter(function(file) { - return path.extname(file) !== '.html'; + return path.extname(file) === '.md'; }) .sort(); diff --git a/test/original/horizontal_rules.html b/test/original/horizontal_rules.html index 2dc2ab65..b84ba925 100644 --- a/test/original/horizontal_rules.html +++ b/test/original/horizontal_rules.html @@ -69,3 +69,17 @@
    _ _ _
     
    + +

    Not horizontal rules:

    +

    --*

    +

    -*-

    +

    *--

    +

    -_-

    +

    __-

    +

    -__

    +
    _-_
    +
    +

    Long rules:

    +
    +
    +
    diff --git a/test/original/horizontal_rules.md b/test/original/horizontal_rules.md index 1594bda2..49bbcfad 100644 --- a/test/original/horizontal_rules.md +++ b/test/original/horizontal_rules.md @@ -65,3 +65,30 @@ _ _ _ _ _ _ _ _ _ + + + +Not horizontal rules: + +--* + +-*- + +*-- + + -_- + + __- + + -__ + + _-_ + + +Long rules: + +----------- + +___________ + +*********** From 2ea539ad67ab7255c068b58db1d65741a62345d4 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Thu, 25 Jan 2018 16:48:33 +0100 Subject: [PATCH 053/459] add commonmark test for thematic breaks --- test/new/cm_thematic_breaks.html | 106 +++++++++++++++++++++++++++++++ test/new/cm_thematic_breaks.md | 98 ++++++++++++++++++++++++++++ 2 files changed, 204 insertions(+) create mode 100644 test/new/cm_thematic_breaks.html create mode 100644 test/new/cm_thematic_breaks.md diff --git a/test/new/cm_thematic_breaks.html b/test/new/cm_thematic_breaks.html new file mode 100644 index 00000000..ec3f9f74 --- /dev/null +++ b/test/new/cm_thematic_breaks.html @@ -0,0 +1,106 @@ +

    Thematic breaks

    + +

    Example 13

    + +
    +
    +
    + +

    Example 14

    + +

    +++

    + +

    Example 15

    + +

    ===

    + +

    Example 16

    + +

    -- +** +__

    + +

    Example 17

    + +
    +
    +
    + +

    Example 18

    + +
    ***
    +
    + +

    Example 19

    + +

    Foo + ***

    + +

    Example 20

    + +
    + +

    Example 21

    + +
    + +

    Example 22

    + +
    + +

    Example 23

    + +
    + +

    Example 24

    + +
    + +

    Example 25

    + +

    _ _ _ _ a

    +

    a------

    +

    ---a---

    + + +

    Example 26

    + +

    -

    + +

    Example 27

    + +
      +
    • foo
    • +
    +
    +
      +
    • bar
    • +
    + +

    Example 28

    + +

    Foo

    +
    +

    bar

    + +

    Example 29

    + +

    Foo

    +

    bar

    + +

    Example 30

    + +
      +
    • Foo
    • +
    +
    +
      +
    • Bar
    • +
    + +

    Example 31

    + +
      +
    • Foo
    • +

    • +
    \ No newline at end of file diff --git a/test/new/cm_thematic_breaks.md b/test/new/cm_thematic_breaks.md new file mode 100644 index 00000000..af28f8dd --- /dev/null +++ b/test/new/cm_thematic_breaks.md @@ -0,0 +1,98 @@ +Thematic breaks +=================== + +### Example 13 + +*** +--- +___ + +### Example 14 + ++++ + +### Example 15 + +=== + +### Example 16 + +-- +** +__ + +### Example 17 + + *** + *** + *** + +### Example 18 + + *** + +### Example 19 + +Foo + *** + +### Example 20 + +_____________________________________ + +### Example 21 + + - - - + +### Example 22 + + ** * ** * ** * ** + +### Example 23 + +- - - - + +### Example 24 + +- - - - + +### Example 25 + +_ _ _ _ a + +a------ + +---a--- + +### Example 26 + + *-* + +### Example 27 + +- foo +*** +- bar + +### Example 28 + +Foo +*** +bar + +### Example 29 + +Foo +--- +bar + +### Example 30 + +* Foo +* * * +* Bar + +### Example 31 + +- Foo +- * * * From b8437b0742ca2cb525686401eb9e15bd34639259 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Thu, 25 Jan 2018 05:49:48 +0100 Subject: [PATCH 054/459] fix underscore emphasis (apply commonmark flanking rule and rule 12) --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index f3243b53..e5c27514 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -467,11 +467,11 @@ var inline = { reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/, strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, - em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, + em: /^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/, code: /^(`+)(\s*)([\s\S]*?[^`]?)\2\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, del: noop, - text: /^[\s\S]+?(?=[\\ Date: Thu, 1 Feb 2018 23:10:15 -0600 Subject: [PATCH 055/459] add peer dependencies --- package-lock.json | 1433 ++++++++++++++++++++++++++++++++++++++++++++- package.json | 10 +- 2 files changed, 1409 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index 81d14163..7c480348 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,47 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, + "acorn": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.4.0.tgz", + "integrity": "sha512-bkLTrtPfRASTxDXFaih7SbeYSsQ8MjrqCQKMrgZ4Hc7kYI//WVU6rDTAIqVrAudjgMFQEGthYfodtaw8dTRJrg==", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, "align-text": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", @@ -21,6 +62,12 @@ "repeat-string": "1.6.1" } }, + "ansi-escapes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", + "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", + "dev": true + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -81,6 +128,15 @@ "integrity": "sha1-5zA08A3MH0CHYAj9IP6ud71LfC8=", "dev": true }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", @@ -93,12 +149,29 @@ "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", "dev": true }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, "async": { "version": "0.2.10", "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", "dev": true }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -132,6 +205,27 @@ "repeat-element": "1.1.2" } }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, "camelcase": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", @@ -161,6 +255,33 @@ "supports-color": "2.0.0" } }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, "cliui": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", @@ -201,18 +322,82 @@ "through2": "2.0.3" } }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "typedarray": "0.0.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, "concat-with-sourcemaps": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.4.tgz", @@ -222,6 +407,12 @@ "source-map": "0.5.7" } }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -263,12 +454,27 @@ "integrity": "sha1-sUi/gkMKJ2mbdIOgPra2dYW/yIg=", "dev": true }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, "defaults": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", @@ -278,6 +484,29 @@ "clone": "1.0.3" } }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, "deprecated": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/deprecated/-/deprecated-0.0.1.tgz", @@ -293,6 +522,15 @@ "fs-exists-sync": "0.1.0" } }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, "duplexer2": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", @@ -317,18 +555,361 @@ "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", "dev": true }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "eslint": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.16.0.tgz", + "integrity": "sha512-YVXV4bDhNoHHcv0qzU4Meof7/P26B4EuaktMi5L1Tnt52Aov85KmYA8c5D+xyZr/BkhvwUqr011jDSD/QTULxg==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "babel-code-frame": "6.26.0", + "chalk": "2.3.0", + "concat-stream": "1.6.0", + "cross-spawn": "5.1.0", + "debug": "3.1.0", + "doctrine": "2.1.0", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.2", + "esquery": "1.0.0", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.2", + "globals": "11.3.0", + "ignore": "3.3.7", + "imurmurhash": "0.1.4", + "inquirer": "3.3.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.10.0", + "json-stable-stringify-without-jsonify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.4", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "7.0.0", + "progress": "2.0.0", + "require-uncached": "1.0.3", + "semver": "5.5.0", + "strip-ansi": "4.0.0", + "strip-json-comments": "2.0.1", + "table": "4.0.2", + "text-table": "0.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.3.3", + "path-is-absolute": "1.0.1" + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "eslint-config-standard": { + "version": "11.0.0-beta.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-11.0.0-beta.0.tgz", + "integrity": "sha512-f+vs5HAHQo7NRZ3hVe+UVdT5DbebMNaFTWFp95orJ0LUdYPoWdM8xw/bMeO/IZMvHOPmIteGKGc2QOhSXd5nRg==", + "dev": true + }, + "eslint-import-resolver-node": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "dev": true, + "requires": { + "debug": "2.6.9", + "resolve": "1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "eslint-module-utils": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz", + "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", + "dev": true, + "requires": { + "debug": "2.6.9", + "pkg-dir": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz", + "integrity": "sha512-Rf7dfKJxZ16QuTgVv1OYNxkZcsu/hULFnC+e+w0Gzi6jMC3guQoWQgxYxc54IDRinlb6/0v5z/PxxIKmVctN+g==", + "dev": true, + "requires": { + "builtin-modules": "1.1.1", + "contains-path": "0.1.0", + "debug": "2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "0.3.2", + "eslint-module-utils": "2.1.1", + "has": "1.0.1", + "lodash.cond": "4.5.2", + "minimatch": "3.0.4", + "read-pkg-up": "2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "2.0.2", + "isarray": "1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + } + } + }, + "eslint-plugin-node": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-5.2.1.tgz", + "integrity": "sha512-xhPXrh0Vl/b7870uEbaumb2Q+LxaEcOQ3kS1jtIXanBAwpMre1l5q/l2l/hESYJGEFKuI78bp6Uw50hlpr7B+g==", + "dev": true, + "requires": { + "ignore": "3.3.7", + "minimatch": "3.0.4", + "resolve": "1.5.0", + "semver": "5.3.0" + }, + "dependencies": { + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true + } + } + }, + "eslint-plugin-promise": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.6.0.tgz", + "integrity": "sha512-YQzM6TLTlApAr7Li8vWKR+K3WghjwKcYzY0d2roWap4SLK+kzuagJX/leTetIDWsFcTFnKNJXWupDCD6aZkP2Q==", + "dev": true + }, + "eslint-plugin-standard": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz", + "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=", + "dev": true + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.0", + "estraverse": "4.2.0" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", + "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", + "dev": true, + "requires": { + "acorn": "5.4.0", + "acorn-jsx": "3.0.1" + } + }, "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, + "esquery": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", + "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", + "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "dev": true, + "requires": { + "estraverse": "4.2.0", + "object-assign": "4.1.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, "execa": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", @@ -377,6 +958,17 @@ "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", "dev": true }, + "external-editor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", + "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", + "dev": true, + "requires": { + "chardet": "0.4.2", + "iconv-lite": "0.4.19", + "tmp": "0.0.33" + } + }, "extglob": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", @@ -396,6 +988,51 @@ "time-stamp": "1.1.0" } }, + "fast-deep-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", + "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + }, + "dependencies": { + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, "filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", @@ -478,6 +1115,26 @@ "integrity": "sha1-/xke3c1wiKZ1smEP/8l2vpuAdLU=", "dev": true }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + } + } + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -508,6 +1165,24 @@ "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=", "dev": true }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "gaze": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz", @@ -644,6 +1319,57 @@ "which": "1.3.0" } }, + "globals": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz", + "integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.3.3", + "path-is-absolute": "1.0.1" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + } + } + }, "globule": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", @@ -825,6 +1551,15 @@ "glogg": "1.0.0" } }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "1.1.1" + } + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -834,6 +1569,12 @@ "ansi-regex": "2.1.1" } }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, "has-gulplog": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", @@ -852,6 +1593,30 @@ "parse-passwd": "1.0.0" } }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "dev": true + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", + "dev": true + }, + "ignore": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", + "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -874,6 +1639,80 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dev": true, + "requires": { + "ansi-escapes": "3.0.0", + "chalk": "2.3.0", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "2.1.0", + "figures": "2.0.0", + "lodash": "4.17.4", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, "interpret": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", @@ -896,12 +1735,27 @@ "is-windows": "0.2.0" } }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, "is-dotfile": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", @@ -956,6 +1810,30 @@ "kind-of": "3.2.2" } }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -985,6 +1863,12 @@ "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", "dev": true }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, "is-relative": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", @@ -994,6 +1878,12 @@ "is-unc-path": "0.1.2" } }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -1050,6 +1940,12 @@ } } }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, "js-yaml": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", @@ -1060,6 +1956,18 @@ "esprima": "4.0.0" } }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -1084,6 +1992,16 @@ "invert-kv": "1.0.0" } }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, "liftoff": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.3.0.tgz", @@ -1110,6 +2028,32 @@ "uc.micro": "1.0.3" } }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", @@ -1180,6 +2124,12 @@ "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", "dev": true }, + "lodash.cond": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", + "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", + "dev": true + }, "lodash.escape": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", @@ -1377,6 +2327,12 @@ } } }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, "multipipe": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", @@ -1386,12 +2342,24 @@ "duplexer2": "0.0.2" } }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, "natives": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz", "integrity": "sha1-6f+EFBimsux6SV6TmYT3jxY+bjE=", "dev": true }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "nopt": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.1.2.tgz", @@ -1401,6 +2369,18 @@ "abbrev": "1.1.1" } }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "2.5.0", + "is-builtin-module": "1.0.0", + "semver": "4.3.6", + "validate-npm-package-license": "3.0.1" + } + }, "normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", @@ -1496,6 +2476,37 @@ "wrappy": "1.0.2" } }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.1.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + }, + "dependencies": { + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + } + } + }, "orchestrator": { "version": "0.3.8", "resolved": "https://registry.npmjs.org/orchestrator/-/orchestrator-0.3.8.tgz", @@ -1530,6 +2541,12 @@ "mem": "1.1.0" } }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", @@ -1574,6 +2591,15 @@ "is-glob": "2.0.1" } }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, "parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -1586,6 +2612,18 @@ "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -1613,6 +2651,78 @@ "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", "dev": true }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "2.3.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true, + "requires": { + "find-up": "1.1.2" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + } + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, "preserve": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", @@ -1631,6 +2741,12 @@ "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", "dev": true }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -1678,6 +2794,27 @@ } } }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.4.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + } + }, "readable-stream": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", @@ -1744,6 +2881,16 @@ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, "resolve": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", @@ -1763,6 +2910,22 @@ "global-modules": "0.2.3" } }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, "right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", @@ -1772,6 +2935,64 @@ "align-text": "0.1.4" } }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.3.3", + "path-is-absolute": "1.0.1" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + } + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "4.0.8" + } + }, "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", @@ -1812,45 +3033,47 @@ "dev": true }, "showdown": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/showdown/-/showdown-1.8.3.tgz", - "integrity": "sha1-ZE3TyPlDLHdExJtF6aGYoBcZQ14=", + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/showdown/-/showdown-1.8.6.tgz", + "integrity": "sha1-kepO47elRIqspoIKTifmkMatdxw=", "dev": true, "requires": { - "yargs": "10.0.3" + "yargs": "10.1.2" }, "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.0.0.tgz", + "integrity": "sha512-nY3W5Gu2racvdDk//ELReY+dHjb9PlIcVDFXP72nVIhq2Gy3LuVXYwJoPVudwQnv1shtohpgkdCKT2YaKY0CKw==", "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", "wrap-ansi": "2.1.0" - }, - "dependencies": { - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - } + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" } }, "yargs": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.0.3.tgz", - "integrity": "sha512-DqBpQ8NAUX4GyPP/ijDGHsJya4tYqLQrjPr95HNsr1YwL3+daCfvBwg7+gIC6IdJhR2kATh3hb61vjzMWEtjdw==", + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.1.2.tgz", + "integrity": "sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==", "dev": true, "requires": { - "cliui": "3.2.0", + "cliui": "4.0.0", "decamelize": "1.2.0", "find-up": "2.1.0", "get-caller-file": "1.0.2", @@ -1861,7 +3084,7 @@ "string-width": "2.1.1", "which-module": "2.0.0", "y18n": "3.2.1", - "yargs-parser": "8.0.0" + "yargs-parser": "8.1.0" } } } @@ -1878,6 +3101,23 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -1890,6 +3130,27 @@ "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", "dev": true }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "dev": true, + "requires": { + "spdx-license-ids": "1.2.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "dev": true + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -1966,12 +3227,81 @@ "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "ajv-keywords": "2.1.1", + "chalk": "2.3.0", + "lodash": "4.17.4", + "slice-ansi": "1.0.0", + "string-width": "2.1.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, "through2": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", @@ -2029,6 +3359,30 @@ "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", "dev": true }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, "uc.micro": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.3.tgz", @@ -2092,6 +3446,16 @@ "user-home": "1.1.1" } }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "dev": true, + "requires": { + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.4" + } + }, "vinyl": { "version": "0.5.3", "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", @@ -2224,6 +3588,15 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + } + }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", @@ -2255,9 +3628,9 @@ } }, "yargs-parser": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.0.0.tgz", - "integrity": "sha1-IdR2Mw5agieaS4gTRb8GYQLiGcY=", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz", + "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", "dev": true, "requires": { "camelcase": "4.1.0" diff --git a/package.json b/package.json index ebeea81c..6e1aebc2 100644 --- a/package.json +++ b/package.json @@ -23,18 +23,20 @@ "html" ], "devDependencies": { - "markdown": "*", - "showdown": "*", - "markdown-it": "*", "eslint": "^4.15.0", "eslint-config-standard": "^11.0.0-beta.0", + "eslint-plugin-import": "^2.8.0", "eslint-plugin-node": "^5.2.1", + "eslint-plugin-promise": "^3.6.0", "eslint-plugin-standard": "^3.0.1", "front-matter": "^2.3.0", "glob-to-regexp": "0.3.0", "gulp": "^3.8.11", + "gulp-concat": "^2.5.2", "gulp-uglify": "^1.1.0", - "gulp-concat": "^2.5.2" + "markdown": "*", + "markdown-it": "*", + "showdown": "^1.8.6" }, "scripts": { "test": "node test", From 05e770d4357c126826ad96457ada5e4d132a2317 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 1 Feb 2018 23:10:48 -0600 Subject: [PATCH 056/459] reformat text runner --- test/index.js | 248 ++++++++++++++++++++++++++------------------------ 1 file changed, 127 insertions(+), 121 deletions(-) diff --git a/test/index.js b/test/index.js index e3741069..80f97c0e 100644 --- a/test/index.js +++ b/test/index.js @@ -10,29 +10,26 @@ * Modules */ -var fs = require('fs') - , path = require('path') - , fm = require('front-matter') - , g2r = require('glob-to-regexp') - , marked = require('../'); +var fs = require('fs'), + path = require('path'), + fm = require('front-matter'), + g2r = require('glob-to-regexp'), + marked = require('../'); /** * Load Tests */ function load(options) { - var dir = __dirname + '/compiled_tests' - , files = {} - , list - , file - , name - , content - , regex - , skip - , glob = g2r(options.glob || "*", { extended: true }) - , i - , j - , l; + var dir = path.join(__dirname, 'compiled_tests'), + files = {}, + list, + file, + name, + content, + glob = g2r(options.glob || '*', { extended: true }), + i, + l; list = fs .readdirSync(dir) @@ -44,7 +41,7 @@ function load(options) { l = list.length; for (i = 0; i < l; i++) { - name = path.basename(list[i], ".md"); + name = path.basename(list[i], '.md'); if (glob.test(name)) { file = path.join(dir, list[i]); content = fm(fs.readFileSync(file, 'utf8')); @@ -61,7 +58,7 @@ function load(options) { if (!options.glob) { // Change certain tests to allow // comparison to older benchmark times. - fs.readdirSync(__dirname + '/new').forEach(function(name) { + fs.readdirSync(path.join(__dirname, 'new')).forEach(function(name) { if (path.extname(name) === '.html') return; if (name === 'main.md') return; delete files[name]; @@ -92,112 +89,121 @@ function runTests(engine, options) { engine = null; } - var engine = engine || marked - , options = options || {} - , files = options.files || load(options) - , complete = 0 - , failed = 0 - , failures = [] - , keys = Object.keys(files) - , i = 0 - , len = keys.length - , filename - , file - , opts - , text - , html - , j - , l; + engine = engine || marked; + options = options || {}; + var succeeded = 0, + failed = 0, + files = options.files || load(options), + filenames = Object.keys(files), + len = filenames.length, + success, + i, + filename, + file; if (options.marked) { marked.setOptions(options.marked); } -main: - for (; i < len; i++) { - filename = keys[i]; + for (i = 0; i < len; i++) { + filename = filenames[i]; file = files[filename]; - opts = Object.keys(file.options); - - if (marked._original) { - marked.defaults = marked._original; - delete marked._original; - } - - if (opts.length) { - marked._original = marked.defaults; - marked.defaults = {}; - Object.keys(marked._original).forEach(function(key) { - marked.defaults[key] = marked._original[key]; - }); - opts.forEach(function(key) { - if (marked.defaults.hasOwnProperty(key)) { - marked.defaults[key] = file.options[key]; - } - }); - } - - try { - text = engine(file.text).replace(/\s/g, ''); - html = file.html.replace(/\s/g, ''); - } catch (e) { - console.log('%s failed.', filename); - throw e; - } - - j = 0; - l = html.length; - - for (; j < l; j++) { - if (text[j] !== html[j]) { - failed++; - failures.push(filename); - - text = text.substring( - Math.max(j - 30, 0), - Math.min(j + 30, text.length)); - - html = html.substring( - Math.max(j - 30, 0), - Math.min(j + 30, html.length)); - - console.log( - '\n#%d. %s failed at offset %d. Near: "%s".\n', - i + 1, filename, j, text); - - console.log('\nGot:\n%s\n', text.trim() || text); - console.log('\nExpected:\n%s\n', html.trim() || html); - - if (options.stop) { - break main; - } - - continue main; + success = testFile(engine, file, filename, i + 1); + if (success) { + succeeded++; + } else { + failed++; + if (options.stop) { + break; } } - - complete++; - console.log('#%d. %s completed.', i + 1, filename); } - console.log('%d/%d tests completed successfully.', complete, len); + console.log('%d/%d tests completed successfully.', succeeded, len); if (failed) console.log('%d/%d tests failed.', failed, len); return !failed; } +/** + * Test a file + */ + +function testFile(engine, file, filename, index) { + var failures = [], + opts = Object.keys(file.options), + text, + html, + j, + l; + + if (marked._original) { + marked.defaults = marked._original; + delete marked._original; + } + + if (opts.length) { + marked._original = marked.defaults; + marked.defaults = {}; + Object.keys(marked._original).forEach(function(key) { + marked.defaults[key] = marked._original[key]; + }); + opts.forEach(function(key) { + if (marked.defaults.hasOwnProperty(key)) { + marked.defaults[key] = file.options[key]; + } + }); + } + + try { + text = engine(file.text).replace(/\s/g, ''); + html = file.html.replace(/\s/g, ''); + } catch (e) { + console.log('%s failed.', filename); + throw e; + } + + l = html.length; + + for (j = 0; j < l; j++) { + if (text[j] !== html[j]) { + failures.push(filename); + + text = text.substring( + Math.max(j - 30, 0), + Math.min(j + 30, text.length)); + + html = html.substring( + Math.max(j - 30, 0), + Math.min(j + 30, html.length)); + + console.log( + '\n#%d. %s failed at offset %d. Near: "%s".\n', + index, filename, j, text); + + console.log('\nGot:\n%s\n', text.trim() || text); + console.log('\nExpected:\n%s\n', html.trim() || html); + + return false; + } + } + + console.log('#%d. %s completed.', index, filename); + return true +} + /** * Benchmark a function */ function bench(name, files, func) { - var start = Date.now() - , times = 1000 - , keys = Object.keys(files) - , i - , l = keys.length - , filename - , file; + var start = Date.now(), + times = 1000, + keys = Object.keys(files), + i, + l = keys.length, + filename, + file; while (times--) { for (i = 0; i < l; i++) { @@ -215,8 +221,8 @@ function bench(name, files, func) { */ function runBench(options) { - var options = options || {} - , files = load(options); + options = options || {}; + var files = load(options); // Non-GFM, Non-pedantic marked.setOptions({ @@ -313,8 +319,8 @@ function runBench(options) { */ function time(options) { - var options = options || {} - , files = load(options); + options = options || {}; + var files = load(options); if (options.marked) { marked.setOptions(options.marked); } @@ -359,13 +365,13 @@ function fix() { }); // node fix.js - var dir = __dirname + '/compiled_tests'; + var dir = path.join(__dirname, 'compiled_tests'); fs.readdirSync(dir).filter(function(file) { return path.extname(file) === '.html'; }).forEach(function(file) { - var file = path.join(dir, file) - , html = fs.readFileSync(file, 'utf8'); + file = path.join(dir, file); + var html = fs.readFileSync(file, 'utf8'); // fix unencoded quotes html = html @@ -385,7 +391,7 @@ function fix() { .replace(/</g, '<') .replace(/&/g, '&'); - id = id.toLowerCase().replace(/[^\w]+/g, '-'); + id = id.toLowerCase().replace(/[^\w]+/g, '-'); return '<' + h + ' id="' + id + '">' + text + ''; }); @@ -395,8 +401,8 @@ function fix() { // turn
    into
    fs.readdirSync(dir).forEach(function(file) { - var file = path.join(dir, file) - , text = fs.readFileSync(file, 'utf8'); + file = path.join(dir, file); + var text = fs.readFileSync(file, 'utf8'); text = text.replace(/(<|<)hr\s*\/(>|>)/g, '$1hr$2'); @@ -424,12 +430,12 @@ function fix() { * Argument Parsing */ -function parseArg(argv) { - var argv = process.argv.slice(2) - , options = {} - , opt = "" - , orphans = [] - , arg; +function parseArg() { + var argv = process.argv.slice(2), + options = {}, + opt = '', + orphans = [], + arg; function getarg() { var arg = argv.shift(); From 2ab2bafc4bc7b0a9aadcf5d9a77e62f85fe0e1c2 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 1 Feb 2018 23:11:21 -0600 Subject: [PATCH 057/459] build minified file --- marked.min.js | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index 1883d019..4e82782c 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/chjj/marked */ -(function(){"use strict";function e(e){this.tokens=[],this.tokens.links={},this.options=e||p.defaults,this.rules=u.normal,this.options.gfm&&(this.options.tables?this.rules=u.tables:this.rules=u.gfm)}function t(e,t){if(this.options=t||p.defaults,this.links=e,this.rules=c.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=c.breaks:this.rules=c.gfm:this.options.pedantic&&(this.rules=c.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||p.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function o(e,t){return g[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?g[" "+e]=e+"/":g[" "+e]=e.replace(/[^\/]*$/,"")),e=g[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[\s\S]*/,"$1")+t:e+t}function h(){}function a(e){for(var t,n,r=1;rAn error occurred:

    "+s(c.message+"",!0)+"
    ";throw c}}var u={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:h,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:h,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:h,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};u.bullet=/(?:[*+-]|\d+\.)/,u.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,u.item=l(u.item,"gm")(/bull/g,u.bullet)(),u.list=l(u.list)(/bull/g,u.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+u.def.source+")")(),u.blockquote=l(u.blockquote)("def",u.def)(),u._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",u.html=l(u.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,u._tag)(),u.paragraph=l(u.paragraph)("hr",u.hr)("heading",u.heading)("lheading",u.lheading)("blockquote",u.blockquote)("tag","<"+u._tag)("def",u.def)(),u.normal=a({},u),u.gfm=a({},u.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),u.gfm.paragraph=l(u.paragraph)("(?!","(?!"+u.gfm.fences.source.replace("\\1","\\2")+"|"+u.list.source.replace("\\1","\\3")+"|")(),u.tables=a({},u.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=u,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,p,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(h),p!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<([^ <>]+(@|:\/)[^ <>]+)>/,url:h,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:h,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,c.link=l(c.link)("inside",c._inside)("href",c._href)(),c.reflink=l(c.reflink)("inside",c._inside)(),c.normal=a({},c),c.pedantic=a({},c.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),c.gfm=a({},c.normal,{escape:l(c.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(c.text)("]|","~]|")("|","|https?://|")()}),c.breaks=a({},c.gfm,{br:l(c.br)("{2,}","*")(),text:l(c.gfm.text)("{2,}","*")()}),t.rules=c,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=s(":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1])),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:s(e,!0))+"\n
    \n":"
    "+(n?e:s(e,!0))+"\n
    "},n.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},n.prototype.paragraph=function(e){return"

    "+e+"

    \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!f.test(e)&&(e=o(this.options.baseUrl,e));var l='
    "},n.prototype.image=function(e,t,n){this.options.baseUrl&&!f.test(e)&&(e=o(this.options.baseUrl,e));var r=''+n+'":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,s,i="",l="";for(n="",e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'")}function l(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function o(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=n.source||n,n=n.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function a(e,t){return f[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?f[" "+e]=e+"/":f[" "+e]=e.replace(/[^\/]*$/,"")),e=f[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[\s\S]*/,"$1")+t:e+t}function h(){}function p(e){for(var t,n,r=1;rAn error occurred:

    "+i(c.message+"",!0)+"
    ";throw c}}var c={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:h,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:h,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:h,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};c._label=/(?:\\[\[\]]|[^\[\]])+/,c._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,c.def=o(c.def).replace("label",c._label).replace("title",c._title).getRegex(),c.bullet=/(?:[*+-]|\d+\.)/,c.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,c.item=o(c.item,"gm").replace(/bull/g,c.bullet).getRegex(),c.list=o(c.list).replace(/bull/g,c.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+c.def.source+")").getRegex(),c._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",c.html=o(c.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/]*)*?\/?>/).replace(/tag/g,c._tag).getRegex(),c.paragraph=o(c.paragraph).replace("hr",c.hr).replace("heading",c.heading).replace("lheading",c.lheading).replace("tag","<"+c._tag).getRegex(),c.blockquote=o(c.blockquote).replace("paragraph",c.paragraph).getRegex(),c.normal=p({},c),c.gfm=p({},c.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),c.gfm.paragraph=o(c.paragraph).replace("(?!","(?!"+c.gfm.fences.source.replace("\\1","\\2")+"|"+c.list.source.replace("\\1","\\3")+"|").getRegex(),c.tables=p({},c.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=c,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t){e=e.replace(/^ +$/gm,"");for(var n,r,s,i,l,o,a,h,p,u;e;)if((s=this.rules.newline.exec(e))&&(e=e.substring(s[0].length),s[0].length>1&&this.tokens.push({type:"space"})),s=this.rules.code.exec(e))e=e.substring(s[0].length),s=s[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?s:s.replace(/\n+$/,"")});else if(s=this.rules.fences.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"code",lang:s[2],text:s[3]||""});else if(s=this.rules.heading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:s[1].length,text:s[2]});else if(t&&(s=this.rules.nptable.exec(e))){for(e=e.substring(s[0].length),o={type:"table",header:s[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3].replace(/\n$/,"").split("\n")},h=0;h ?/gm,""),this.token(s,t),this.tokens.push({type:"blockquote_end"});else if(s=this.rules.list.exec(e)){for(e=e.substring(s[0].length),i=s[2],this.tokens.push({type:"list_start",ordered:i.length>1}),s=s[0].match(this.rules.item),n=!1,u=s.length,h=0;h1&&l.length>1||(e=s.slice(h+1).join("\n")+e,h=u-1)),r=n||/\n\n(?!\s*$)/.test(o),h!==u-1&&(n="\n"===o.charAt(o.length-1),r||(r=n)),this.tokens.push({type:r?"loose_item_start":"list_item_start"}),this.token(o,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(s=this.rules.html.exec(e))e=e.substring(s[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===s[1]||"script"===s[1]||"style"===s[1]),text:s[0]});else if(t&&(s=this.rules.def.exec(e)))e=e.substring(s[0].length),s[3]&&(s[3]=s[3].substring(1,s[3].length-1)),p=s[1].toLowerCase(),this.tokens.links[p]||(this.tokens.links[p]={href:s[2],title:s[3]});else if(t&&(s=this.rules.table.exec(e))){for(e=e.substring(s[0].length),o={type:"table",header:s[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3].replace(/(?: *\| *)?\n$/,"").split("\n")},h=0;h])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:h,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)(\s*)([\s\S]*?[^`]?)\2\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:h,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,g.link=o(g.link).replace("inside",g._inside).replace("href",g._href).getRegex(),g.reflink=o(g.reflink).replace("inside",g._inside).getRegex(),g.normal=p({},g),g.pedantic=p({},g.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),g.gfm=p({},g.normal,{escape:o(g.escape).replace("])","~|])").getRegex(),url:o(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",g._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:o(g.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),g.breaks=p({},g.gfm,{br:o(g.br).replace("{2,}","*").getRegex(),text:o(g.gfm.text).replace("{2,}","*").getRegex()}),t.rules=g,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,s,l="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),l+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),"@"===s[2]?(n=i(this.mangle(s[1])),r="mailto:"+n):(n=i(s[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):i(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,l+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),l+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),l+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),l+=this.renderer.codespan(i(s[3].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),l+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),l+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),l+=this.renderer.text(i(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?(n=i(s[0]),r="mailto:"+n):(n=i(s[0]),r="www."===s[1]?"http://"+n:n),l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=i(t.href),r=t.title?i(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,i(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:i(e,!0))+"\n
    \n":"
    "+(n?e:i(e,!0))+"\n
    "},n.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},n.prototype.paragraph=function(e){return"

    "+e+"

    \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(l(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!d.test(e)&&(e=a(this.options.baseUrl,e));var i='
    "},n.prototype.image=function(e,t,n){this.options.baseUrl&&!d.test(e)&&(e=a(this.options.baseUrl,e));var r=''+n+'":">"},n.prototype.text=function(e){return e},r.prototype.strong=r.prototype.em=r.prototype.codespan=r.prototype.del=r.prototype.text=function(e){return e},r.prototype.link=r.prototype.image=function(e,t,n){return""+n},r.prototype.br=function(){return""},s.parse=function(e,t){var n=new s(t);return n.parse(e)},s.prototype.parse=function(e){this.inline=new t(e.links,this.options),this.inlineText=new t(e.links,p({},this.options,{renderer:new r})),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},s.prototype.next=function(){return this.token=this.tokens.pop()},s.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},s.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},s.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,l(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e Date: Thu, 1 Feb 2018 23:33:19 -0600 Subject: [PATCH 058/459] set showdown version to * --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f9dff7d..cab172dd 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "gulp-uglify": "^1.1.0", "markdown": "*", "markdown-it": "*", - "showdown": "^1.8.6" + "showdown": "*" }, "scripts": { "test": "node test", From 5c45ad6dedd981e733e64ba4c7c805032704972d Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Fri, 2 Feb 2018 07:05:38 +0100 Subject: [PATCH 059/459] use local copy of gulp to minify --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cab172dd..95e8f1b5 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "scripts": { "test": "node test", "bench": "node test --bench", - "build": "gulp", + "build": "node_modules/.bin/gulp", "lint": "node_modules/.bin/eslint --fix lib/marked.js" } } From 6d2369d1958872e22fbf1eac63420ee3b80432f6 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Fri, 2 Feb 2018 17:12:23 +0100 Subject: [PATCH 060/459] revert, local modules are put in PATH by npm automatically --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 95e8f1b5..4b262dae 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "scripts": { "test": "node test", "bench": "node test --bench", - "build": "node_modules/.bin/gulp", - "lint": "node_modules/.bin/eslint --fix lib/marked.js" + "build": "gulp", + "lint": "eslint --fix lib/marked.js" } } From 1bfed0377d4f6322ce3482fde1c4fe833ae86135 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Fri, 2 Feb 2018 17:13:36 +0100 Subject: [PATCH 061/459] automatically lint test/index.js too --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b262dae..8868f7f6 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,6 @@ "test": "node test", "bench": "node test --bench", "build": "gulp", - "lint": "eslint --fix lib/marked.js" + "lint": "eslint --fix lib/marked.js test/index.js" } } From 8de10c4d583aaf274ad66de40aeecbd4961cae5b Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 6 Feb 2018 19:47:41 -0500 Subject: [PATCH 062/459] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 94ab0b90..5b7fb71f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +

    Hello, World!

    + # marked > A full-featured markdown parser and compiler, written in JavaScript. Built From 735d4ceb14322e74c5429faddcf589818116ff71 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 6 Feb 2018 19:47:52 -0500 Subject: [PATCH 063/459] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 5b7fb71f..94ab0b90 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -

    Hello, World!

    - # marked > A full-featured markdown parser and compiler, written in JavaScript. Built From d4db0b2e655a36fc487b79455c5274ffd938446f Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Wed, 7 Feb 2018 22:04:05 +0100 Subject: [PATCH 064/459] [lint] remove unused variable --- test/index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/index.js b/test/index.js index 80f97c0e..5846b0dc 100644 --- a/test/index.js +++ b/test/index.js @@ -130,8 +130,7 @@ function runTests(engine, options) { */ function testFile(engine, file, filename, index) { - var failures = [], - opts = Object.keys(file.options), + var opts = Object.keys(file.options), text, html, j, @@ -167,15 +166,13 @@ function testFile(engine, file, filename, index) { for (j = 0; j < l; j++) { if (text[j] !== html[j]) { - failures.push(filename); - text = text.substring( Math.max(j - 30, 0), Math.min(j + 30, text.length)); html = html.substring( Math.max(j - 30, 0), - Math.min(j + 30, html.length)); + Math.min(j + 30, l)); console.log( '\n#%d. %s failed at offset %d. Near: "%s".\n', From c345a826223f41f4fb544a591c1cf639969ec62a Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Thu, 8 Feb 2018 17:54:53 +0100 Subject: [PATCH 065/459] lint es5 code only --- .eslintrc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.json b/.eslintrc.json index 788fcfe0..7fae8d3c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,6 +3,7 @@ "plugins": [ "standard" ], + "parserOptions": { "ecmaVersion": 5 }, "rules": { "semi": "off", "indent": ["warn", 2, { From a4644bf948d0492062a4c5aa8c9c1db486d99ecf Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 4 Feb 2018 23:35:13 +0100 Subject: [PATCH 066/459] [ci] update node versions in travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 60d00ce1..4e21f019 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: - "0.10" - - "0.8" - - "0.6" + - "4" + - "lts/*" \ No newline at end of file From 555d8511915d8527bd5e355f39f9508858fcc11a Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Thu, 8 Feb 2018 18:02:46 +0100 Subject: [PATCH 067/459] [ci] replace octal literal and don't lint on node 0.10 in travis --- .travis.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4e21f019..606dab44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,4 +2,11 @@ language: node_js node_js: - "0.10" - "4" - - "lts/*" \ No newline at end of file + - "lts/*" +script: | + if [ `node --version | cut -d . -f 1,2` = "v0.10" ]; then + sed -i s/0o755/0755/ test/index.js; + npm test; + else + npm run lint && npm test; + fi From df01551279320ddd897d9339a9dd0c18688212ee Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Thu, 8 Feb 2018 18:23:33 +0100 Subject: [PATCH 068/459] [ci] cache npm packages on travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 606dab44..b37cbfa5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,3 +10,6 @@ script: | else npm run lint && npm test; fi +cache: + directories: + - node_modules From 1dc5ab0a17e091409250747e32ebe0f12c011655 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Thu, 8 Feb 2018 20:15:53 +0100 Subject: [PATCH 069/459] drop gulp, use uglify-js3 instead. Do `npm run build` to minify into marked.min.js --- marked.min.js | 2 +- package.json | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/marked.min.js b/marked.min.js index 1883d019..da806f0f 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/chjj/marked */ -(function(){"use strict";function e(e){this.tokens=[],this.tokens.links={},this.options=e||p.defaults,this.rules=u.normal,this.options.gfm&&(this.options.tables?this.rules=u.tables:this.rules=u.gfm)}function t(e,t){if(this.options=t||p.defaults,this.links=e,this.rules=c.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=c.breaks:this.rules=c.gfm:this.options.pedantic&&(this.rules=c.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||p.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function i(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=s.source||s,s=s.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function o(e,t){return g[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?g[" "+e]=e+"/":g[" "+e]=e.replace(/[^\/]*$/,"")),e=g[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[\s\S]*/,"$1")+t:e+t}function h(){}function a(e){for(var t,n,r=1;rAn error occurred:

    "+s(c.message+"",!0)+"
    ";throw c}}var u={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:h,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:h,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:h,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};u.bullet=/(?:[*+-]|\d+\.)/,u.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,u.item=l(u.item,"gm")(/bull/g,u.bullet)(),u.list=l(u.list)(/bull/g,u.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+u.def.source+")")(),u.blockquote=l(u.blockquote)("def",u.def)(),u._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",u.html=l(u.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,u._tag)(),u.paragraph=l(u.paragraph)("hr",u.hr)("heading",u.heading)("lheading",u.lheading)("blockquote",u.blockquote)("tag","<"+u._tag)("def",u.def)(),u.normal=a({},u),u.gfm=a({},u.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),u.gfm.paragraph=l(u.paragraph)("(?!","(?!"+u.gfm.fences.source.replace("\\1","\\2")+"|"+u.list.source.replace("\\1","\\3")+"|")(),u.tables=a({},u.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=u,e.lex=function(t,n){var r=new e(n);return r.lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,n){for(var r,s,i,l,o,h,a,p,c,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),i=i[0].match(this.rules.item),r=!1,c=i.length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(h),p!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<([^ <>]+(@|:\/)[^ <>]+)>/,url:h,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:h,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,c.link=l(c.link)("inside",c._inside)("href",c._href)(),c.reflink=l(c.reflink)("inside",c._inside)(),c.normal=a({},c),c.pedantic=a({},c.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),c.gfm=a({},c.normal,{escape:l(c.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(c.text)("]|","~]|")("|","|https?://|")()}),c.breaks=a({},c.gfm,{br:l(c.br)("{2,}","*")(),text:l(c.gfm.text)("{2,}","*")()}),t.rules=c,t.output=function(e,n,r){var s=new t(n,r);return s.output(e)},t.prototype.output=function(e){for(var t,n,r,i,l="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),l+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=s(":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1])),r=this.mangle("mailto:")+n):(n=s(i[1]),r=n),l+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,l+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){l+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),l+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),l+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),l+=this.renderer.codespan(s(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),l+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),l+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),l+=this.renderer.text(s(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,l+=this.renderer.link(r,null,n);return l},t.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:s(e,!0))+"\n
    \n":"
    "+(n?e:s(e,!0))+"\n
    "},n.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"'+e+"\n"},n.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},n.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},n.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},n.prototype.paragraph=function(e){return"

    "+e+"

    \n"},n.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},n.prototype.tablerow=function(e){return"\n"+e+"\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},n.prototype.strong=function(e){return""+e+""},n.prototype.em=function(e){return""+e+""},n.prototype.codespan=function(e){return""+e+""},n.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},n.prototype.del=function(e){return""+e+""},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(i(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!f.test(e)&&(e=o(this.options.baseUrl,e));var l='
    "},n.prototype.image=function(e,t,n){this.options.baseUrl&&!f.test(e)&&(e=o(this.options.baseUrl,e));var r=''+n+'":">"},n.prototype.text=function(e){return e},r.parse=function(e,t,n){var s=new r(t,n);return s.parse(e)},r.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=this.tok();return n},r.prototype.next=function(){return this.token=this.tokens.pop()},r.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},r.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},r.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,s,i="",l="";for(n="",e=0;e ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:g,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function t(t){this.tokens=[],this.tokens.links={},this.options=t||d.defaults,this.rules=e.normal,this.options.gfm&&(this.options.tables?this.rules=e.tables:this.rules=e.gfm)}e._label=/(?:\\[\[\]]|[^\[\]])+/,e._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,e.def=a(e.def)("label",e._label)("title",e._title)(),e.bullet=/(?:[*+-]|\d+\.)/,e.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,e.item=a(e.item,"gm")(/bull/g,e.bullet)(),e.list=a(e.list)(/bull/g,e.bullet)("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))")("def","\\n+(?="+e.def.source+")")(),e._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",e.html=a(e.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/]*)*?\/?>/)(/tag/g,e._tag)(),e.paragraph=a(e.paragraph)("hr",e.hr)("heading",e.heading)("lheading",e.lheading)("tag","<"+e._tag)(),e.blockquote=a(e.blockquote)("paragraph",e.paragraph)(),e.normal=f({},e),e.gfm=f({},e.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),e.gfm.paragraph=a(e.paragraph)("(?!","(?!"+e.gfm.fences.source.replace("\\1","\\2")+"|"+e.list.source.replace("\\1","\\3")+"|")(),e.tables=f({},e.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=e,t.lex=function(e,n){return new t(n).lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(t,n){var r,s,i,l,o,h,a,p,u,c;for(t=t.replace(/^ +$/gm,"");t;)if((i=this.rules.newline.exec(t))&&(t=t.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(t))t=t.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(t))t=t.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(t))t=t.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(t))){for(t=t.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(t)){for(t=t.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(t=i.slice(p+1).join("\n")+t,p=c-1)),s=r||/\n\n(?!\s*$)/.test(h),p!==c-1&&(r="\n"===h.charAt(h.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(h,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(t))t=t.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(t)))t=t.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(t))){for(t=t.substring(i[0].length),h={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:g,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)(\s*)([\s\S]*?[^`]?)\2\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:g,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function a(e,t){return e=e.source,t=t||"",function n(r,s){return r?(s=(s=s.source||s).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,s),n):new RegExp(e,t)}}function p(e,t){return u[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?u[" "+e]=e+"/":u[" "+e]=e.replace(/[^/]*$/,"")),e=u[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}n._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,n._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,n.autolink=a(n.autolink)("scheme",n._scheme)("email",n._email)(),n._inside=/(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,n._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,n.link=a(n.link)("inside",n._inside)("href",n._href)(),n.reflink=a(n.reflink)("inside",n._inside)(),n.normal=f({},n),n.pedantic=f({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),n.gfm=f({},n.normal,{escape:a(n.escape)("])","~|])")(),url:a(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/)("email",n._email)(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:a(n.text)("]|","~]|")("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|")()}),n.breaks=f({},n.gfm,{br:a(n.br)("{2,}","*")(),text:a(n.gfm.text)("{2,}","*")()}),r.rules=n,r.output=function(e,t,n){return new r(t,n).output(e)},r.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=o(this.mangle(s[1]))):n=o(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^/i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):o(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(o(s[3].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(o(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=o(s[0])):(n=o(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},r.prototype.outputLink=function(e,t){var n=o(t.href),r=t.title?o(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,o(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},s.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:o(e,!0))+"\n
    \n":"
    "+(n?e:o(e,!0))+"\n
    "},s.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},s.prototype.html=function(e){return e},s.prototype.heading=function(e,t,n){return"'+e+"\n"},s.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},s.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},s.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},s.prototype.paragraph=function(e){return"

    "+e+"

    \n"},s.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},s.prototype.tablerow=function(e){return"\n"+e+"\n"},s.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},s.prototype.strong=function(e){return""+e+""},s.prototype.em=function(e){return""+e+""},s.prototype.codespan=function(e){return""+e+""},s.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},s.prototype.del=function(e){return""+e+""},s.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!c.test(e)&&(e=p(this.options.baseUrl,e));var s='
    "},s.prototype.image=function(e,t,n){this.options.baseUrl&&!c.test(e)&&(e=p(this.options.baseUrl,e));var r=''+n+'":">"},s.prototype.text=function(e){return e},i.prototype.strong=i.prototype.em=i.prototype.codespan=i.prototype.del=i.prototype.text=function(e){return e},i.prototype.link=i.prototype.image=function(e,t,n){return""+n},i.prototype.br=function(){return""},l.parse=function(e,t){return new l(t).parse(e)},l.prototype.parse=function(e){this.inline=new r(e.links,this.options),this.inlineText=new r(e.links,f({},this.options,{renderer:new i})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},l.prototype.next=function(){return this.token=this.tokens.pop()},l.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},l.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},l.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;eAn error occurred:

    "+o(e.message+"",!0)+"
    ";throw e}}g.exec=g,d.options=d.setOptions=function(e){return f(d.defaults,e),d},d.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new s,xhtml:!1,baseUrl:null},d.Parser=l,d.parser=l.parse,d.Renderer=s,d.TextRenderer=i,d.Lexer=t,d.lexer=t.lex,d.InlineLexer=r,d.inlineLexer=r.output,d.parse=d,"undefined"!=typeof module&&"object"==typeof exports?module.exports=d:"function"==typeof define&&define.amd?define(function(){return d}):this.marked=d}).call(function(){return this||("undefined"!=typeof window?window:global)}()); \ No newline at end of file diff --git a/package.json b/package.json index 073a5ac8..d6529886 100644 --- a/package.json +++ b/package.json @@ -28,12 +28,11 @@ "markdown-it": "*", "front-matter": "^2.3.0", "glob-to-regexp": "0.3.0", - "gulp": "^3.8.11", - "gulp-uglify": "^1.1.0", - "gulp-concat": "^2.5.2" + "uglify-js": "^3.3.10" }, "scripts": { "test": "node test", - "bench": "node test --bench" + "bench": "node test --bench", + "build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js" } } From 2a8e6f6508d788523a0210ca363d67481b42f484 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Fri, 9 Feb 2018 00:33:09 +0100 Subject: [PATCH 070/459] remove gulpfile --- Gulpfile.js | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 Gulpfile.js diff --git a/Gulpfile.js b/Gulpfile.js deleted file mode 100644 index cebc16a6..00000000 --- a/Gulpfile.js +++ /dev/null @@ -1,22 +0,0 @@ -var gulp = require('gulp'); -var uglify = require('gulp-uglify'); -var concat = require('gulp-concat'); - -var preserveFirstComment = function() { - var set = false; - - return function() { - if (set) return false; - set = true; - return true; - }; -}; - -gulp.task('uglify', function() { - gulp.src('lib/marked.js') - .pipe(uglify({preserveComments: preserveFirstComment()})) - .pipe(concat('marked.min.js')) - .pipe(gulp.dest('.')); -}); - -gulp.task('default', ['uglify']); From dd09a6862c2ef6d71860e00ea9c0b78676b8d929 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Fri, 9 Feb 2018 01:18:57 +0100 Subject: [PATCH 071/459] test the minified version with `node test --minified` --- test/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index e3741069..efd9f454 100644 --- a/test/index.js +++ b/test/index.js @@ -14,7 +14,8 @@ var fs = require('fs') , path = require('path') , fm = require('front-matter') , g2r = require('glob-to-regexp') - , marked = require('../'); + , marked = require('../') + , markedMin = require('../marked.min.js'); /** * Load Tests @@ -485,6 +486,10 @@ function parseArg(argv) { case '--time': options.time = true; break; + case '-m': + case '--minified': + options.minified = true; + break; case '--glob': arg = argv.shift(); options.glob = arg.replace(/^=/, ''); @@ -549,6 +554,9 @@ function main(argv) { return time(opt); } + if (opt.minified) { + marked = markedMin; + } return runTests(opt); } From dd855d71e746e42526d2ccc83c0f971fc52efc23 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Fri, 9 Feb 2018 01:20:50 +0100 Subject: [PATCH 072/459] update package-lock.json --- package-lock.json | 1747 +-------------------------------------------- 1 file changed, 13 insertions(+), 1734 deletions(-) diff --git a/package-lock.json b/package-lock.json index 81d14163..eb19ea26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,35 +10,12 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", - "dev": true, - "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" - } - }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, "argparse": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", @@ -48,184 +25,16 @@ "sprintf-js": "1.0.3" } }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "1.1.0" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "array-differ": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", - "dev": true - }, - "array-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", - "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", - "dev": true - }, - "array-slice": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.0.0.tgz", - "integrity": "sha1-5zA08A3MH0CHYAj9IP6ud71LfC8=", - "dev": true - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "async": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", - "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "beeper": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", - "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", - "dev": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" - } - }, - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "dev": true - }, - "center-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", - "dev": true, - "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" - } - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - } - }, - "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, - "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", - "wordwrap": "0.0.2" - } - }, - "clone": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", - "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=", - "dev": true - }, - "clone-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", - "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", - "dev": true - }, - "clone-stats": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", - "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", - "dev": true - }, - "cloneable-readable": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.0.0.tgz", - "integrity": "sha1-pikNQT8hemEjL5XkWP84QYz7ARc=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "process-nextick-args": "1.0.7", - "through2": "2.0.3" - } - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concat-with-sourcemaps": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.4.tgz", - "integrity": "sha1-9Vs74q60dgGxCi1SWcz7cP0vHdY=", - "dev": true, - "requires": { - "source-map": "0.5.7" - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "commander": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz", + "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==", "dev": true }, "cross-spawn": { @@ -251,78 +60,18 @@ } } }, - "dateformat": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", - "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=", - "dev": true - }, - "deap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/deap/-/deap-1.0.0.tgz", - "integrity": "sha1-sUi/gkMKJ2mbdIOgPra2dYW/yIg=", - "dev": true - }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "requires": { - "clone": "1.0.3" - } - }, - "deprecated": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/deprecated/-/deprecated-0.0.1.tgz", - "integrity": "sha1-+cmvVGSvoeepcUWKi97yqpTVuxk=", - "dev": true - }, - "detect-file": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-0.1.0.tgz", - "integrity": "sha1-STXe39lIhkjgBrASlWbpOGcR6mM=", - "dev": true, - "requires": { - "fs-exists-sync": "0.1.0" - } - }, - "duplexer2": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", - "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", - "dev": true, - "requires": { - "readable-stream": "1.1.14" - } - }, - "end-of-stream": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-0.1.5.tgz", - "integrity": "sha1-jhdyBsPICDfYVjLouTWd/osvbq8=", - "dev": true, - "requires": { - "once": "1.3.3" - } - }, "entities": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", "dev": true }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", @@ -344,83 +93,6 @@ "strip-eof": "1.0.0" } }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "0.1.1" - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "2.2.3" - } - }, - "expand-tilde": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz", - "integrity": "sha1-C4HrqJflo9MdHD0QL48BRB5VlEk=", - "dev": true, - "requires": { - "os-homedir": "1.0.2" - } - }, - "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", - "dev": true - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - }, - "fancy-log": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.0.tgz", - "integrity": "sha1-Rb4X0Cu5kX1gzP/UmVyZnmyMmUg=", - "dev": true, - "requires": { - "chalk": "1.1.3", - "time-stamp": "1.1.0" - } - }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, - "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", - "dev": true, - "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" - } - }, - "find-index": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz", - "integrity": "sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=", - "dev": true - }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -430,69 +102,6 @@ "locate-path": "2.0.0" } }, - "findup-sync": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.3.tgz", - "integrity": "sha1-QAQ5Kee8YK3wt/SCfExudaDeyhI=", - "dev": true, - "requires": { - "detect-file": "0.1.0", - "is-glob": "2.0.1", - "micromatch": "2.3.11", - "resolve-dir": "0.1.1" - } - }, - "fined": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.0.tgz", - "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=", - "dev": true, - "requires": { - "expand-tilde": "2.0.2", - "is-plain-object": "2.0.4", - "object.defaults": "1.1.0", - "object.pick": "1.3.0", - "parse-filepath": "1.0.1" - }, - "dependencies": { - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "1.0.1" - } - } - } - }, - "first-chunk-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", - "integrity": "sha1-Wb+1DNkF9g18OUzT2ayqtOatk04=", - "dev": true - }, - "flagged-respawn": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-0.3.2.tgz", - "integrity": "sha1-/xke3c1wiKZ1smEP/8l2vpuAdLU=", - "dev": true - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "1.0.2" - } - }, "front-matter": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-2.3.0.tgz", @@ -502,21 +111,6 @@ "js-yaml": "3.10.0" } }, - "fs-exists-sync": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", - "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=", - "dev": true - }, - "gaze": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz", - "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=", - "dev": true, - "requires": { - "globule": "0.1.0" - } - }, "get-caller-file": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", @@ -529,406 +123,18 @@ "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "dev": true }, - "glob": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", - "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "2.0.10", - "once": "1.3.3" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "2.0.1" - } - }, - "glob-stream": { - "version": "3.1.18", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", - "integrity": "sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs=", - "dev": true, - "requires": { - "glob": "4.5.3", - "glob2base": "0.0.12", - "minimatch": "2.0.10", - "ordered-read-streams": "0.1.0", - "through2": "0.6.5", - "unique-stream": "1.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - } - } - }, "glob-to-regexp": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", "dev": true }, - "glob-watcher": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz", - "integrity": "sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs=", - "dev": true, - "requires": { - "gaze": "0.5.2" - } - }, - "glob2base": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz", - "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", - "dev": true, - "requires": { - "find-index": "0.1.1" - } - }, - "global-modules": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", - "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", - "dev": true, - "requires": { - "global-prefix": "0.1.5", - "is-windows": "0.2.0" - } - }, - "global-prefix": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", - "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", - "dev": true, - "requires": { - "homedir-polyfill": "1.0.1", - "ini": "1.3.5", - "is-windows": "0.2.0", - "which": "1.3.0" - } - }, - "globule": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", - "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=", - "dev": true, - "requires": { - "glob": "3.1.21", - "lodash": "1.0.2", - "minimatch": "0.2.14" - }, - "dependencies": { - "glob": { - "version": "3.1.21", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", - "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", - "dev": true, - "requires": { - "graceful-fs": "1.2.3", - "inherits": "1.0.2", - "minimatch": "0.2.14" - } - }, - "graceful-fs": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", - "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", - "dev": true - }, - "inherits": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", - "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", - "dev": true - }, - "minimatch": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", - "dev": true, - "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" - } - } - } - }, - "glogg": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.0.tgz", - "integrity": "sha1-f+DxmfV6yQbPUS/urY+Q7kooT8U=", - "dev": true, - "requires": { - "sparkles": "1.0.0" - } - }, - "graceful-fs": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", - "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", - "dev": true, - "requires": { - "natives": "1.1.0" - } - }, - "gulp": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz", - "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=", - "dev": true, - "requires": { - "archy": "1.0.0", - "chalk": "1.1.3", - "deprecated": "0.0.1", - "gulp-util": "3.0.8", - "interpret": "1.1.0", - "liftoff": "2.3.0", - "minimist": "1.2.0", - "orchestrator": "0.3.8", - "pretty-hrtime": "1.0.3", - "semver": "4.3.6", - "tildify": "1.2.0", - "v8flags": "2.1.1", - "vinyl-fs": "0.3.14" - } - }, - "gulp-concat": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz", - "integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=", - "dev": true, - "requires": { - "concat-with-sourcemaps": "1.0.4", - "through2": "2.0.3", - "vinyl": "2.1.0" - }, - "dependencies": { - "clone": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", - "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true - }, - "vinyl": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", - "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", - "dev": true, - "requires": { - "clone": "2.1.1", - "clone-buffer": "1.0.0", - "clone-stats": "1.0.0", - "cloneable-readable": "1.0.0", - "remove-trailing-separator": "1.1.0", - "replace-ext": "1.0.0" - } - } - } - }, - "gulp-uglify": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-1.5.4.tgz", - "integrity": "sha1-UkeI2HZm0J+dDCH7IXf5ADmmWMk=", - "dev": true, - "requires": { - "deap": "1.0.0", - "fancy-log": "1.3.0", - "gulp-util": "3.0.8", - "isobject": "2.1.0", - "through2": "2.0.3", - "uglify-js": "2.6.4", - "uglify-save-license": "0.4.1", - "vinyl-sourcemaps-apply": "0.2.1" - } - }, - "gulp-util": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", - "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", - "dev": true, - "requires": { - "array-differ": "1.0.0", - "array-uniq": "1.0.3", - "beeper": "1.1.1", - "chalk": "1.1.3", - "dateformat": "2.2.0", - "fancy-log": "1.3.0", - "gulplog": "1.0.0", - "has-gulplog": "0.1.0", - "lodash._reescape": "3.0.0", - "lodash._reevaluate": "3.0.0", - "lodash._reinterpolate": "3.0.0", - "lodash.template": "3.6.2", - "minimist": "1.2.0", - "multipipe": "0.1.2", - "object-assign": "3.0.0", - "replace-ext": "0.0.1", - "through2": "2.0.3", - "vinyl": "0.5.3" - } - }, - "gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", - "dev": true, - "requires": { - "glogg": "1.0.0" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "has-gulplog": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", - "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", - "dev": true, - "requires": { - "sparkles": "1.0.0" - } - }, - "homedir-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", - "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", - "dev": true, - "requires": { - "parse-passwd": "1.0.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "1.3.3", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, - "interpret": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", - "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", - "dev": true - }, "invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", "dev": true }, - "is-absolute": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz", - "integrity": "sha1-IN5p89uULvLYe5wto28XIjWxtes=", - "dev": true, - "requires": { - "is-relative": "0.2.1", - "is-windows": "0.2.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "2.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", @@ -938,118 +144,18 @@ "number-is-nan": "1.0.1" } }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, - "is-relative": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", - "integrity": "sha1-0n9MfVFtF1+2ENuEu+7yPDvJeqU=", - "dev": true, - "requires": { - "is-unc-path": "0.1.2" - } - }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, - "is-unc-path": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-0.1.2.tgz", - "integrity": "sha1-arBTpyVzwQJQ/0FqOBTDUXivObk=", - "dev": true, - "requires": { - "unc-path-regex": "0.1.2" - } - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-windows": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", - "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - } - } - }, "js-yaml": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", @@ -1060,21 +166,6 @@ "esprima": "4.0.0" } }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true - }, "lcid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", @@ -1084,23 +175,6 @@ "invert-kv": "1.0.0" } }, - "liftoff": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.3.0.tgz", - "integrity": "sha1-qY8v9nGD2Lp8+soQVIvX/wVQs4U=", - "dev": true, - "requires": { - "extend": "3.0.1", - "findup-sync": "0.4.3", - "fined": "1.1.0", - "flagged-respawn": "0.3.2", - "lodash.isplainobject": "4.0.6", - "lodash.isstring": "4.0.1", - "lodash.mapvalues": "4.6.0", - "rechoir": "0.6.2", - "resolve": "1.5.0" - } - }, "linkify-it": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.0.3.tgz", @@ -1120,167 +194,6 @@ "path-exists": "3.0.0" } }, - "lodash": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz", - "integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=", - "dev": true - }, - "lodash._basecopy": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", - "dev": true - }, - "lodash._basetostring": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", - "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=", - "dev": true - }, - "lodash._basevalues": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", - "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=", - "dev": true - }, - "lodash._getnative": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", - "dev": true - }, - "lodash._isiterateecall": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", - "dev": true - }, - "lodash._reescape": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", - "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=", - "dev": true - }, - "lodash._reevaluate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", - "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=", - "dev": true - }, - "lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true - }, - "lodash._root": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", - "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", - "dev": true - }, - "lodash.escape": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", - "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", - "dev": true, - "requires": { - "lodash._root": "3.0.1" - } - }, - "lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", - "dev": true - }, - "lodash.isarray": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", - "dev": true - }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true - }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", - "dev": true - }, - "lodash.keys": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", - "dev": true, - "requires": { - "lodash._getnative": "3.9.1", - "lodash.isarguments": "3.1.0", - "lodash.isarray": "3.0.4" - } - }, - "lodash.mapvalues": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz", - "integrity": "sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw=", - "dev": true - }, - "lodash.restparam": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", - "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", - "dev": true - }, - "lodash.template": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", - "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", - "dev": true, - "requires": { - "lodash._basecopy": "3.0.1", - "lodash._basetostring": "3.0.1", - "lodash._basevalues": "3.0.0", - "lodash._isiterateecall": "3.0.9", - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0", - "lodash.keys": "3.1.2", - "lodash.restparam": "3.6.1", - "lodash.templatesettings": "3.1.1" - } - }, - "lodash.templatesettings": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", - "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", - "dev": true, - "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0" - } - }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true - }, - "lru-cache": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", - "dev": true - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, "markdown": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/markdown/-/markdown-0.5.0.tgz", @@ -1318,80 +231,12 @@ "mimic-fn": "1.1.0" } }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" - } - }, "mimic-fn": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", "dev": true }, - "minimatch": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", - "dev": true, - "requires": { - "brace-expansion": "1.1.8" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } - } - }, - "multipipe": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", - "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", - "dev": true, - "requires": { - "duplexer2": "0.0.2" - } - }, - "natives": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz", - "integrity": "sha1-6f+EFBimsux6SV6TmYT3jxY+bjE=", - "dev": true - }, "nopt": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.1.2.tgz", @@ -1401,15 +246,6 @@ "abbrev": "1.1.1" } }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "1.1.0" - } - }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -1425,100 +261,6 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, - "object-assign": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", - "dev": true - }, - "object.defaults": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", - "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", - "dev": true, - "requires": { - "array-each": "1.0.1", - "array-slice": "1.0.0", - "for-own": "1.0.0", - "isobject": "3.0.1" - }, - "dependencies": { - "for-own": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", - "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", - "dev": true, - "requires": { - "for-in": "1.0.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "once": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "orchestrator": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/orchestrator/-/orchestrator-0.3.8.tgz", - "integrity": "sha1-FOfp4nZPcxX7rBhOUGx6pt+UrX4=", - "dev": true, - "requires": { - "end-of-stream": "0.1.5", - "sequencify": "0.0.7", - "stream-consume": "0.1.0" - } - }, - "ordered-read-streams": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz", - "integrity": "sha1-/VZamvjrRHO6abbtijQ1LLVS8SY=", - "dev": true - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, "os-locale": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", @@ -1551,35 +293,6 @@ "p-limit": "1.1.0" } }, - "parse-filepath": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.1.tgz", - "integrity": "sha1-FZ1hVdQ5BNFsEO9piRHaHpGWm3M=", - "dev": true, - "requires": { - "is-absolute": "0.2.6", - "map-cache": "0.2.2", - "path-root": "0.1.1" - } - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" - } - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -1592,146 +305,12 @@ "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, - "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", - "dev": true - }, - "path-root": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", - "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", - "dev": true, - "requires": { - "path-root-regex": "0.1.2" - } - }, - "path-root-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", - "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", - "dev": true - }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, - "pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", - "dev": true - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true - }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, - "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", - "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "requires": { - "resolve": "1.5.0" - } - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "0.1.3" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "replace-ext": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", - "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", - "dev": true - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -1744,52 +323,6 @@ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, - "resolve": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", - "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", - "dev": true, - "requires": { - "path-parse": "1.0.5" - } - }, - "resolve-dir": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", - "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=", - "dev": true, - "requires": { - "expand-tilde": "1.2.2", - "global-modules": "0.2.3" - } - }, - "right-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", - "dev": true, - "requires": { - "align-text": "0.1.4" - } - }, - "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true - }, - "semver": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", - "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", - "dev": true - }, - "sequencify": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/sequencify/-/sequencify-0.0.7.tgz", - "integrity": "sha1-kM/xnQLgcCf9dn9erT57ldHnOAw=", - "dev": true - }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -1866,42 +399,18 @@ } } }, - "sigmund": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", - "dev": true - }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "sparkles": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", - "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", - "dev": true - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "stream-consume": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.0.tgz", - "integrity": "sha1-pB6tGm1ggc63n2WwYZAbbY89HQ8=", - "dev": true - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -1935,12 +444,6 @@ } } }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -1950,85 +453,12 @@ "ansi-regex": "2.1.1" } }, - "strip-bom": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz", - "integrity": "sha1-hbiGLzhEtabV7IRnqTWYFzo295Q=", - "dev": true, - "requires": { - "first-chunk-stream": "1.0.0", - "is-utf8": "0.2.1" - } - }, "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "dev": true, - "requires": { - "readable-stream": "2.3.3", - "xtend": "4.0.1" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" - } - }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - } - } - }, - "tildify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", - "integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=", - "dev": true, - "requires": { - "os-homedir": "1.0.2" - } - }, - "time-stamp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", - "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", - "dev": true - }, "uc.micro": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.3.tgz", @@ -2036,138 +466,23 @@ "dev": true }, "uglify-js": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.6.4.tgz", - "integrity": "sha1-ZeovswWck5RpLxX+2HwrNsFrmt8=", + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.10.tgz", + "integrity": "sha512-dNib7aUDNZFJNTXFyq0CDmLRVOsnY1F+IQgt2FAOdZFx2+LvKVLbbIb/fL+BYKCv3YH3bPCE/6M/JaxChtQLHQ==", "dev": true, "requires": { - "async": "0.2.10", - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" - } - }, - "uglify-save-license": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/uglify-save-license/-/uglify-save-license-0.4.1.tgz", - "integrity": "sha1-lXJsF8xv0XHDYX479NjYKqjEzOE=", - "dev": true - }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true - }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", - "dev": true - }, - "unique-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-1.0.0.tgz", - "integrity": "sha1-1ZpKdUJ0R9mqbJHnAmP40mpLEEs=", - "dev": true - }, - "user-home": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", - "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "v8flags": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", - "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", - "dev": true, - "requires": { - "user-home": "1.1.1" - } - }, - "vinyl": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", - "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", - "dev": true, - "requires": { - "clone": "1.0.3", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - }, - "vinyl-fs": { - "version": "0.3.14", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", - "integrity": "sha1-mmhRzhysHBzqX+hsCTHWIMLPqeY=", - "dev": true, - "requires": { - "defaults": "1.0.3", - "glob-stream": "3.1.18", - "glob-watcher": "0.0.6", - "graceful-fs": "3.0.11", - "mkdirp": "0.5.1", - "strip-bom": "1.0.0", - "through2": "0.6.5", - "vinyl": "0.4.6" + "commander": "2.14.1", + "source-map": "0.6.1" }, "dependencies": { - "clone": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", - "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - }, - "vinyl": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", - "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", - "dev": true, - "requires": { - "clone": "0.2.0", - "clone-stats": "0.0.1" - } } } }, - "vinyl-sourcemaps-apply": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", - "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", - "dev": true, - "requires": { - "source-map": "0.5.7" - } - }, "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", @@ -2183,18 +498,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true - }, - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true - }, "wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", @@ -2218,18 +521,6 @@ } } }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, "y18n": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", @@ -2242,18 +533,6 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true }, - "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", - "window-size": "0.1.0" - } - }, "yargs-parser": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.0.0.tgz", From 2e2f547e3d9e4db2dd2feba22ff80344e18abe44 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 11 Feb 2018 14:19:29 +0100 Subject: [PATCH 073/459] require node>=0.10 in package.json --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 16f887ce..2d7ef073 100644 --- a/package.json +++ b/package.json @@ -41,5 +41,8 @@ "bench": "node test --bench", "lint": "eslint --fix lib/marked.js test/index.js", "build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js" + }, + "engines": { + "node": ">=0.10.0" } } From 9fd5192b037070843b99f57c1fcea3e6d8c222ab Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 13 Feb 2018 20:01:53 +0100 Subject: [PATCH 074/459] fix test in browser. Remember to fix() beforehand. --- test/browser/index.js | 11 ++++++----- test/browser/test.js | 2 ++ test/index.js | 2 ++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/test/browser/index.js b/test/browser/index.js index d5d7ee69..8bd62bb1 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -1,8 +1,7 @@ var fs = require('fs'); -var test = require('../') - , runTests = test.runTests - , load = test.load; +var testMod = require('../') + , load = testMod.load; var express = require('express') , app = express(); @@ -28,8 +27,10 @@ app.get('/test.js', function(req, res, next) { var test = fs.readFileSync(__dirname + '/test.js', 'utf8') , files = load(); - test = test.replace('__TESTS__', JSON.stringify(files)); - test = test.replace('__MAIN__', runTests + ''); + + test = test.replace('__TESTS__', JSON.stringify(files)) + .replace('__MAIN__', testMod.runTests + '') + .replace('__LIBS__', testMod.testFile + ''); res.contentType('.js'); res.send(test); diff --git a/test/browser/test.js b/test/browser/test.js index cef9e376..54a37bc0 100644 --- a/test/browser/test.js +++ b/test/browser/test.js @@ -57,6 +57,8 @@ function escape(html, encode) { .replace(/'/g, '''); } +__LIBS__; + (__MAIN__)(); }).call(this); diff --git a/test/index.js b/test/index.js index 34df2574..994b9a8a 100644 --- a/test/index.js +++ b/test/index.js @@ -22,6 +22,7 @@ var fs = require('fs'), */ function load(options) { + options = options || {}; var dir = path.join(__dirname, 'compiled_tests'), files = {}, list, @@ -574,6 +575,7 @@ if (!module.parent) { exports = main; exports.main = main; exports.runTests = runTests; + exports.testFile = testFile; exports.runBench = runBench; exports.load = load; exports.bench = bench; From d303e16d596786cc368d77dca8552960a7ab993c Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 13 Feb 2018 20:08:48 +0100 Subject: [PATCH 075/459] [lint] lint test/browser/index.js --- test/browser/index.js | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/test/browser/index.js b/test/browser/index.js index 8bd62bb1..8820a522 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -1,10 +1,13 @@ -var fs = require('fs'); +var fs = require('fs'), + path = require('path'); -var testMod = require('../') - , load = testMod.load; +var testMod = require('../'), + load = testMod.load; -var express = require('express') - , app = express(); +var express = require('express'), + app = express(); + +var files = load(); app.use(function(req, res, next) { var setHeader = res.setHeader; @@ -20,23 +23,17 @@ app.use(function(req, res, next) { next(); }); -var dir = __dirname + '/../tests' - , files = {}; - app.get('/test.js', function(req, res, next) { - var test = fs.readFileSync(__dirname + '/test.js', 'utf8') - , files = load(); - - - test = test.replace('__TESTS__', JSON.stringify(files)) + var test = fs.readFileSync(path.join(__dirname, 'test.js'), 'utf8'); + var testScript = test.replace('__TESTS__', JSON.stringify(files)) .replace('__MAIN__', testMod.runTests + '') .replace('__LIBS__', testMod.testFile + ''); res.contentType('.js'); - res.send(test); + res.send(testScript); }); -app.use(express.static(__dirname + '/../../lib')); +app.use(express.static(path.join(__dirname, '/../../lib'))) ; app.use(express.static(__dirname)); app.listen(8080); From ad6484b90c2c6f99badbada9cab64bd399c227dc Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 13 Feb 2018 22:09:27 +0100 Subject: [PATCH 076/459] !fixup 565b4a0e5b --- lib/marked.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index cf3899e5..ca8c3143 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -4,7 +4,7 @@ * https://github.com/chjj/marked */ -;(function() { +;(function(root) { 'use strict'; /** @@ -1378,7 +1378,6 @@ if (typeof module !== 'undefined' && typeof exports === 'object') { } else if (typeof define === 'function' && define.amd) { define(function() { return marked; }); } else { - var exp = this || (typeof window !== 'undefined' ? window : global); - exp.marked = marked; + root.marked = marked; } -})(); +})(this || (typeof window !== 'undefined' ? window : global)); From a1c5862d7b89c5b645bff4220d3d7a306781da23 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 15 Feb 2018 11:28:53 -0500 Subject: [PATCH 077/459] Fix GitHub language via override --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..8f2d8c35 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +test/* linguist-vendored + From f24c6f24c077b9e2f07ee835cc2393bff98e1b89 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 15 Feb 2018 13:24:49 -0500 Subject: [PATCH 078/459] Update package.json to new GitHub repo --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d6529886..387619c4 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,10 @@ "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", - "repository": "git://github.com/chjj/marked.git", - "homepage": "https://github.com/chjj/marked", + "repository": "git://github.com/markedjs/marked.git", + "homepage": "https://github.com/markedjs/marked", "bugs": { - "url": "http://github.com/chjj/marked/issues" + "url": "http://github.com/markedjs/marked/issues" }, "license": "MIT", "keywords": [ From 343b623eac763b8e0f21ddc6a9d661854fdf7971 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 16 Feb 2018 07:30:03 -0600 Subject: [PATCH 079/459] Update repo information --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb19ea26..06f8efaf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "marked", - "version": "0.3.12", + "version": "0.3.13", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 387619c4..cf32d186 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "marked", "description": "A markdown parser built for speed", "author": "Christopher Jeffrey", - "version": "0.3.12", + "version": "0.3.13", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", From d3305a3af2e6152da625278a6d76aa8d4dbd54e5 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 16 Feb 2018 07:35:08 -0600 Subject: [PATCH 080/459] 0.3.14 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 06f8efaf..79e5885d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "marked", - "version": "0.3.13", + "version": "0.3.14", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index cf32d186..52d69a4f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "marked", "description": "A markdown parser built for speed", "author": "Christopher Jeffrey", - "version": "0.3.13", + "version": "0.3.14", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", From bed875bf4649c2b9db00f100e749b6713bd2bee1 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sun, 18 Feb 2018 19:12:40 -0600 Subject: [PATCH 081/459] revert number of capturing parens in #1013 fixes #1059 --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index e5c27514..b6828d9f 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -468,7 +468,7 @@ var inline = { nolink: /^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/, strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, em: /^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/, - code: /^(`+)(\s*)([\s\S]*?[^`]?)\2\1(?!`)/, + code: /^(`+)(?:\s*)([\s\S]*?[^`]?)(?:\s*)\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, del: noop, text: /^[\s\S]+?(?=[\\ Date: Sun, 18 Feb 2018 19:32:34 -0600 Subject: [PATCH 082/459] remove parens --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index b6828d9f..69b0e05e 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -468,7 +468,7 @@ var inline = { nolink: /^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/, strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, em: /^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/, - code: /^(`+)(?:\s*)([\s\S]*?[^`]?)(?:\s*)\1(?!`)/, + code: /^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, del: noop, text: /^[\s\S]+?(?=[\\ Date: Sun, 18 Feb 2018 22:19:37 -0600 Subject: [PATCH 083/459] Update read me with TOC & other changes --- LICENSE | 14 ++++++++ README.md | 103 +++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 84 insertions(+), 33 deletions(-) diff --git a/LICENSE b/LICENSE index a7b812ed..020db880 100644 --- a/LICENSE +++ b/LICENSE @@ -17,3 +17,17 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +## Markdown + +Copyright © 2004, John Gruber +http://daringfireball.net/ +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +* Neither the name “Markdown” nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. diff --git a/README.md b/README.md index 94ab0b90..e6e769f9 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,40 @@ [![NPM version](https://badge.fury.io/js/marked.svg)][badge] -## Install +
    + +

    Philosophy behind marked

    + +The point of marked was to create a markdown compiler where it was possible to +frequently parse huge chunks of markdown without having to worry about +caching the compiled output somehow...or blocking for an unnecessarily long time. + +marked is very concise and still implements all markdown features. It is also +now fully compatible with the client-side. + +marked more or less passes the official markdown test suite in its +entirety. This is important because a surprising number of markdown compilers +cannot pass more than a few tests. It was very difficult to get marked as +compliant as it is. It could have cut corners in several areas for the sake +of performance, but did not in order to be exactly what you expect in terms +of a markdown rendering. In fact, this is why marked could be considered at a +disadvantage in the benchmarks. + +Along with implementing every markdown feature, marked also implements [GFM +features][gfmf]. + +

    Install

    ``` bash npm install marked --save @@ -17,7 +50,7 @@ or if you want to use the `marked` CLI tool (not necessary when using npm run-sc npm install -g marked ``` -## Usage +

    Usage

    Minimal usage: @@ -66,7 +99,7 @@ console.log(marked('I am using __markdown__.')); ``` -## marked(markdownString [,options] [,callback]) +

    marked(markdownString [,options] [,callback])

    ### markdownString @@ -89,7 +122,7 @@ Function called when the `markdownString` has been fully parsed when using async highlighting. If the `options` argument is omitted, this can be used as the second argument. -## Options +

    Options

    ### highlight @@ -282,7 +315,7 @@ Default: `false` Self-close the tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML. -## Access to lexer and parser +

    Access to lexer and parser

    You also have direct access to the lexer and parser if you so desire. @@ -298,7 +331,7 @@ console.log(tokens); console.log(lexer.rules); ``` -## CLI +

    CLI

    ``` bash $ marked -o hello.html @@ -308,27 +341,7 @@ $ cat hello.html

    hello world

    ``` -## Philosophy behind marked - -The point of marked was to create a markdown compiler where it was possible to -frequently parse huge chunks of markdown without having to worry about -caching the compiled output somehow...or blocking for an unnecessarily long time. - -marked is very concise and still implements all markdown features. It is also -now fully compatible with the client-side. - -marked more or less passes the official markdown test suite in its -entirety. This is important because a surprising number of markdown compilers -cannot pass more than a few tests. It was very difficult to get marked as -compliant as it is. It could have cut corners in several areas for the sake -of performance, but did not in order to be exactly what you expect in terms -of a markdown rendering. In fact, this is why marked could be considered at a -disadvantage in the benchmarks. - -Along with implementing every markdown feature, marked also implements [GFM -features][gfmf]. - -## Benchmarks +

    Benchmarks

    node v8.9.4 @@ -369,10 +382,12 @@ $ node links: {} ] ``` -## Running Tests & Contributing +

    Contributing

    -If you want to submit a pull request, make sure your changes pass the test -suite. If you're adding a new feature, be sure to add your own test. +1. If the code in a pull request can have a test written for it, it should have it. (If the test already exists, please reference the test which should pass.) +2. Do not merge your own. Mainly for collaborators and owners, please do not review and merge your own PRs. + +### Tests The marked test suite is set up slightly strangely: `test/new` is for all tests that are not part of the original markdown.pl test suite (this is where your @@ -396,17 +411,39 @@ To run the tests: npm run test ``` -### Contribution and License Agreement +### Contribution License Agreement If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work. `` -## License +

    Releasing

    + +**Master is alwasys shippable:** We try to merge PRs in such a way that `master` is the only branch to really be concerned about *and* `master` can always be released. This allows smoother flow between new fetures, bug fixes, and so on. (Almost a continuous deployment setup, without automation.) + +**Version naming:** relatively standard [major].[minor].[patch] where `major` releases represent known breaking changes to the previous release, `minor` represent additions of new funcitonality without breaking changes, and `patch` releases represent changes meant to fix previously released functionality with no new functionality. Note: When the major is a zero, it means the library is still in a beta state wherein the `major` does not get updated; therefore, `minor` releases may introduce breaking changes, and `patch` releases may contain new features. + +**Release process:** + +1. Check out library +2. Make sure you are on the `master` branch +3. Fork from `master` to create a release branch +4. `$ npm run build` (builds minified version and whatnot) +5. `$ npm version [major|minor|patch]` (updates `package.json`) +6. `$ npm publish` (publishes package to NPM) +7. Submit PR +8. Merge PR (only time where submitter should be "allowed" to merge his or her own) +9. Navigate to the "Releases" tab on the project main page -> "Draft new release" +10. Add version number matching the one in the `package.json` file after publishing the release +11. Make sure `master` is the branch from which the release will be made +12. Add notes regarding what users should expect from the release +13. Click "Publish release" + +

    License

    Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) -See LICENSE for more info. +See [LICENSE](https://github.com/markedjs/marked/blob/master/LICENSE) for more details. [gfm]: https://help.github.com/articles/github-flavored-markdown [gfmf]: http://github.github.com/github-flavored-markdown/ From 170ab8c2c3309ada59130c43edd972a985751f63 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 18 Feb 2018 22:22:20 -0600 Subject: [PATCH 084/459] typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e6e769f9..9db5cb54 100644 --- a/README.md +++ b/README.md @@ -419,7 +419,7 @@ all code is your original work. ``

    Releasing

    -**Master is alwasys shippable:** We try to merge PRs in such a way that `master` is the only branch to really be concerned about *and* `master` can always be released. This allows smoother flow between new fetures, bug fixes, and so on. (Almost a continuous deployment setup, without automation.) +**Master is always shippable:** We try to merge PRs in such a way that `master` is the only branch to really be concerned about *and* `master` can always be released. This allows smoother flow between new fetures, bug fixes, and so on. (Almost a continuous deployment setup, without automation.) **Version naming:** relatively standard [major].[minor].[patch] where `major` releases represent known breaking changes to the previous release, `minor` represent additions of new funcitonality without breaking changes, and `patch` releases represent changes meant to fix previously released functionality with no new functionality. Note: When the major is a zero, it means the library is still in a beta state wherein the `major` does not get updated; therefore, `minor` releases may introduce breaking changes, and `patch` releases may contain new features. @@ -427,7 +427,7 @@ all code is your original work. `` 1. Check out library 2. Make sure you are on the `master` branch -3. Fork from `master` to create a release branch +3. Create release branch from `master` 4. `$ npm run build` (builds minified version and whatnot) 5. `$ npm version [major|minor|patch]` (updates `package.json`) 6. `$ npm publish` (publishes package to NPM) From 225c7a681b515c8d27cdba02957195b05f727b6e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 18 Feb 2018 22:26:02 -0600 Subject: [PATCH 085/459] 0.3.15 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 79e5885d..264eb466 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "marked", - "version": "0.3.14", + "version": "0.3.15", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 52d69a4f..4b1faf8d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "marked", "description": "A markdown parser built for speed", "author": "Christopher Jeffrey", - "version": "0.3.14", + "version": "0.3.15", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", From d856fba8bfeb3ce79ab71de926d067ddeecb0762 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 19 Feb 2018 14:42:20 -0600 Subject: [PATCH 086/459] Publish lifecycle --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b1faf8d..ee8820bc 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "scripts": { "test": "node test", "bench": "node test --bench", - "build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js" + "build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js", + "preversion": "npm run build" } } From c6114e81d3f9e5eac7a19dd36b1d6148f627ec4c Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 19 Feb 2018 15:13:29 -0600 Subject: [PATCH 087/459] Create file for releasing instructions --- RELEASE.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..f6789e52 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,31 @@ +# Releasing Marked + +## Versioning + +We follow [semantic versioning](https://semver.org) where the following sequence is true `[major].[minor].[patch]` (further, while in beta you may see something like this `0.[major|minor].[minor|patch]`). Therefore, consider the following implications of the relase you are preparing: + +1. **Major:** There is at least one change that has been made which is not deemed as backward compatible. While in beta, the major will remain at zero; thereby, alterting consumers to the potentially volatile nature of the package. +2. **Minor:** There is at least one new feature added to the release. While in beta, the minor will tend be more analagous to a `major` release. For example, we plan to release `0.4.0` once we have fixed most, if not all, known issues related to the CommonMark and GFM specifications because the architecture changes planned during `0.4.0` will most likely introduce breaking changes. +3. **Patch:** No breaking changes. Should fix a defect found in a feature. While in beta, the patch will tend to be more analagous to a `minor` release. + +## Release process + +**Master is always shippable:** We try to merge PRs in such a way that `master` is the only branch to really be concerned about *and* `master` can always be released. This allows smoother flow between new fetures, bug fixes, and so on. (Almost a continuous deployment setup, without automation.) + +**Version naming:** relatively standard [major].[minor].[patch] where `major` releases represent known breaking changes to the previous release, `minor` represent additions of new funcitonality without breaking changes, and `patch` releases represent changes meant to fix previously released functionality with no new functionality. Note: When the major is a zero, it means the library is still in a beta state wherein the `major` does not get updated; therefore, `minor` releases may introduce breaking changes, and `patch` releases may contain new features. + +### Release process + +- [ ] Fork `markedjs/marked` -> clone the library locally +- [ ] Make sure you are on the `master` branch +- [ ] Create release branch from `master` (`release-##.##.##`) +- [ ] Run tests using NPM command: `$ npm test` +- [ ] Run NPM command to update `package.json` version: `$ npm version [major|minor|patch]` (updates `package.json` and creates `min` file) +- [ ] Publish pack to NPM: `$ npm publish` +- [ ] Commit changes locally -> Submit PR to `origina/master` +- [ ] Merge PR (only time where submitter should be "allowed" to merge his or her own) +- [ ] Navigate to the "Releases" tab on the project main page -> "Draft new release" + - Add version number matching the one in the `package.json` file after publishing the release + - Make sure `master` is the branch from which the release will be made + - Add notes regarding what users should expect from the release + - Click "Publish release" \ No newline at end of file From 54f5936825b30cb93b8c517c87c6b29d20cd9a25 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 19 Feb 2018 15:27:02 -0600 Subject: [PATCH 088/459] Updating checklist --- RELEASE.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index f6789e52..469398c1 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -16,14 +16,12 @@ We follow [semantic versioning](https://semver.org) where the following sequence ### Release process -- [ ] Fork `markedjs/marked` -> clone the library locally -- [ ] Make sure you are on the `master` branch +- [ ] Fork `markedjs/marked` -> clone the library locally -> Make sure you are on the `master` branch - [ ] Create release branch from `master` (`release-##.##.##`) -- [ ] Run tests using NPM command: `$ npm test` -- [ ] Run NPM command to update `package.json` version: `$ npm version [major|minor|patch]` (updates `package.json` and creates `min` file) -- [ ] Publish pack to NPM: `$ npm publish` -- [ ] Commit changes locally -> Submit PR to `origina/master` -- [ ] Merge PR (only time where submitter should be "allowed" to merge his or her own) +- [ ] `$ npm test` (run tests) +- [ ] `$ npm version [major|minor|patch]` (updates `package.json` and creates `min` file) +- [ ] `$ npm publish` (publish to NPM) +- [ ] Commit changes locally -> Submit PR to `origina/master` -> Merge PR - [ ] Navigate to the "Releases" tab on the project main page -> "Draft new release" - Add version number matching the one in the `package.json` file after publishing the release - Make sure `master` is the branch from which the release will be made From df8c1fe033b101af5a8201846c763a81f089650a Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 19 Feb 2018 15:28:49 -0600 Subject: [PATCH 089/459] Make 3 NPM commands sub-bullets --- RELEASE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 469398c1..f7d94bd6 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -18,9 +18,9 @@ We follow [semantic versioning](https://semver.org) where the following sequence - [ ] Fork `markedjs/marked` -> clone the library locally -> Make sure you are on the `master` branch - [ ] Create release branch from `master` (`release-##.##.##`) -- [ ] `$ npm test` (run tests) -- [ ] `$ npm version [major|minor|patch]` (updates `package.json` and creates `min` file) -- [ ] `$ npm publish` (publish to NPM) + - `$ npm test` (run tests) + - `$ npm version [major|minor|patch]` (updates `package.json` and creates `min` file) + - `$ npm publish` (publish to NPM) - [ ] Commit changes locally -> Submit PR to `origina/master` -> Merge PR - [ ] Navigate to the "Releases" tab on the project main page -> "Draft new release" - Add version number matching the one in the `package.json` file after publishing the release From dbf5e43a65d2fab378dfd29e248a189bf984465e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 19 Feb 2018 15:30:38 -0600 Subject: [PATCH 090/459] Moving content around a bit --- RELEASE.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index f7d94bd6..c99b1c4f 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,5 +1,7 @@ # Releasing Marked +**Master is always shippable:** We try to merge PRs in such a way that `master` is the only branch to really be concerned about *and* `master` can always be released. This allows smoother flow between new fetures, bug fixes, and so on. (Almost a continuous deployment setup, without automation.) + ## Versioning We follow [semantic versioning](https://semver.org) where the following sequence is true `[major].[minor].[patch]` (further, while in beta you may see something like this `0.[major|minor].[minor|patch]`). Therefore, consider the following implications of the relase you are preparing: @@ -10,12 +12,6 @@ We follow [semantic versioning](https://semver.org) where the following sequence ## Release process -**Master is always shippable:** We try to merge PRs in such a way that `master` is the only branch to really be concerned about *and* `master` can always be released. This allows smoother flow between new fetures, bug fixes, and so on. (Almost a continuous deployment setup, without automation.) - -**Version naming:** relatively standard [major].[minor].[patch] where `major` releases represent known breaking changes to the previous release, `minor` represent additions of new funcitonality without breaking changes, and `patch` releases represent changes meant to fix previously released functionality with no new functionality. Note: When the major is a zero, it means the library is still in a beta state wherein the `major` does not get updated; therefore, `minor` releases may introduce breaking changes, and `patch` releases may contain new features. - -### Release process - - [ ] Fork `markedjs/marked` -> clone the library locally -> Make sure you are on the `master` branch - [ ] Create release branch from `master` (`release-##.##.##`) - `$ npm test` (run tests) From 080d473a64ca714f3e2a9c998cfb980f6fd23856 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 19 Feb 2018 15:35:06 -0600 Subject: [PATCH 091/459] Ediitng --- RELEASE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index c99b1c4f..18540572 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -4,10 +4,10 @@ ## Versioning -We follow [semantic versioning](https://semver.org) where the following sequence is true `[major].[minor].[patch]` (further, while in beta you may see something like this `0.[major|minor].[minor|patch]`). Therefore, consider the following implications of the relase you are preparing: +We follow [semantic versioning](https://semver.org) where the following sequence is true `[major].[minor].[patch]` (further, while in beta, you may see this `0.[major|minor].[minor|patch]`); therefore, consider the following implications of the release you are preparing: -1. **Major:** There is at least one change that has been made which is not deemed as backward compatible. While in beta, the major will remain at zero; thereby, alterting consumers to the potentially volatile nature of the package. -2. **Minor:** There is at least one new feature added to the release. While in beta, the minor will tend be more analagous to a `major` release. For example, we plan to release `0.4.0` once we have fixed most, if not all, known issues related to the CommonMark and GFM specifications because the architecture changes planned during `0.4.0` will most likely introduce breaking changes. +1. **Major:** There is at least one change not deemed backward compatible. While in beta, the major will remain at zero; thereby, alerting consumers to the potentially volatile nature of the package. +2. **Minor:** There is at least one new feature added to the release. While in beta, the minor will tend to be more analagous to a `major` release. For example, we plan to release `0.4.0` once we have fixed most, if not all, known issues related to the CommonMark and GFM specifications because the architecture changes planned during `0.4.0` will most likely introduce breaking changes. 3. **Patch:** No breaking changes. Should fix a defect found in a feature. While in beta, the patch will tend to be more analagous to a `minor` release. ## Release process From 794d94494bcd2376803a79f99149fd0d89ed539d Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 19 Feb 2018 15:52:59 -0600 Subject: [PATCH 092/459] Fix typo --- RELEASE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE.md b/RELEASE.md index 18540572..4da0981b 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -17,7 +17,7 @@ We follow [semantic versioning](https://semver.org) where the following sequence - `$ npm test` (run tests) - `$ npm version [major|minor|patch]` (updates `package.json` and creates `min` file) - `$ npm publish` (publish to NPM) -- [ ] Commit changes locally -> Submit PR to `origina/master` -> Merge PR +- [ ] Commit changes locally -> Submit PR to `origin/master` -> Merge PR - [ ] Navigate to the "Releases" tab on the project main page -> "Draft new release" - Add version number matching the one in the `package.json` file after publishing the release - Make sure `master` is the branch from which the release will be made From 3670bfaac31b7a7296bf818ffa137e264e9eeffd Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 19 Feb 2018 16:33:04 -0600 Subject: [PATCH 093/459] Create PR Template and update RELEASE based on feedback --- .github/PULL_REQUEST_TEMPLATE.md | 25 +++++++++++++++++++++++++ RELEASE.md | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..2b3fd952 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,25 @@ +## Description + + + +- Fixes #### +- Fixes list issues fixed by this PR +- Fixes will automatically close them once merged + +## Review + +### Submitter + +- [ ] All tests pass (CI should take care of this, once in place). +- [ ] All lint checks pass (CI should take care of this, once in place). +- Tests + - [ ] Test(s) exist to ensure functionaly works (if no new tests added, list which tests cover this funcitonality). + - [ ] No tests required for this PR. +- If release: + - [ ] Version in `package.json` has been updated (see [RELEASE.md](RELEASE.md)). + - [ ] The `marked.min.js` has been updated; or, + - [ ] release does not change library. + +### Reviewer + +?? \ No newline at end of file diff --git a/RELEASE.md b/RELEASE.md index 4da0981b..7042562e 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -18,6 +18,8 @@ We follow [semantic versioning](https://semver.org) where the following sequence - `$ npm version [major|minor|patch]` (updates `package.json` and creates `min` file) - `$ npm publish` (publish to NPM) - [ ] Commit changes locally -> Submit PR to `origin/master` -> Merge PR + - `package.json` should, at minimum, have an updated version number. + - If the release contains changes to the library (most likely) you should also see a new `marked.min.js` file. - [ ] Navigate to the "Releases" tab on the project main page -> "Draft new release" - Add version number matching the one in the `package.json` file after publishing the release - Make sure `master` is the branch from which the release will be made From ad98c9805840a8254feba8b40930e54b6f0fb295 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 19 Feb 2018 16:36:35 -0600 Subject: [PATCH 094/459] Typos and allowing for no release PRs --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2b3fd952..7ac34287 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -13,9 +13,9 @@ - [ ] All tests pass (CI should take care of this, once in place). - [ ] All lint checks pass (CI should take care of this, once in place). - Tests - - [ ] Test(s) exist to ensure functionaly works (if no new tests added, list which tests cover this funcitonality). + - [ ] Test(s) exist to ensure functionality works (if no new tests added, list which tests cover this functionality). - [ ] No tests required for this PR. -- If release: +- [ ] Is release: - [ ] Version in `package.json` has been updated (see [RELEASE.md](RELEASE.md)). - [ ] The `marked.min.js` has been updated; or, - [ ] release does not change library. From c776966daf3fe27b142bcab5c61f2d52c7d7e45f Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 20 Feb 2018 16:06:58 -0600 Subject: [PATCH 095/459] Fix relative link in PR Template --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7ac34287..d81854e9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,7 +16,7 @@ - [ ] Test(s) exist to ensure functionality works (if no new tests added, list which tests cover this functionality). - [ ] No tests required for this PR. - [ ] Is release: - - [ ] Version in `package.json` has been updated (see [RELEASE.md](RELEASE.md)). + - [ ] Version in `package.json` has been updated (see [RELEASE.md](https://github.com/markedjs/marked/blob/master/RELEASE.md)). - [ ] The `marked.min.js` has been updated; or, - [ ] release does not change library. From 484698d399ecfe1cdfdb4ade03a1be1ca49ba3b5 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 24 Feb 2018 11:28:23 -0500 Subject: [PATCH 096/459] Initial commit --- .github/PULL_REQUEST_TEMPLATE.md | 34 +++++++++++++++++++----- .github/PULL_REQUEST_TEMPLATE/release.md | 1 + 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE/release.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d81854e9..7086a658 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,17 +1,36 @@ + + + ## Description - +- Fixes #### (if fixing a known issue; otherwise, describe issue using the following format) -- Fixes #### -- Fixes list issues fixed by this PR -- Fixes will automatically close them once merged + ## Review ### Submitter -- [ ] All tests pass (CI should take care of this, once in place). -- [ ] All lint checks pass (CI should take care of this, once in place). - Tests - [ ] Test(s) exist to ensure functionality works (if no new tests added, list which tests cover this functionality). - [ ] No tests required for this PR. @@ -22,4 +41,7 @@ ### Reviewer +- [ ] All tests pass (remove once CI is in place). +- [ ] All lint checks pass (remove once CI is in place). + ?? \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md new file mode 100644 index 00000000..47b7ef38 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -0,0 +1 @@ +release.md \ No newline at end of file From dfe3d1d3be76744f7496999006b3cf722e428604 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 25 Feb 2018 04:49:50 +0100 Subject: [PATCH 097/459] [ci] add latest node stable to travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b37cbfa5..f4352ddf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ node_js: - "0.10" - "4" - "lts/*" + - "node" script: | if [ `node --version | cut -d . -f 1,2` = "v0.10" ]; then sed -i s/0o755/0755/ test/index.js; From 912ebfb2817a1ee7b16a74beab0c8cea730b87ab Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 24 Feb 2018 23:42:58 -0500 Subject: [PATCH 098/459] Separate default PR and release PR --- .github/PULL_REQUEST_TEMPLATE.md | 18 ++++++------------ .github/PULL_REQUEST_TEMPLATE/release.md | 14 +++++++++++++- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7086a658..0393665c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,10 +1,11 @@ ## Description @@ -31,17 +32,10 @@ Describe what code combination got you there ### Submitter -- Tests - - [ ] Test(s) exist to ensure functionality works (if no new tests added, list which tests cover this functionality). - - [ ] No tests required for this PR. -- [ ] Is release: - - [ ] Version in `package.json` has been updated (see [RELEASE.md](https://github.com/markedjs/marked/blob/master/RELEASE.md)). - - [ ] The `marked.min.js` has been updated; or, - - [ ] release does not change library. - +- [ ] Test(s) exist to ensure functionality works (if no new tests added, list which tests cover this functionality); or, +- [ ] no tests required for this PR. + ### Reviewer - [ ] All tests pass (remove once CI is in place). -- [ ] All lint checks pass (remove once CI is in place). - -?? \ No newline at end of file +- [ ] All lint checks pass (remove once CI is in place). \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index 47b7ef38..6229a6fe 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -1 +1,13 @@ -release.md \ No newline at end of file +## Submitter + +- [ ] `$ npm version` has been run. +- [ ] Reviewer checklist is complete. +- [ ] `$ npm publish` has been run. + +## Reviewer + +- [ ] Version in `package.json` has been updated (see [RELEASE.md](https://github.com/markedjs/marked/blob/master/RELEASE.md)). +- [ ] The `marked.min.js` has been updated; or, +- [ ] release does not change library. +- [ ] All tests pass (remove once CI is in place). +- [ ] All lint checks pass (remove once CI is in place). From 9f8b33713341fd04683e4e8adef8e2e28dbeff49 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 00:06:43 -0500 Subject: [PATCH 099/459] Modify test passing criteria --- .github/PULL_REQUEST_TEMPLATE.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0393665c..7d144dbe 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -28,14 +28,12 @@ Describe what code combination got you there --> -## Review - -### Submitter +## Submitter - [ ] Test(s) exist to ensure functionality works (if no new tests added, list which tests cover this functionality); or, - [ ] no tests required for this PR. -### Reviewer +## Reviewer -- [ ] All tests pass (remove once CI is in place). +- [ ] case_insensitive_refs is only failing test (remove once CI is in place and all tests pass). - [ ] All lint checks pass (remove once CI is in place). \ No newline at end of file From ac73e2851f6f28099bf32abd0a88832101b85d27 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 00:19:16 -0500 Subject: [PATCH 100/459] Add marked version to default PR and ISSUE template --- .github/ISSUE_TEMPLATE.md | 4 ++++ .github/PULL_REQUEST_TEMPLATE.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 27fbcc1a..83a443ba 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,3 +1,7 @@ +**Marked version:** + + + ## Expectation diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7d144dbe..a497e616 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,6 +8,10 @@ --> +**Marked version:** + + + ## Description - Fixes #### (if fixing a known issue; otherwise, describe issue using the following format) From effe933e837b50450b4e656982e55c3568f63d61 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 11:41:18 -0500 Subject: [PATCH 101/459] NPM publish and prepare next release come last --- .github/PULL_REQUEST_TEMPLATE/release.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index 6229a6fe..0067d710 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -2,7 +2,10 @@ - [ ] `$ npm version` has been run. - [ ] Reviewer checklist is complete. +- [ ] Merge PR. +- [ ] Publish GitHub release using `master` with correct version number. - [ ] `$ npm publish` has been run. +- [ ] Create draft GitHub release to prepare next release. ## Reviewer From 245fe2c2354f30ac407971eb4047c3cb18a25d7f Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 11:44:10 -0500 Subject: [PATCH 102/459] Add minify commit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ee8820bc..1bf7db68 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,6 @@ "test": "node test", "bench": "node test --bench", "build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js", - "preversion": "npm run build" + "preversion": "npm run build && (git diff --quiet || git commit -am 'minify')" } } From f9c036d1a9799983690c4dc8ab023fa97e80f13b Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 11:47:51 -0500 Subject: [PATCH 103/459] minify --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index 2628ed4a..ac09b88a 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/chjj/marked */ -!function(){"use strict";var e={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:g,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:g,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:g,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function t(t){this.tokens=[],this.tokens.links={},this.options=t||d.defaults,this.rules=e.normal,this.options.gfm&&(this.options.tables?this.rules=e.tables:this.rules=e.gfm)}e._label=/(?:\\[\[\]]|[^\[\]])+/,e._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,e.def=h(e.def).replace("label",e._label).replace("title",e._title).getRegex(),e.bullet=/(?:[*+-]|\d+\.)/,e.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,e.item=h(e.item,"gm").replace(/bull/g,e.bullet).getRegex(),e.list=h(e.list).replace(/bull/g,e.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+e.def.source+")").getRegex(),e._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",e.html=h(e.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/]*)*?\/?>/).replace(/tag/g,e._tag).getRegex(),e.paragraph=h(e.paragraph).replace("hr",e.hr).replace("heading",e.heading).replace("lheading",e.lheading).replace("tag","<"+e._tag).getRegex(),e.blockquote=h(e.blockquote).replace("paragraph",e.paragraph).getRegex(),e.normal=f({},e),e.gfm=f({},e.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),e.gfm.paragraph=h(e.paragraph).replace("(?!","(?!"+e.gfm.fences.source.replace("\\1","\\2")+"|"+e.list.source.replace("\\1","\\3")+"|").getRegex(),e.tables=f({},e.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=e,t.lex=function(e,n){return new t(n).lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(t,n){var r,s,i,l,o,a,h,p,u,c;for(t=t.replace(/^ +$/gm,"");t;)if((i=this.rules.newline.exec(t))&&(t=t.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(t))t=t.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(t))t=t.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(t))t=t.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(t))){for(t=t.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(t)){for(t=t.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(t=i.slice(p+1).join("\n")+t,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(t))t=t.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(t)))t=t.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(t))){for(t=t.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:g,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)(\s*)([\s\S]*?[^`]?)\2\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:g,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function h(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function p(e,t){return u[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?u[" "+e]=e+"/":u[" "+e]=e.replace(/[^/]*$/,"")),e=u[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}n._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,n._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,n.autolink=h(n.autolink).replace("scheme",n._scheme).replace("email",n._email).getRegex(),n._inside=/(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,n._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,n.link=h(n.link).replace("inside",n._inside).replace("href",n._href).getRegex(),n.reflink=h(n.reflink).replace("inside",n._inside).getRegex(),n.normal=f({},n),n.pedantic=f({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),n.gfm=f({},n.normal,{escape:h(n.escape).replace("])","~|])").getRegex(),url:h(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",n._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:h(n.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),n.breaks=f({},n.gfm,{br:h(n.br).replace("{2,}","*").getRegex(),text:h(n.gfm.text).replace("{2,}","*").getRegex()}),r.rules=n,r.output=function(e,t,n){return new r(t,n).output(e)},r.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=o(this.mangle(s[1]))):n=o(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^/i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):o(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(o(s[3].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(o(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=o(s[0])):(n=o(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},r.prototype.outputLink=function(e,t){var n=o(t.href),r=t.title?o(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,o(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},s.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:o(e,!0))+"\n
    \n":"
    "+(n?e:o(e,!0))+"\n
    "},s.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},s.prototype.html=function(e){return e},s.prototype.heading=function(e,t,n){return"'+e+"\n"},s.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},s.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},s.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},s.prototype.paragraph=function(e){return"

    "+e+"

    \n"},s.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},s.prototype.tablerow=function(e){return"\n"+e+"\n"},s.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},s.prototype.strong=function(e){return""+e+""},s.prototype.em=function(e){return""+e+""},s.prototype.codespan=function(e){return""+e+""},s.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},s.prototype.del=function(e){return""+e+""},s.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(a(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!c.test(e)&&(e=p(this.options.baseUrl,e));var s='
    "},s.prototype.image=function(e,t,n){this.options.baseUrl&&!c.test(e)&&(e=p(this.options.baseUrl,e));var r=''+n+'":">"},s.prototype.text=function(e){return e},i.prototype.strong=i.prototype.em=i.prototype.codespan=i.prototype.del=i.prototype.text=function(e){return e},i.prototype.link=i.prototype.image=function(e,t,n){return""+n},i.prototype.br=function(){return""},l.parse=function(e,t){return new l(t).parse(e)},l.prototype.parse=function(e){this.inline=new r(e.links,this.options),this.inlineText=new r(e.links,f({},this.options,{renderer:new i})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},l.prototype.next=function(){return this.token=this.tokens.pop()},l.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},l.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},l.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,a(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;eAn error occurred:

    "+o(e.message+"",!0)+"
    ";throw e}}if(g.exec=g,d.options=d.setOptions=function(e){return f(d.defaults,e),d},d.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new s,xhtml:!1,baseUrl:null},d.Parser=l,d.parser=l.parse,d.Renderer=s,d.TextRenderer=i,d.Lexer=t,d.lexer=t.lex,d.InlineLexer=r,d.inlineLexer=r.output,d.parse=d,"undefined"!=typeof module&&"object"==typeof exports)module.exports=d;else if("function"==typeof define&&define.amd)define(function(){return d});else{(this||("undefined"!=typeof window?window:global)).marked=d}}(); \ No newline at end of file +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||k.defaults,this.rules=t.normal,this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",t.html=p(t.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/]*)*?\/?>/).replace(/tag/g,t._tag).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag","<"+t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._inside=/(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,r._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=p(r.link).replace("inside",r._inside).replace("href",r._href).getRegex(),r.reflink=p(r.reflink).replace("inside",r._inside).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=a(this.mangle(s[1]))):n=a(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):a(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(a(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(a(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=a(s[0])):(n=a(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},s.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:a(e,!0))+"\n
    \n":"
    "+(n?e:a(e,!0))+"\n
    "},i.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"'+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var s='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;eAn error occurred:

    "+a(e.message+"",!0)+"
    ";throw e}}f.exec=f,k.options=k.setOptions=function(e){return d(k.defaults,e),k},k.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1,baseUrl:null},k.Parser=o,k.parser=o.parse,k.Renderer=i,k.TextRenderer=l,k.Lexer=n,k.lexer=n.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.parse=k,"undefined"!=typeof module&&"object"==typeof exports?module.exports=k:"function"==typeof define&&define.amd?define(function(){return k}):e.marked=k}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file From d36aea0ca65f3ab32e79da96fb41a173683393a5 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 11:47:52 -0500 Subject: [PATCH 104/459] 0.3.16 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 29c77207..2a83d940 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "marked", - "version": "0.3.15", + "version": "0.3.16", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 43eed341..fa76b9e1 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "marked", "description": "A markdown parser built for speed", "author": "Christopher Jeffrey", - "version": "0.3.15", + "version": "0.3.16", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", From 5f86cbebcb1068ef08467924a193884e913dd065 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 11:48:28 -0500 Subject: [PATCH 105/459] 0.3.17 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2a83d940..311e5da5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "marked", - "version": "0.3.16", + "version": "0.3.17", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fa76b9e1..5bebfb31 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "marked", "description": "A markdown parser built for speed", "author": "Christopher Jeffrey", - "version": "0.3.16", + "version": "0.3.17", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", From c195d7fe9287ce63b09817d973f853055d173dd6 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 12:06:27 -0500 Subject: [PATCH 106/459] Draft GitHub releases part of checklists --- .github/PULL_REQUEST_TEMPLATE.md | 1 + .github/PULL_REQUEST_TEMPLATE/release.md | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a497e616..c362b350 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -39,5 +39,6 @@ Describe what code combination got you there ## Reviewer +- [ ] Draft GitHub release notes have been updated. - [ ] case_insensitive_refs is only failing test (remove once CI is in place and all tests pass). - [ ] All lint checks pass (remove once CI is in place). \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index 0067d710..2ff16a76 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -1,6 +1,7 @@ ## Submitter - [ ] `$ npm version` has been run. +- [ ] Release notes in [draft GitHub release](https://github.com/markedjs/marked/releases) are up to date - [ ] Reviewer checklist is complete. - [ ] Merge PR. - [ ] Publish GitHub release using `master` with correct version number. From 3cd7462f3a43dd974a1c01b4c1b7ce73f33fbb88 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 12:08:39 -0500 Subject: [PATCH 107/459] Include failable test --- .github/PULL_REQUEST_TEMPLATE/release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index 2ff16a76..09b6769a 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -13,5 +13,5 @@ - [ ] Version in `package.json` has been updated (see [RELEASE.md](https://github.com/markedjs/marked/blob/master/RELEASE.md)). - [ ] The `marked.min.js` has been updated; or, - [ ] release does not change library. -- [ ] All tests pass (remove once CI is in place). +- [ ] case_insensitive_refs is only failing test (remove once CI is in place and all tests pass). - [ ] All lint checks pass (remove once CI is in place). From 81f451140460f5ad6bf003224bea583c07cd83cf Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 12:41:49 -0500 Subject: [PATCH 108/459] Reviewer merges non-release PRs --- .github/PULL_REQUEST_TEMPLATE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c362b350..fc0c2284 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -41,4 +41,5 @@ Describe what code combination got you there - [ ] Draft GitHub release notes have been updated. - [ ] case_insensitive_refs is only failing test (remove once CI is in place and all tests pass). -- [ ] All lint checks pass (remove once CI is in place). \ No newline at end of file +- [ ] All lint checks pass (remove once CI is in place). +- [ ] Merge PR \ No newline at end of file From 6d0460f252e9d500bf7b1cbe112f79a201d1bc28 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 13:57:00 -0500 Subject: [PATCH 109/459] Proposal template & what if --- .github/ISSUE_TEMPLATE.md | 12 ++++++++++++ .github/PULL_REQUEST_TEMPLATE/release.md | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 83a443ba..0ed5a8e6 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -2,6 +2,18 @@ + + ## Expectation diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index 09b6769a..504f01b6 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -8,6 +8,12 @@ - [ ] `$ npm publish` has been run. - [ ] Create draft GitHub release to prepare next release. +Note: If merges to `master` occur after submitting this PR and before running `$ npm pubish` you should be able to + +1. pull from `upstream/master` into the branch holding this version, +2. run `$ npm run build` to regenerate the `min` file, and +3. commit and push the updated changes. + ## Reviewer - [ ] Version in `package.json` has been updated (see [RELEASE.md](https://github.com/markedjs/marked/blob/master/RELEASE.md)). From 5c6aeb31c38de9125645e0b77b1098f7afe4c2e5 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 14:18:59 -0500 Subject: [PATCH 110/459] Initial product vision --- README.md | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 9db5cb54..f2fb2226 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,17 @@ # marked -> A full-featured markdown parser and compiler, written in JavaScript. Built -> for speed. +[![NPM version](https://badge.fury.io/js/marked.svg)][badge] [![NPM dependencies](https://david-dm.org/markedjs/marked.svg)][badge] -[![NPM version](https://badge.fury.io/js/marked.svg)][badge] +Marked is + +1. built for speed.* +2. a low-level markdown compiler that allows frequent parsing of large chunks of markdown without caching or blocking for long periods of time.** +3. light-weight while implementing all markdown features from the supported flavors & specifications.*** +4. available as a command line interface and running in client- or server-side JavaScript projects. + +- * Still working on metrics for comparative analysis and definition. +- ** As few dependencies as possible. +- *** Strict compliance could result in slower processing when running comparative benchmarking.
    -

    Philosophy behind marked

    - -The point of marked was to create a markdown compiler where it was possible to -frequently parse huge chunks of markdown without having to worry about -caching the compiled output somehow...or blocking for an unnecessarily long time. - -marked is very concise and still implements all markdown features. It is also -now fully compatible with the client-side. - -marked more or less passes the official markdown test suite in its -entirety. This is important because a surprising number of markdown compilers -cannot pass more than a few tests. It was very difficult to get marked as -compliant as it is. It could have cut corners in several areas for the sake -of performance, but did not in order to be exactly what you expect in terms -of a markdown rendering. In fact, this is why marked could be considered at a -disadvantage in the benchmarks. - -Along with implementing every markdown feature, marked also implements [GFM -features][gfmf]. -

    Install

    ``` bash From 9dacd6685720b955db015ad79bc8bb4f9ba56b74 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 15:17:16 -0500 Subject: [PATCH 111/459] Add advanced usage --- README.md | 274 +++------------------------------------------- USAGE_ADVANCED.md | 180 ++++++++++++++++++++++++++++++ 2 files changed, 194 insertions(+), 260 deletions(-) create mode 100644 USAGE_ADVANCED.md diff --git a/README.md b/README.md index f2fb2226..8d38d5ec 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Marked is 1. built for speed.* 2. a low-level markdown compiler that allows frequent parsing of large chunks of markdown without caching or blocking for long periods of time.** 3. light-weight while implementing all markdown features from the supported flavors & specifications.*** -4. available as a command line interface and running in client- or server-side JavaScript projects. +4. available as a command line interface (CLI) and running in client- or server-side JavaScript projects. - * Still working on metrics for comparative analysis and definition. - ** As few dependencies as possible. @@ -26,48 +26,25 @@ Marked is
  • License
  • -

    Install

    +

    Installation

    -``` bash -npm install marked --save -``` +**CLI:** `npm install -g marked` -or if you want to use the `marked` CLI tool (not necessary when using npm run-scripts): - -``` bash -npm install -g marked -``` +**In-browser:** `npm install marked --save`

    Usage

    -Minimal usage: +**CLI** -```js -var marked = require('marked'); -console.log(marked('I am using __markdown__.')); -// Outputs:

    I am using markdown.

    +``` bash +$ marked -o hello.html +hello world +^D +$ cat hello.html +

    hello world

    ``` -Example setting options: - -```js -var marked = require('marked'); -marked.setOptions({ - renderer: new marked.Renderer(), - gfm: true, - tables: true, - breaks: false, - pedantic: false, - sanitize: false, - smartLists: true, - smartypants: false, - xhtml: false -}); - -console.log(marked('I am using __markdown__.')); -``` - -### Browser +**Browser** ```html @@ -75,7 +52,7 @@ console.log(marked('I am using __markdown__.')); Marked in the browser - +
    @@ -87,221 +64,8 @@ console.log(marked('I am using __markdown__.')); ``` -

    marked(markdownString [,options] [,callback])

    -### markdownString - -Type: `string` - -String of markdown source to be compiled. - -### options - -Type: `object` - -Hash of options. Can also be set using the `marked.setOptions` method as seen -above. - -### callback - -Type: `function` - -Function called when the `markdownString` has been fully parsed when using -async highlighting. If the `options` argument is omitted, this can be used as -the second argument. - -

    Options

    - -### highlight - -Type: `function` - -A function to highlight code blocks. The first example below uses async highlighting with -[node-pygmentize-bundled][pygmentize], and the second is a synchronous example using -[highlight.js][highlight]: - -```js -var marked = require('marked'); - -var markdownString = '```js\n console.log("hello"); \n```'; - -// Async highlighting with pygmentize-bundled -marked.setOptions({ - highlight: function (code, lang, callback) { - require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) { - callback(err, result.toString()); - }); - } -}); - -// Using async version of marked -marked(markdownString, function (err, content) { - if (err) throw err; - console.log(content); -}); - -// Synchronous highlighting with highlight.js -marked.setOptions({ - highlight: function (code) { - return require('highlight.js').highlightAuto(code).value; - } -}); - -console.log(marked(markdownString)); -``` - -#### highlight arguments - -`code` - -Type: `string` - -The section of code to pass to the highlighter. - -`lang` - -Type: `string` - -The programming language specified in the code block. - -`callback` - -Type: `function` - -The callback function to call when using an async highlighter. - -### renderer - -Type: `object` -Default: `new Renderer()` - -An object containing functions to render tokens to HTML. - -#### Overriding renderer methods - -The renderer option allows you to render tokens in a custom manner. Here is an -example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub: - -```javascript -var marked = require('marked'); -var renderer = new marked.Renderer(); - -renderer.heading = function (text, level) { - var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); - - return '' + - text + ''; -}; - -console.log(marked('# heading+', { renderer: renderer })); -``` -This code will output the following HTML: -```html -

    - - - - heading+ -

    -``` - -#### Block level renderer methods - -- code(*string* code, *string* language) -- blockquote(*string* quote) -- html(*string* html) -- heading(*string* text, *number* level) -- hr() -- list(*string* body, *boolean* ordered) -- listitem(*string* text) -- paragraph(*string* text) -- table(*string* header, *string* body) -- tablerow(*string* content) -- tablecell(*string* content, *object* flags) - -`flags` has the following properties: - -```js -{ - header: true || false, - align: 'center' || 'left' || 'right' -} -``` - -#### Inline level renderer methods - -- strong(*string* text) -- em(*string* text) -- codespan(*string* code) -- br() -- del(*string* text) -- link(*string* href, *string* title, *string* text) -- image(*string* href, *string* title, *string* text) -- text(*string* text) - -### gfm - -Type: `boolean` -Default: `true` - -Enable [GitHub flavored markdown][gfm]. - -### tables - -Type: `boolean` -Default: `true` - -Enable GFM [tables][tables]. -This option requires the `gfm` option to be true. - -### breaks - -Type: `boolean` -Default: `false` - -Enable GFM [line breaks][breaks]. -This option requires the `gfm` option to be true. - -### pedantic - -Type: `boolean` -Default: `false` - -Conform to obscure parts of `markdown.pl` as much as possible. Don't fix any of -the original markdown bugs or poor behavior. - -### sanitize - -Type: `boolean` -Default: `false` - -Sanitize the output. Ignore any HTML that has been input. - -### smartLists - -Type: `boolean` -Default: `true` - -Use smarter list behavior than the original markdown. May eventually be -default with the old behavior moved into `pedantic`. - -### smartypants - -Type: `boolean` -Default: `false` - -Use "smart" typographic punctuation for things like quotes and dashes. - -### xhtml - -Type: `boolean` -Default: `false` - -Self-close the tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML. +Marked offers [advanced configurations](https://github.com/markedjs/marked/blob/master/USAGE_ADVANCED.md) and extensibility as well.

    Access to lexer and parser

    @@ -319,16 +83,6 @@ console.log(tokens); console.log(lexer.rules); ``` -

    CLI

    - -``` bash -$ marked -o hello.html -hello world -^D -$ cat hello.html -

    hello world

    -``` -

    Benchmarks

    node v8.9.4 diff --git a/USAGE_ADVANCED.md b/USAGE_ADVANCED.md new file mode 100644 index 00000000..d8e3caf2 --- /dev/null +++ b/USAGE_ADVANCED.md @@ -0,0 +1,180 @@ +## The `marked` function + +```js +marked(markdownString [,options] [,callback]) +``` + +|Argument |Type |Notes | +|:--------------------:|:-----------:|:---------------------------------------------------------------------------------------------------:| +|markdownString |`string` |String of markdown source to be compiled. | +|options|`object`|Hash of options. Can also use `marked.setOptions`. | +|callback |`function` |Called when `markdownString` has been parsed. Can be used as second argument if no `options` present.| + +### Alternative + +```js +// Create reference instance +var myMarked = require('marked'); + +// Set options +// `highlight` example uses `highlight.js` +myMarked.setOptions({ + renderer: new marked.Renderer(), + highlight: function(code) { + return require('highlight.js').highlightAuto(code).value; + }, + pedantic: false, + gfm: true, + tables: true, + breaks: false, + sanitize: false, + smartLists: true, + smartypants: false, + xhtml: false +}); + +// Compile +console.log(myMarked('I am using __markdown__.')); +``` + +

    Options

    + +|Member |Type |Notes | +|:---------:|:--------:|:---------------------------------------------------------------------------------------------------------------------------:| +|highlight |`function`|A function to highlight code blocks. | +|renderer |`object` |An object containing functions to render tokens to HTML. Default: `new Renderer()` | +|pedantic |`boolean` |Conform to obscure parts of `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Default: `false`| +|gfm |`boolean` |Use approved [GitHub Flavored Markdown (GFM) specification](https://github.github.com/gfm/). | +|tables |`boolean` |Use [GFM Tables extension](https://github.github.com/gfm/#tables-extension-). Requires `gfm` be `true`. | +|breaks |`boolean` |Use GFM [hard](https://github.github.com/gfm/#hard-line-breaks) and [soft](https://github.github.com/gfm/#soft-line-breaks) line breaks. Requires `gfm` be `true`. Default: `false`| +|sanitize |`boolean` |Ignore HTML passed into `markdownString` (sanitize the input). Default: `false` | +|smartlists |`boolean` |Use smarter list behavior than those found in `markdown.pl`. Default: `true` | +|smartypants|`boolean` |Use "smart" typographic punctuation for things like quotes and dashes. | +|xhtml |`boolean` |Self-close the tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML. Default: `false` | + +### highlight + +Captured...?? + + The first example below uses async highlighting with +[node-pygmentize-bundled][pygmentize], and the second is a synchronous example using +[highlight.js][highlight]: + +```js +var marked = require('marked'); + +var markdownString = '```js\n console.log("hello"); \n```'; + +// Async highlighting with pygmentize-bundled +marked.setOptions({ + highlight: function (code, lang, callback) { + require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) { + callback(err, result.toString()); + }); + } +}); + +// Using async version of marked +marked(markdownString, function (err, content) { + if (err) throw err; + console.log(content); +}); + +// Synchronous highlighting with highlight.js +marked.setOptions({ + highlight: function (code) { + return require('highlight.js').highlightAuto(code).value; + } +}); + +console.log(marked(markdownString)); +``` + +#### highlight arguments + +`code` + +Type: `string` + +The section of code to pass to the highlighter. + +`lang` + +Type: `string` + +The programming language specified in the code block. + +`callback` + +Type: `function` + +The callback function to call when using an async highlighter. + +### renderer + +#### Overriding renderer methods + +The renderer option allows you to render tokens in a custom manner. Here is an +example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub: + +```javascript +var marked = require('marked'); +var renderer = new marked.Renderer(); + +renderer.heading = function (text, level) { + var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); + + return '' + + text + ''; +}; + +console.log(marked('# heading+', { renderer: renderer })); +``` +This code will output the following HTML: +```html +

    + + + + heading+ +

    +``` + +#### Block level renderer methods + +- code(*string* code, *string* language) +- blockquote(*string* quote) +- html(*string* html) +- heading(*string* text, *number* level) +- hr() +- list(*string* body, *boolean* ordered) +- listitem(*string* text) +- paragraph(*string* text) +- table(*string* header, *string* body) +- tablerow(*string* content) +- tablecell(*string* content, *object* flags) + +`flags` has the following properties: + +```js +{ + header: true || false, + align: 'center' || 'left' || 'right' +} +``` + +#### Inline level renderer methods + +- strong(*string* text) +- em(*string* text) +- codespan(*string* code) +- br() +- del(*string* text) +- link(*string* href, *string* title, *string* text) +- image(*string* href, *string* title, *string* text) +- text(*string* text) + From 4a7d3d44dee7706e9fb5ea6f82ff0eb4772e6eb2 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 15:19:15 -0500 Subject: [PATCH 112/459] Table alignments --- USAGE_ADVANCED.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/USAGE_ADVANCED.md b/USAGE_ADVANCED.md index d8e3caf2..c12c22c6 100644 --- a/USAGE_ADVANCED.md +++ b/USAGE_ADVANCED.md @@ -39,8 +39,8 @@ console.log(myMarked('I am using __markdown__.'));

    Options

    -|Member |Type |Notes | -|:---------:|:--------:|:---------------------------------------------------------------------------------------------------------------------------:| +|:Member :|:Type :|:Notes :| +|:----------|:---------|:----------------------------------------------------------------------------------------------------------------------------| |highlight |`function`|A function to highlight code blocks. | |renderer |`object` |An object containing functions to render tokens to HTML. Default: `new Renderer()` | |pedantic |`boolean` |Conform to obscure parts of `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Default: `false`| From 59dfb4631d42a0d6dd01f06589ae5b7daa4b4579 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 15:20:38 -0500 Subject: [PATCH 113/459] Table alignments --- USAGE_ADVANCED.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/USAGE_ADVANCED.md b/USAGE_ADVANCED.md index c12c22c6..4917526e 100644 --- a/USAGE_ADVANCED.md +++ b/USAGE_ADVANCED.md @@ -39,7 +39,8 @@ console.log(myMarked('I am using __markdown__.'));

    Options

    -|:Member :|:Type :|:Notes :| +|:---------:|:--------:|:---------------------------------------------------------------------------------------------------------------------------:| +|Member |Type |Notes | |:----------|:---------|:----------------------------------------------------------------------------------------------------------------------------| |highlight |`function`|A function to highlight code blocks. | |renderer |`object` |An object containing functions to render tokens to HTML. Default: `new Renderer()` | From 9ccb038bc9b756c5420be045693cab72e92ac40a Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 15:21:59 -0500 Subject: [PATCH 114/459] Table alignment --- USAGE_ADVANCED.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/USAGE_ADVANCED.md b/USAGE_ADVANCED.md index 4917526e..0d2c53fe 100644 --- a/USAGE_ADVANCED.md +++ b/USAGE_ADVANCED.md @@ -5,7 +5,7 @@ marked(markdownString [,options] [,callback]) ``` |Argument |Type |Notes | -|:--------------------:|:-----------:|:---------------------------------------------------------------------------------------------------:| +|:---------------------|:------------|:----------------------------------------------------------------------------------------------------| |markdownString |`string` |String of markdown source to be compiled. | |options|`object`|Hash of options. Can also use `marked.setOptions`. | |callback |`function` |Called when `markdownString` has been parsed. Can be used as second argument if no `options` present.| @@ -39,7 +39,6 @@ console.log(myMarked('I am using __markdown__.'));

    Options

    -|:---------:|:--------:|:---------------------------------------------------------------------------------------------------------------------------:| |Member |Type |Notes | |:----------|:---------|:----------------------------------------------------------------------------------------------------------------------------| |highlight |`function`|A function to highlight code blocks. | From eef65efbb548e3e5b7a4da21882cdacc74b6257e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 15:32:52 -0500 Subject: [PATCH 115/459] Highlight consolidated --- USAGE_ADVANCED.md | 56 +++++++---------------------------------------- 1 file changed, 8 insertions(+), 48 deletions(-) diff --git a/USAGE_ADVANCED.md b/USAGE_ADVANCED.md index 0d2c53fe..506291af 100644 --- a/USAGE_ADVANCED.md +++ b/USAGE_ADVANCED.md @@ -10,7 +10,7 @@ marked(markdownString [,options] [,callback]) |options|`object`|Hash of options. Can also use `marked.setOptions`. | |callback |`function` |Called when `markdownString` has been parsed. Can be used as second argument if no `options` present.| -### Alternative +### Alternative using reference ```js // Create reference instance @@ -41,7 +41,7 @@ console.log(myMarked('I am using __markdown__.')); |Member |Type |Notes | |:----------|:---------|:----------------------------------------------------------------------------------------------------------------------------| -|highlight |`function`|A function to highlight code blocks. | +|highlight |`function`|A function to highlight code blocks. See also: Asynchronous highlighting. | |renderer |`object` |An object containing functions to render tokens to HTML. Default: `new Renderer()` | |pedantic |`boolean` |Conform to obscure parts of `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Default: `false`| |gfm |`boolean` |Use approved [GitHub Flavored Markdown (GFM) specification](https://github.github.com/gfm/). | @@ -52,63 +52,23 @@ console.log(myMarked('I am using __markdown__.')); |smartypants|`boolean` |Use "smart" typographic punctuation for things like quotes and dashes. | |xhtml |`boolean` |Self-close the tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML. Default: `false` | -### highlight +

    Asynchronous highlighting

    -Captured...?? - - The first example below uses async highlighting with -[node-pygmentize-bundled][pygmentize], and the second is a synchronous example using -[highlight.js][highlight]: +Unlike `highlight.js` the `pygmatize.js` library uses asynchronous highlighting. This example demonstrates that marked is agnostic when it comes to the highlighter you use. ```js -var marked = require('marked'); - -var markdownString = '```js\n console.log("hello"); \n```'; - -// Async highlighting with pygmentize-bundled -marked.setOptions({ - highlight: function (code, lang, callback) { +myMarked.setOption({ + highlight: function(code, lang, callback) { require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) { callback(err, result.toString()); }); } }); -// Using async version of marked -marked(markdownString, function (err, content) { - if (err) throw err; - console.log(content); -}); - -// Synchronous highlighting with highlight.js -marked.setOptions({ - highlight: function (code) { - return require('highlight.js').highlightAuto(code).value; - } -}); - -console.log(marked(markdownString)); +console.log(myMarked(markdownString)); ``` -#### highlight arguments - -`code` - -Type: `string` - -The section of code to pass to the highlighter. - -`lang` - -Type: `string` - -The programming language specified in the code block. - -`callback` - -Type: `function` - -The callback function to call when using an async highlighter. +In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming lnaguage to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete. ### renderer From 3c476fc1848e23bc86cae30c108dc90d1b310844 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 16:01:22 -0500 Subject: [PATCH 116/459] Base README --- CONTRIBUTING.md | 55 +++++++++++++++++ LICENSE => LICENSE.md | 8 +++ README.md | 135 +++++------------------------------------ USAGE_ADVANCED.md | 71 +--------------------- USAGE_EXTENSIBILITY.md | 109 +++++++++++++++++++++++++++++++++ 5 files changed, 187 insertions(+), 191 deletions(-) create mode 100644 CONTRIBUTING.md rename LICENSE => LICENSE.md (91%) create mode 100644 USAGE_EXTENSIBILITY.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..05fe966e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,55 @@ +The marked library tends to favor following the SOLID set of software design and development principles. + +## Priorities + +We think we have our priorities straight. + + +1. If the code in a pull request can have a test written for it, it should have it. (If the test already exists, please reference the test which should pass.) +2. Do not merge your own. Mainly for collaborators and owners, please do not review and merge your own PRs. + +### Tests + +The marked test suite is set up slightly strangely: `test/new` is for all tests +that are not part of the original markdown.pl test suite (this is where your +test should go if you make one). `test/original` is only for the original +markdown.pl tests. + +In other words, if you have a test to add, add it to `test/new/`. If your test +uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you +can add [front-matter](https://www.npmjs.com/package/front-matter) to the top of +your `.md` file + +``` yml +--- +gfm: false +--- +``` + +To run the tests: + +``` bash +npm run test +``` + +

    Releasing

    + +**Master is always shippable:** We try to merge PRs in such a way that `master` is the only branch to really be concerned about *and* `master` can always be released. This allows smoother flow between new fetures, bug fixes, and so on. (Almost a continuous deployment setup, without automation.) + +**Version naming:** relatively standard [major].[minor].[patch] where `major` releases represent known breaking changes to the previous release, `minor` represent additions of new funcitonality without breaking changes, and `patch` releases represent changes meant to fix previously released functionality with no new functionality. Note: When the major is a zero, it means the library is still in a beta state wherein the `major` does not get updated; therefore, `minor` releases may introduce breaking changes, and `patch` releases may contain new features. + +**Release process:** + +1. Check out library +2. Make sure you are on the `master` branch +3. Create release branch from `master` +4. `$ npm run build` (builds minified version and whatnot) +5. `$ npm version [major|minor|patch]` (updates `package.json`) +6. `$ npm publish` (publishes package to NPM) +7. Submit PR +8. Merge PR (only time where submitter should be "allowed" to merge his or her own) +9. Navigate to the "Releases" tab on the project main page -> "Draft new release" +10. Add version number matching the one in the `package.json` file after publishing the release +11. Make sure `master` is the branch from which the release will be made +12. Add notes regarding what users should expect from the release +13. Click "Publish release" \ No newline at end of file diff --git a/LICENSE b/LICENSE.md similarity index 91% rename from LICENSE rename to LICENSE.md index 020db880..aa60b8b1 100644 --- a/LICENSE +++ b/LICENSE.md @@ -1,3 +1,11 @@ +## Contribution License Agreement + +If you contribute code to this project, you are implicitly allowing your code +to be distributed under the MIT license. You are also implicitly verifying that +all code is your original work. `` + +## Marked + Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/) Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/README.md b/README.md index 8d38d5ec..95dfda31 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # marked -[![NPM version](https://badge.fury.io/js/marked.svg)][badge] [![NPM dependencies](https://david-dm.org/markedjs/marked.svg)][badge] +[![NPM version](https://badge.fury.io/js/marked.svg)] [![NPM dependencies](https://david-dm.org/markedjs/marked.svg)] Marked is @@ -16,12 +16,7 @@ Marked is @@ -65,132 +60,30 @@ $ cat hello.html ``` -Marked offers [advanced configurations](https://github.com/markedjs/marked/blob/master/USAGE_ADVANCED.md) and extensibility as well. +Marked offers [advanced configurations](https://github.com/markedjs/marked/blob/master/USAGE_ADVANCED.md) and [extensibility](https://github.com/markedjs/marked/blob/master/USAGE_EXTENSIBILITY.md) as well. -

    Access to lexer and parser

    +

    Supported Markdown specifications

    -You also have direct access to the lexer and parser if you so desire. +We actively support the features of the following [Markdown flavors](https://github.com/commonmark/CommonMark/wiki/Markdown-Flavors). -``` js -var tokens = marked.lexer(text, options); -console.log(marked.parser(tokens)); -``` +|Flavor |Version | +|:----------------------------------------------------------|:----------| +|The original markdown.pl |-- | +|[CommonMark](http://spec.commonmark.org/0.28/) |0.28 | +|[GitHub Flavored Markdown](https://github.github.com/gfm/) |0.28 | -``` js -var lexer = new marked.Lexer(options); -var tokens = lexer.lex(text); -console.log(tokens); -console.log(lexer.rules); -``` +By supporting the above Markdown flavors, it's possible that Marked can help you use other flavors as well; however, these are not actively supported by the community. -

    Benchmarks

    - -node v8.9.4 - -``` bash -$ npm run bench -marked completed in 3408ms. -marked (gfm) completed in 3465ms. -marked (pedantic) completed in 3032ms. -showdown (reuse converter) completed in 21444ms. -showdown (new converter) completed in 23058ms. -markdown-it completed in 3364ms. -markdown.js completed in 12090ms. -``` - -### Pro level - -You also have direct access to the lexer and parser if you so desire. - -``` js -var tokens = marked.lexer(text, options); -console.log(marked.parser(tokens)); -``` - -``` js -var lexer = new marked.Lexer(options); -var tokens = lexer.lex(text); -console.log(tokens); -console.log(lexer.rules); -``` - -``` bash -$ node -> require('marked').lexer('> i am using marked.') -[ { type: 'blockquote_start' }, - { type: 'paragraph', - text: 'i am using marked.' }, - { type: 'blockquote_end' }, - links: {} ] -```

    Contributing

    -1. If the code in a pull request can have a test written for it, it should have it. (If the test already exists, please reference the test which should pass.) -2. Do not merge your own. Mainly for collaborators and owners, please do not review and merge your own PRs. +The marked community enjoys a spirit of collaboration and contribution from all comers. Whether you're just getting started with Markdown, JavaScript, and Marked or your a veteran with it all, we're here to help you improve as a professional software developer while helping to improve Marked itself. Please see our [contributing documentation](https://github.com/markedjs/marked/blob/master/CONTRIBUTING.md) for more details. -### Tests - -The marked test suite is set up slightly strangely: `test/new` is for all tests -that are not part of the original markdown.pl test suite (this is where your -test should go if you make one). `test/original` is only for the original -markdown.pl tests. - -In other words, if you have a test to add, add it to `test/new/`. If your test -uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you -can add [front-matter](https://www.npmjs.com/package/front-matter) to the top of -your `.md` file - -``` yml ---- -gfm: false ---- -``` - -To run the tests: - -``` bash -npm run test -``` - -### Contribution License Agreement - -If you contribute code to this project, you are implicitly allowing your code -to be distributed under the MIT license. You are also implicitly verifying that -all code is your original work. `` - -

    Releasing

    - -**Master is always shippable:** We try to merge PRs in such a way that `master` is the only branch to really be concerned about *and* `master` can always be released. This allows smoother flow between new fetures, bug fixes, and so on. (Almost a continuous deployment setup, without automation.) - -**Version naming:** relatively standard [major].[minor].[patch] where `major` releases represent known breaking changes to the previous release, `minor` represent additions of new funcitonality without breaking changes, and `patch` releases represent changes meant to fix previously released functionality with no new functionality. Note: When the major is a zero, it means the library is still in a beta state wherein the `major` does not get updated; therefore, `minor` releases may introduce breaking changes, and `patch` releases may contain new features. - -**Release process:** - -1. Check out library -2. Make sure you are on the `master` branch -3. Create release branch from `master` -4. `$ npm run build` (builds minified version and whatnot) -5. `$ npm version [major|minor|patch]` (updates `package.json`) -6. `$ npm publish` (publishes package to NPM) -7. Submit PR -8. Merge PR (only time where submitter should be "allowed" to merge his or her own) -9. Navigate to the "Releases" tab on the project main page -> "Draft new release" -10. Add version number matching the one in the `package.json` file after publishing the release -11. Make sure `master` is the branch from which the release will be made -12. Add notes regarding what users should expect from the release -13. Click "Publish release" +For our Contribution License Agreement, see our [license](https://github.com/markedjs/marked/blob/master/LICENSE).

    License

    Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) -See [LICENSE](https://github.com/markedjs/marked/blob/master/LICENSE) for more details. +See [license](https://github.com/markedjs/marked/blob/master/LICENSE) for more details. -[gfm]: https://help.github.com/articles/github-flavored-markdown -[gfmf]: http://github.github.com/github-flavored-markdown/ -[pygmentize]: https://github.com/rvagg/node-pygmentize-bundled -[highlight]: https://github.com/isagalaev/highlight.js -[badge]: http://badge.fury.io/js/marked -[tables]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables -[breaks]: https://help.github.com/articles/github-flavored-markdown#newlines diff --git a/USAGE_ADVANCED.md b/USAGE_ADVANCED.md index 506291af..3e4ba294 100644 --- a/USAGE_ADVANCED.md +++ b/USAGE_ADVANCED.md @@ -68,73 +68,4 @@ myMarked.setOption({ console.log(myMarked(markdownString)); ``` -In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming lnaguage to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete. - -### renderer - -#### Overriding renderer methods - -The renderer option allows you to render tokens in a custom manner. Here is an -example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub: - -```javascript -var marked = require('marked'); -var renderer = new marked.Renderer(); - -renderer.heading = function (text, level) { - var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); - - return '' + - text + ''; -}; - -console.log(marked('# heading+', { renderer: renderer })); -``` -This code will output the following HTML: -```html -

    - - - - heading+ -

    -``` - -#### Block level renderer methods - -- code(*string* code, *string* language) -- blockquote(*string* quote) -- html(*string* html) -- heading(*string* text, *number* level) -- hr() -- list(*string* body, *boolean* ordered) -- listitem(*string* text) -- paragraph(*string* text) -- table(*string* header, *string* body) -- tablerow(*string* content) -- tablecell(*string* content, *object* flags) - -`flags` has the following properties: - -```js -{ - header: true || false, - align: 'center' || 'left' || 'right' -} -``` - -#### Inline level renderer methods - -- strong(*string* text) -- em(*string* text) -- codespan(*string* code) -- br() -- del(*string* text) -- link(*string* href, *string* title, *string* text) -- image(*string* href, *string* title, *string* text) -- text(*string* text) - +In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming lnaguage to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete. \ No newline at end of file diff --git a/USAGE_EXTENSIBILITY.md b/USAGE_EXTENSIBILITY.md new file mode 100644 index 00000000..10c63940 --- /dev/null +++ b/USAGE_EXTENSIBILITY.md @@ -0,0 +1,109 @@ +### renderer + +#### Overriding renderer methods + +The renderer option allows you to render tokens in a custom manner. Here is an +example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub: + +```javascript +var marked = require('marked'); +var renderer = new marked.Renderer(); + +renderer.heading = function (text, level) { + var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); + + return '' + + text + ''; +}; + +console.log(marked('# heading+', { renderer: renderer })); +``` +This code will output the following HTML: +```html +

    + + + + heading+ +

    +``` + +#### Block level renderer methods + +- code(*string* code, *string* language) +- blockquote(*string* quote) +- html(*string* html) +- heading(*string* text, *number* level) +- hr() +- list(*string* body, *boolean* ordered) +- listitem(*string* text) +- paragraph(*string* text) +- table(*string* header, *string* body) +- tablerow(*string* content) +- tablecell(*string* content, *object* flags) + +`flags` has the following properties: + +```js +{ + header: true || false, + align: 'center' || 'left' || 'right' +} +``` + +#### Inline level renderer methods + +- strong(*string* text) +- em(*string* text) +- codespan(*string* code) +- br() +- del(*string* text) +- link(*string* href, *string* title, *string* text) +- image(*string* href, *string* title, *string* text) +- text(*string* text) + +

    Access to lexer and parser

    + +You also have direct access to the lexer and parser if you so desire. + +``` js +var tokens = marked.lexer(text, options); +console.log(marked.parser(tokens)); +``` + +``` js +var lexer = new marked.Lexer(options); +var tokens = lexer.lex(text); +console.log(tokens); +console.log(lexer.rules); +``` + +### Pro level + +You also have direct access to the lexer and parser if you so desire. + +``` js +var tokens = marked.lexer(text, options); +console.log(marked.parser(tokens)); +``` + +``` js +var lexer = new marked.Lexer(options); +var tokens = lexer.lex(text); +console.log(tokens); +console.log(lexer.rules); +``` + +``` bash +$ node +> require('marked').lexer('> i am using marked.') +[ { type: 'blockquote_start' }, + { type: 'paragraph', + text: 'i am using marked.' }, + { type: 'blockquote_end' }, + links: {} ] +``` \ No newline at end of file From 606e89674e81c99288cce5a791d2018811f09c54 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 16:20:20 -0500 Subject: [PATCH 117/459] Add AUTHORS page --- AUTHORS.md | 13 +++++++++++++ README.md | 18 +++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 AUTHORS.md diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 00000000..f98d6398 --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,13 @@ +## Original developer + +Christopher Jeffrey + +## Contribution credits + +The following is a non-exhaustive list of those who have contributed in major ways to the Marked open source project, particularly in bringing it back to life. In no particular order. + +- Tony Brix @UziTech +- Federico Soave @Feder1co5oave +- Костя Третяк @KostyaTretyak +- Steven @styfle +- Josh Bruce @joshbruce \ No newline at end of file diff --git a/README.md b/README.md index 95dfda31..4810b5d1 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ -# marked - -[![NPM version](https://badge.fury.io/js/marked.svg)] [![NPM dependencies](https://david-dm.org/markedjs/marked.svg)] - Marked is 1. built for speed.* @@ -9,9 +5,9 @@ Marked is 3. light-weight while implementing all markdown features from the supported flavors & specifications.*** 4. available as a command line interface (CLI) and running in client- or server-side JavaScript projects. -- * Still working on metrics for comparative analysis and definition. -- ** As few dependencies as possible. -- *** Strict compliance could result in slower processing when running comparative benchmarking. +* Still working on metrics for comparative analysis and definition. +** As few dependencies as possible. +*** Strict compliance could result in slower processing when running comparative benchmarking. -

    About

    +

    Marked

    Marked is From 307e1d81d64be18088f411eff7f3c525782637b2 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 18:17:01 -0500 Subject: [PATCH 126/459] Miinor update to AUTHORS --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index f98d6398..8b664059 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -4,7 +4,7 @@ Christopher Jeffrey ## Contribution credits -The following is a non-exhaustive list of those who have contributed in major ways to the Marked open source project, particularly in bringing it back to life. In no particular order. +The following is a non-exhaustive list of those who have contributed in major ways to the Marked open source project, particularly in bringing it back to life (in no particular order): - Tony Brix @UziTech - Federico Soave @Feder1co5oave From c242cf99e3aea167fc50f5f9e18b336498d0b40e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 18:17:55 -0500 Subject: [PATCH 127/459] Design principles --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d9344b6a..0b5254f7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ ## Design principles -Marked tends to favor following the SOLID (mainly the [single responsibility](https://en.wikipedia.org/wiki/Single_responsibility_principle) and [open/closed principles](https://en.wikipedia.org/wiki/Open/closed_principle)) set of software design and development principles: +Marked tends to favor following the SOLID set of software design and development principles; mainly the [single responsibility](https://en.wikipedia.org/wiki/Single_responsibility_principle) and [open/closed principles](https://en.wikipedia.org/wiki/Open/closed_principle): - **Single responsibility:** Marked, and the components of Marked, have the single responsibility of converting Markdown strings into HTML. - **Open/closed:** Marked favors giving developers the means to easily extend the library and its components over changing Marked's behavior through configuration options. From 47266d25a17a10351efb851872a5d9a8daf35f2a Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 18:19:28 -0500 Subject: [PATCH 128/459] Typo --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0b5254f7..38622940 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,4 +84,4 @@ npm run build ## Releasing -Create GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [releasing documentation](https://github.com/markedjs/marked/blob/master/RELEASING.md). +Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [releasing documentation](https://github.com/markedjs/marked/blob/master/RELEASING.md). From b1e0c6f5656f3c9892e68564e42aaaa2143dda83 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 18:32:44 -0500 Subject: [PATCH 129/459] Add Chris's GitHub handle --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 8b664059..363a8527 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,6 +1,6 @@ ## Original developer -Christopher Jeffrey +Christopher Jeffrey @chjj ## Contribution credits From f864e0f198df1fe1643ef2bb7012f70c129944c1 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 18:56:03 -0500 Subject: [PATCH 130/459] Update high-level release checklist --- RELEASE.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index bfe920f4..89db478b 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,8 +1,9 @@ # Releasing Marked - [ ] See [contributing](https://github.com/markedjs/marked/blob/master/CONTRIBUTING.md) -- [ ] Create release branch from `master` (`release-##.##.##`) -> Submit PR -- [ ] Complete PR checklist +- [ ] Create release branch from `master` (`release-x.y.z`) +- [ ] Submit PR with minimal name: Release x.y.z +- [ ] Complete PR checklists ## Overall strategy From 7db0ff63d1ee4809b739627054142f67eac6c7ae Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 18:57:04 -0500 Subject: [PATCH 131/459] Complete separation between pre and post 1.0 --- RELEASE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE.md b/RELEASE.md index 89db478b..82a45d4b 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -11,7 +11,7 @@ ## Versioning -We follow [semantic versioning](https://semver.org) where the following sequence is true `[major].[minor].[patch]` (further, while in beta, you may see this `0.[major|minor].[minor|patch]`); therefore, consider the following implications of the release you are preparing: +We follow [semantic versioning](https://semver.org) where the following sequence is true `[major].[minor].[patch]`; therefore, consider the following implications of the release you are preparing: 1. **Major:** There is at least one change not deemed backward compatible. 2. **Minor:** There is at least one new feature added to the release. From bb6d2a7523d7aca06a5a961a9b42bc06868dc2c9 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 19:11:59 -0500 Subject: [PATCH 132/459] Make Contributing text in README less pretentious sounding --- CONTRIBUTING.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 38622940..f613e3c4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ The following table lists the ticket type labels we use when there is work to be ## Test early, often, and everything -We try to write test cases to validate output (writing tests based on the [supported specifications](https://github.com/markedjs/marked/blob/master/AUTHORS.md#specifications)) and minimize regression (writing tests for issues fixed). Therefore, if you would like to contribute, somethings you should regarding the test harness. +We try to write test cases to validate output (writing tests based on the [supported specifications](https://github.com/markedjs/marked/blob/master/AUTHORS.md#specifications)) and minimize regression (writing tests for issues fixed). Therefore, if you would like to contribute, some things you should know regarding the test harness. |Location |Description | |:-------------|:---------------------------------------------------| diff --git a/README.md b/README.md index bd84c1ed..4509d2ea 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ By supporting the above Markdown flavors, it's possible that Marked can help you

    Contributing

    -The marked community enjoys a spirit of collaboration and contribution from all comers. Whether you're just getting started with Markdown, JavaScript, and Marked or you're a veteran with it all figured out, we're here to help you improve as a professionally while helping improve Marked technically. Please see our [contributing documentation](https://github.com/markedjs/marked/blob/master/CONTRIBUTING.md) for more details. +The marked community enjoys a spirit of collaboration and contribution from all comers. Whether you're just getting started with Markdown, JavaScript, and Marked or you're a veteran with it all figured out, we're here to help each other improve as professionals while helping Marked improve technically. Please see our [contributing documentation](https://github.com/markedjs/marked/blob/master/CONTRIBUTING.md) for more details. For our Contribution License Agreement, see our [license](https://github.com/markedjs/marked/blob/master/LICENSE.md). From 10e03b2486ce46db9c672b253cd1ec97666bd4a2 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 20:28:21 -0500 Subject: [PATCH 133/459] Add security section to README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4509d2ea..7ce619a5 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@
  • Installation
  • Usage
  • Supported Markdown specifications
  • +
  • Security
  • Contributing
  • Authors
  • License
  • @@ -74,6 +75,9 @@ We actively support the features of the following [Markdown flavors](https://git By supporting the above Markdown flavors, it's possible that Marked can help you use other flavors as well; however, these are not actively supported by the community. +

    Security

    + +The only completely secure system is the one that doesn't exist in the first place. Having said that, we take the security of Marked very seriously; however, none of us are necessarily security experts, so to speak. Therefore, if you find something, [say something](https://github.com/markedjs/marked/issues).

    Contributing

    From c6211482ecc85889b3b63a767c0b8575be47a83d Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 20:46:38 -0500 Subject: [PATCH 134/459] Make tests checkbox more concise --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index fc0c2284..12f41fc8 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -34,7 +34,7 @@ Describe what code combination got you there ## Submitter -- [ ] Test(s) exist to ensure functionality works (if no new tests added, list which tests cover this functionality); or, +- [ ] Test(s) exist to ensure functionality and minimize regresstion (if no tests added, list tests covering this PR); or, - [ ] no tests required for this PR. ## Reviewer From a8b50df75c7a65e7e8f70c76c99192157738fa31 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 20:48:04 -0500 Subject: [PATCH 135/459] Added new features documentation submission --- .github/PULL_REQUEST_TEMPLATE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 12f41fc8..76d86a98 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -36,6 +36,7 @@ Describe what code combination got you there - [ ] Test(s) exist to ensure functionality and minimize regresstion (if no tests added, list tests covering this PR); or, - [ ] no tests required for this PR. +- [ ] If submitting new feature, it has been documented in the appropriate places. ## Reviewer From eeb1c7c6e312701677ae27ab55aa5e2f8bbe3133 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 20:51:00 -0500 Subject: [PATCH 136/459] Add call stack and console log --- .github/ISSUE_TEMPLATE.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 0ed5a8e6..60309083 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -4,7 +4,7 @@ + + From 9546f7f9dd5d251a65d62c8085997328ce11e50d Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 21:56:00 -0500 Subject: [PATCH 137/459] Typos and grammar --- CONTRIBUTING.md | 2 +- USAGE_EXTENSIBILITY.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f613e3c4..8f05cb47 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ Marked tends to favor following the SOLID set of software design and development ## Priorities -We think we have our priorities straight for building quality in. +We think we have our priorities sorted to build quality in. The following table lists the ticket type labels we use when there is work to be done on the code either through an Issue or a PR; in priority order. diff --git a/USAGE_EXTENSIBILITY.md b/USAGE_EXTENSIBILITY.md index 19afbd9d..20bd13ea 100644 --- a/USAGE_EXTENSIBILITY.md +++ b/USAGE_EXTENSIBILITY.md @@ -8,7 +8,7 @@ To champion the single-reponsibility and open/closed prinicples, we have tried t
  • The parser
  • -

    The renderer

    +

    The renderer

    The renderer is... From 64bcb729c594d35e55f952a621cd441226f0417b Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 21:58:23 -0500 Subject: [PATCH 138/459] Typos --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f05cb47..1d9a3d55 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ The following table lists the ticket type labels we use when there is work to be |:----------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------| |L0 - security |A security vulnerability within the Marked library is discovered. | |L1 - broken |Valid usage results in incorrect output compared to [supported specifications](https://github.com/markedjs/marked/blob/master/AUTHORS.md#specifications) OR causes marked to crash AND there is no known workaround for the issue. | -|L2 - annoying |Similar to L1 - borken only there is a known workaround avaialable for the issue. | +|L2 - annoying |Similar to L1 - broken only there is a known workaround avaialable for the issue. | |RR - refactor and re-engineer |Results in an improvement to developers using Marked (improved readability) or end-users (faster performance) or both. | |NFS - new feature (spec related) |A capability Marked does not currently provide but is in one of the [supported specifications](https://github.com/markedjs/marked/blob/master/AUTHORS.md#specifications)| |NFU - new feature (user requested) |A capability Marked does not currently provide but has been requested by users of Marked. | @@ -56,7 +56,7 @@ The PR templates include checklists for both the submitter and the reviewer, whi ## Scripts -When it comes to NPM scripts, we try to use the native scripts provided by the NPM framework. +When it comes to NPM commands, we try to use the native scripts provided by the NPM framework. To run the tests: From 11f1645d51c71d23044ff22d65ea7a9431c1dc9d Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 22:04:16 -0500 Subject: [PATCH 139/459] Typo JS seems off for USAGE_ADVANCED asyn highlighting --- USAGE_ADVANCED.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/USAGE_ADVANCED.md b/USAGE_ADVANCED.md index 69431877..eef4c2c1 100644 --- a/USAGE_ADVANCED.md +++ b/USAGE_ADVANCED.md @@ -57,9 +57,9 @@ console.log(myMarked('I am using __markdown__.')); Unlike `highlight.js` the `pygmatize.js` library uses asynchronous highlighting. This example demonstrates that marked is agnostic when it comes to the highlighter you use. ```js -myMarked.setOption({ +myMarked.setOptions({ highlight: function(code, lang, callback) { - require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) { + require('pygmentize-bundled') ({ lang: lang, format: 'html' }, code, function (err, result) { callback(err, result.toString()); }); } From 9f1342f668e713fc2f401b508eb59fc9ee4a7c37 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 25 Feb 2018 22:06:18 -0500 Subject: [PATCH 140/459] Replace tabs with spaces --- USAGE_EXTENSIBILITY.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/USAGE_EXTENSIBILITY.md b/USAGE_EXTENSIBILITY.md index 20bd13ea..6981500f 100644 --- a/USAGE_EXTENSIBILITY.md +++ b/USAGE_EXTENSIBILITY.md @@ -26,11 +26,11 @@ renderer.heading = function (text, level) { var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); return ` - - - - ${text} - `; + + + + ${text} + `; }; // Run marked From 17dcbaf6b7c723a4a8b57c8009c1f728c5f27923 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 14:49:15 -0500 Subject: [PATCH 141/459] Add different membership types to the community --- AUTHORS.md | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 363a8527..22cfcc45 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,13 +1,38 @@ -## Original developer +## Users -Christopher Jeffrey @chjj +Users are anyone using Marked in some fashion. If you use Marked and would like to be added to a list of users, please do so. -## Contribution credits +## Contributors -The following is a non-exhaustive list of those who have contributed in major ways to the Marked open source project, particularly in bringing it back to life (in no particular order): +Contributors are users who submit a PR, Issue, or collaborates in making Marked a better product and experience for all the users. + +To be listed here, just make a contribution and, if it has significant impact, the committers and publishers may be able to add you here. If you're name is here, and you would rather it not be, just let us know. + +- Jamie Davis @davisjam - Thank you for the DOS contribution! +- Костя Третяк @KostyaTretyak + +## Committers + +Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not they're own). - Tony Brix @UziTech - Federico Soave @Feder1co5oave -- Костя Третяк @KostyaTretyak - Steven @styfle -- Josh Bruce @joshbruce \ No newline at end of file + +Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). + +## Admins + +Admins are committers who also have the responsibility, privilege, and burden of selecting committers and making sure the project itself runs smoothly, which includes community maintenance, governance, dispute resolution, and so on. (Letting the contributors easily enter into the project and begin contributing, with minimal friction.) + +## Publishers + +Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPMJS and performing outreach and external stakeholder communications. (Admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external issues.) + +- Josh Bruce @joshbruce + +## Original author + +The original author is the publisher who started it all. + +Christopher Jeffrey @chjj From eeb8c0895f338b2bb05ada80ccfc0fba9e38b150 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 14:52:11 -0500 Subject: [PATCH 142/459] Update authors and security-related readme --- AUTHORS.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 22cfcc45..79f54a0b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -8,7 +8,7 @@ Contributors are users who submit a PR, Issue, or collaborates in making Marked To be listed here, just make a contribution and, if it has significant impact, the committers and publishers may be able to add you here. If you're name is here, and you would rather it not be, just let us know. -- Jamie Davis @davisjam - Thank you for the DOS contribution! +- Jamie Davis @davisjam - Thank you for the security-related contributions! - Костя Третяк @KostyaTretyak ## Committers diff --git a/README.md b/README.md index 7ce619a5..73453c64 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ By supporting the above Markdown flavors, it's possible that Marked can help you

    Security

    -The only completely secure system is the one that doesn't exist in the first place. Having said that, we take the security of Marked very seriously; however, none of us are necessarily security experts, so to speak. Therefore, if you find something, [say something](https://github.com/markedjs/marked/issues). +The only completely secure system is the one that doesn't exist in the first place. Having said that, we take the security of Marked very seriously; however, none of us are necessarily security experts, so to speak. Therefore, if you find something, [say something](https://github.com/markedjs/marked/issues), or, better yet, fix the thing! :)

    Contributing

    From 871ca4c412f62942d3225632747a0afa522f38b8 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 16:34:42 -0500 Subject: [PATCH 143/459] What we're good at --- AUTHORS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 79f54a0b..66d16040 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -15,8 +15,8 @@ To be listed here, just make a contribution and, if it has significant impact, t Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not they're own). -- Tony Brix @UziTech -- Federico Soave @Feder1co5oave +- Tony Brix @UziTech - really good at the test harness and environment setup +- Federico Soave @Feder1co5oave - really good at the regex things - Steven @styfle Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). From 97b730516479cbbf5747692c385432e85cac1e84 Mon Sep 17 00:00:00 2001 From: Jamie Davis Date: Mon, 26 Feb 2018 16:58:46 -0500 Subject: [PATCH 144/459] pretty test output Problem: On hangs, test output is hard to read. Solution: Print test name before starting. Bonus: Also print an approximation of how long each test takes to run. For #1084. --- test/index.js | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/test/index.js b/test/index.js index 994b9a8a..74d898d9 100644 --- a/test/index.js +++ b/test/index.js @@ -110,8 +110,13 @@ function runTests(engine, options) { for (i = 0; i < len; i++) { filename = filenames[i]; file = files[filename]; - success = testFile(engine, file, filename, i + 1); - if (success) { + + var before = process.hrtime(); + success = testFile(engine, file, filename, i + 1); // TODO Can't testFile throw? + var elapsed = process.hrtime(before); + var tookLessThanOneSec = (elapsed[0] === 0); + + if (success && tookLessThanOneSec) { succeeded++; } else { failed++; @@ -143,6 +148,10 @@ function testFile(engine, file, filename, index) { delete marked._original; } + console.log('#%d. Test %s.', index, filename); + + var before = process.hrtime(); + if (opts.length) { marked._original = marked.defaults; marked.defaults = {}; @@ -156,13 +165,24 @@ function testFile(engine, file, filename, index) { }); } + var threw = false; + var exceptionToThrow = null; try { text = engine(file.text).replace(/\s/g, ''); html = file.html.replace(/\s/g, ''); } catch (e) { - console.log('%s failed.', filename); - throw e; + threw = true; + exceptionToThrow = e; } + var elapsed = process.hrtime(before); + + var prettyElapsed = 'in ' + prettyElapsedTime(elapsed) + ' seconds'; + + // TODO Why do we throw this? + if (threw) { + console.log(' failed ' + prettyElapsed); + throw exceptionToThrow; + } l = html.length; @@ -177,7 +197,7 @@ function testFile(engine, file, filename, index) { Math.min(j + 30, l)); console.log( - '\n#%d. %s failed at offset %d. Near: "%s".\n', + '\n#%d. %s failed at offset %d ' + prettyElapsed + '. Near: "%s".\n', index, filename, j, text); console.log('\nGot:\n%s\n', text.trim() || text); @@ -187,8 +207,8 @@ function testFile(engine, file, filename, index) { } } - console.log('#%d. %s completed.', index, filename); - return true + console.log(' passed ' + prettyElapsed); + return true; } /** @@ -581,3 +601,10 @@ if (!module.parent) { exports.bench = bench; module.exports = exports; } + +// returns time to millisecond granularity +function prettyElapsedTime(hrtimeElapsed) { + var seconds = hrtimeElapsed[0]; + var fracInMs = Math.round(hrtimeElapsed[1] / 1e6); + return seconds + '.' + fracInMs; +} From 2953012840f148ee714bdeb041e1e0eab8fd0778 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Mon, 26 Feb 2018 16:23:55 -0600 Subject: [PATCH 145/459] test lint instead of fixing it in travis --- .travis.yml | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f4352ddf..8f089ff8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ script: | sed -i s/0o755/0755/ test/index.js; npm test; else - npm run lint && npm test; + npm run test:lint && npm test; fi cache: directories: diff --git a/package.json b/package.json index 58f83947..e336f744 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ }, "scripts": { "test": "node test", + "test:lint": "eslint lib/marked.js test/index.js", "bench": "node test --bench", "lint": "eslint --fix lib/marked.js test/index.js", "build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js", From b2922c95b383150b6440edbe411fa1dda5eab067 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 17:53:28 -0500 Subject: [PATCH 146/459] Switched out tabs for spaces --- test/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/index.js b/test/index.js index 74d898d9..920bf3e2 100644 --- a/test/index.js +++ b/test/index.js @@ -150,7 +150,7 @@ function testFile(engine, file, filename, index) { console.log('#%d. Test %s.', index, filename); - var before = process.hrtime(); + var before = process.hrtime(); if (opts.length) { marked._original = marked.defaults; @@ -179,10 +179,10 @@ function testFile(engine, file, filename, index) { var prettyElapsed = 'in ' + prettyElapsedTime(elapsed) + ' seconds'; // TODO Why do we throw this? - if (threw) { + if (threw) { console.log(' failed ' + prettyElapsed); - throw exceptionToThrow; - } + throw exceptionToThrow; + } l = html.length; From 35e3c2cb80b38a2cda1c944f0e48d5ffd1cd1305 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 18:22:13 -0500 Subject: [PATCH 147/459] Run lint tests with regular test suite See #1083 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e336f744..9f8c4c1a 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "uglify-js": "^3.3.10" }, "scripts": { - "test": "node test", + "test": "node test && npm run test:lint", "test:lint": "eslint lib/marked.js test/index.js", "bench": "node test --bench", "lint": "eslint --fix lib/marked.js test/index.js", From 5ed35de54e65f176f1b23c1767ef6cc9c699630c Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 18:27:45 -0500 Subject: [PATCH 148/459] typo --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 66d16040..90a452fd 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -13,7 +13,7 @@ To be listed here, just make a contribution and, if it has significant impact, t ## Committers -Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not they're own). +Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not their own). - Tony Brix @UziTech - really good at the test harness and environment setup - Federico Soave @Feder1co5oave - really good at the regex things From 3f7f7f817ad1e4b074d2f710d4d04120db2c1927 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 18:29:11 -0500 Subject: [PATCH 149/459] Expound on publishers responsibilities --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 90a452fd..10c8440a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -27,7 +27,7 @@ Admins are committers who also have the responsibility, privilege, and burden of ## Publishers -Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPMJS and performing outreach and external stakeholder communications. (Admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external issues.) +Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPMJS and performing outreach and external stakeholder communications. Also, when stuff goes pear-shaped, we're the ones who take the most heat. (Admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external issues.) - Josh Bruce @joshbruce From 67543024ff2c7df59bbb80ee0c07498168dc960c Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 18:33:29 -0500 Subject: [PATCH 150/459] Make sure running tests is part of contributing --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d9a3d55..8e0f8128 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,6 +5,7 @@ - [ ] Make sure you are on the `master` branch. - [ ] Create a branch. - [ ] Make as small a change as possible. +- [ ] Run `npm run test`, fix any broken things (for linting, you can run `npm run lint` to have the linter fix them for you). - [ ] Submit a PR. ## Design principles From d995d645a430a6b4d7b4c0e60f37601d72aed0f9 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 18:36:03 -0500 Subject: [PATCH 151/459] Don't need run --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e0f8128..90e728ce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ - [ ] Make sure you are on the `master` branch. - [ ] Create a branch. - [ ] Make as small a change as possible. -- [ ] Run `npm run test`, fix any broken things (for linting, you can run `npm run lint` to have the linter fix them for you). +- [ ] Run `npm test`, fix any broken things (for linting, you can run `npm run lint` to have the linter fix them for you). - [ ] Submit a PR. ## Design principles From 766d6c9a666635b9b9890e095f1017e80105ed60 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 18:37:26 -0500 Subject: [PATCH 152/459] Add test:lint and update lint --- CONTRIBUTING.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 90e728ce..11c99ea4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,13 +65,19 @@ To run the tests: npm test ``` +To test whether you are using the standard syntax rules for the project: + +```bash +npm run test:lint +``` + To see time comparisons between Marked and other popular Markdown libraries: ```bash npm run bench ``` -To check for proper syntax (lint): +To check for (and fix) standardized syntax (lint): ```bash npm run lint From 06b1df9b54c5e0d255521cb90761c65322abec8f Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Mon, 26 Feb 2018 17:58:43 -0600 Subject: [PATCH 153/459] clean up --- test/index.js | 44 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/test/index.js b/test/index.js index 920bf3e2..c2a861c4 100644 --- a/test/index.js +++ b/test/index.js @@ -110,13 +110,8 @@ function runTests(engine, options) { for (i = 0; i < len; i++) { filename = filenames[i]; file = files[filename]; - - var before = process.hrtime(); - success = testFile(engine, file, filename, i + 1); // TODO Can't testFile throw? - var elapsed = process.hrtime(before); - var tookLessThanOneSec = (elapsed[0] === 0); - - if (success && tookLessThanOneSec) { + success = testFile(engine, file, filename, i + 1); + if (success) { succeeded++; } else { failed++; @@ -141,16 +136,16 @@ function testFile(engine, file, filename, index) { text, html, j, - l; + l, + before, + elapsed; if (marked._original) { marked.defaults = marked._original; delete marked._original; } - console.log('#%d. Test %s.', index, filename); - - var before = process.hrtime(); + console.log('#%d. Test %s', index, filename); if (opts.length) { marked._original = marked.defaults; @@ -165,24 +160,17 @@ function testFile(engine, file, filename, index) { }); } - var threw = false; - var exceptionToThrow = null; + before = process.hrtime(); try { text = engine(file.text).replace(/\s/g, ''); html = file.html.replace(/\s/g, ''); } catch (e) { - threw = true; - exceptionToThrow = e; + elapsed = process.hrtime(before); + console.log(' failed in %dms', prettyElapsedTime(elapsed)); + throw e; } - var elapsed = process.hrtime(before); - var prettyElapsed = 'in ' + prettyElapsedTime(elapsed) + ' seconds'; - - // TODO Why do we throw this? - if (threw) { - console.log(' failed ' + prettyElapsed); - throw exceptionToThrow; - } + elapsed = process.hrtime(before); l = html.length; @@ -196,9 +184,7 @@ function testFile(engine, file, filename, index) { Math.max(j - 30, 0), Math.min(j + 30, l)); - console.log( - '\n#%d. %s failed at offset %d ' + prettyElapsed + '. Near: "%s".\n', - index, filename, j, text); + console.log(' failed in %dms at offset %d. Near: "%s".\n', prettyElapsedTime(elapsed), j, text); console.log('\nGot:\n%s\n', text.trim() || text); console.log('\nExpected:\n%s\n', html.trim() || html); @@ -207,7 +193,7 @@ function testFile(engine, file, filename, index) { } } - console.log(' passed ' + prettyElapsed); + console.log(' passed in %dms', prettyElapsedTime(elapsed)); return true; } @@ -605,6 +591,6 @@ if (!module.parent) { // returns time to millisecond granularity function prettyElapsedTime(hrtimeElapsed) { var seconds = hrtimeElapsed[0]; - var fracInMs = Math.round(hrtimeElapsed[1] / 1e6); - return seconds + '.' + fracInMs; + var frac = Math.round(hrtimeElapsed[1] / 1e3) / 1e3; + return seconds * 1e3 + frac; } From 4478d36aa5a8a6c6ec0a051ac88d82d8901bf5d7 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 20:54:43 -0500 Subject: [PATCH 154/459] Update users definition --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 10c8440a..da12fee2 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,6 +1,6 @@ ## Users -Users are anyone using Marked in some fashion. If you use Marked and would like to be added to a list of users, please do so. +Users are anyone using Marked in some fashion. If you use Marked and would like to be added to a list of users, please reach out and let us know and maybe we can add you here or elsewhere. ## Contributors From 14398fc64782c0942b644d1af61326544b3bb09c Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 20:56:48 -0500 Subject: [PATCH 155/459] grammar --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index da12fee2..b959e1ce 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -4,7 +4,7 @@ Users are anyone using Marked in some fashion. If you use Marked and would like ## Contributors -Contributors are users who submit a PR, Issue, or collaborates in making Marked a better product and experience for all the users. +Contributors are users who submit a PR, Issue, or collaborate in making Marked a better product and experience for all the users. To be listed here, just make a contribution and, if it has significant impact, the committers and publishers may be able to add you here. If you're name is here, and you would rather it not be, just let us know. From b15e42b67cec9ded8505e9d68bb8741ad7a9590d Mon Sep 17 00:00:00 2001 From: Jamie Davis Date: Mon, 26 Feb 2018 11:06:41 -0500 Subject: [PATCH 156/459] security: fix regexes vulnerable to catastrophic backtracking Problem: Four regexes were vulnerable to catastrophic backtracking. This leaves markdown servers open to a potential REDOS attack. Solution: Refactor the regexes. For two similar regexes (html) I didn't change the language. For two similar regexes (noline) I slightly changed the language: ![[[[[[[[[[[]] was accepted by the old noline pattern. It is now rejected. All tests pass, though I'm not sure if I've broken something that was untested. This addresses #1070 (with #1058 along the way). Bonus: rename a stray test to use _ instead of -. --- lib/marked.js | 8 ++++---- test/new/{headings-id.html => headings_id.html} | 0 test/new/{headings-id.md => headings_id.md} | 0 test/new/redos_html_closing.html | 0 test/new/redos_html_closing.md | 1 + test/new/redos_nolink.html | 0 test/new/redos_nolink.md | 1 + 7 files changed, 6 insertions(+), 4 deletions(-) rename test/new/{headings-id.html => headings_id.html} (100%) rename test/new/{headings-id.md => headings_id.md} (100%) create mode 100644 test/new/redos_html_closing.html create mode 100644 test/new/redos_html_closing.md create mode 100644 test/new/redos_nolink.html create mode 100644 test/new/redos_nolink.md diff --git a/lib/marked.js b/lib/marked.js index 5ca95941..a6a2bbe6 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -55,7 +55,7 @@ block._tag = '(?!(?:' block.html = edit(block.html) .replace('comment', //) .replace('closed', /<(tag)[\s\S]+?<\/\1>/) - .replace('closing', /]*)*?\/?>/) + .replace('closing', /\s]*)*?\/?>/) .replace(/tag/g, block._tag) .getRegex(); @@ -461,10 +461,10 @@ var inline = { escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, url: noop, - tag: /^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/]*)*?\/?>/, + tag: /^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/, link: /^!?\[(inside)\]\(href\)/, reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, - nolink: /^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/, + nolink: /^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/, strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, em: /^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/, code: /^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/, @@ -481,7 +481,7 @@ inline.autolink = edit(inline.autolink) .replace('email', inline._email) .getRegex() -inline._inside = /(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/; +inline._inside = /(?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/; inline._href = /\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/; inline.link = edit(inline.link) diff --git a/test/new/headings-id.html b/test/new/headings_id.html similarity index 100% rename from test/new/headings-id.html rename to test/new/headings_id.html diff --git a/test/new/headings-id.md b/test/new/headings_id.md similarity index 100% rename from test/new/headings-id.md rename to test/new/headings_id.md diff --git a/test/new/redos_html_closing.html b/test/new/redos_html_closing.html new file mode 100644 index 00000000..e69de29b diff --git a/test/new/redos_html_closing.md b/test/new/redos_html_closing.md new file mode 100644 index 00000000..65bc5f73 --- /dev/null +++ b/test/new/redos_html_closing.md @@ -0,0 +1 @@ +a'a diff --git a/test/new/redos_nolink.html b/test/new/redos_nolink.html new file mode 100644 index 00000000..e69de29b diff --git a/test/new/redos_nolink.md b/test/new/redos_nolink.md new file mode 100644 index 00000000..a43a1568 --- /dev/null +++ b/test/new/redos_nolink.md @@ -0,0 +1 @@ +![\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]\[[]!\ From 2846212bb025d483690b95a007994d0d027ed056 Mon Sep 17 00:00:00 2001 From: Jamie Davis Date: Mon, 26 Feb 2018 14:58:13 -0500 Subject: [PATCH 157/459] test: add time check Fail tests that take more than 1 second --- test/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index c2a861c4..b1f50fcc 100644 --- a/test/index.js +++ b/test/index.js @@ -110,8 +110,13 @@ function runTests(engine, options) { for (i = 0; i < len; i++) { filename = filenames[i]; file = files[filename]; + + var before = process.hrtime(); success = testFile(engine, file, filename, i + 1); - if (success) { + var elapsed = process.hrtime(before); + var tookLessThanOneSec = (elapsed[0] === 0); + + if (success && tookLessThanOneSec) { succeeded++; } else { failed++; From 321c50f17671f3783c7d6a68ef6d2588a6314b91 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 21:33:12 -0500 Subject: [PATCH 158/459] Update language of checklists to match AUTHORS --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++-- .github/PULL_REQUEST_TEMPLATE/release.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 76d86a98..b893892b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -32,13 +32,13 @@ Describe what code combination got you there --> -## Submitter +## Contributor - [ ] Test(s) exist to ensure functionality and minimize regresstion (if no tests added, list tests covering this PR); or, - [ ] no tests required for this PR. - [ ] If submitting new feature, it has been documented in the appropriate places. -## Reviewer +## Committer - [ ] Draft GitHub release notes have been updated. - [ ] case_insensitive_refs is only failing test (remove once CI is in place and all tests pass). diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index 504f01b6..715f2efe 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -1,4 +1,4 @@ -## Submitter +## Publisher - [ ] `$ npm version` has been run. - [ ] Release notes in [draft GitHub release](https://github.com/markedjs/marked/releases) are up to date @@ -14,7 +14,7 @@ Note: If merges to `master` occur after submitting this PR and before running `$ 2. run `$ npm run build` to regenerate the `min` file, and 3. commit and push the updated changes. -## Reviewer +## Committer - [ ] Version in `package.json` has been updated (see [RELEASE.md](https://github.com/markedjs/marked/blob/master/RELEASE.md)). - [ ] The `marked.min.js` has been updated; or, From 597222173df84486d8abf48594233e29c3842e0a Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 22:03:12 -0500 Subject: [PATCH 159/459] Add npm install to setting up local checklist --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 11c99ea4..83d2548e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,6 +3,7 @@ - [ ] Fork `markedjs/marked`. - [ ] Clone the library locally using GitHub Desktop or the command line. - [ ] Make sure you are on the `master` branch. +- [ ] Be sure to run `npm install` or `npm update`. - [ ] Create a branch. - [ ] Make as small a change as possible. - [ ] Run `npm test`, fix any broken things (for linting, you can run `npm run lint` to have the linter fix them for you). From 3e07a05807c2339a505fcdd742928f5967c1dc0c Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 22:24:30 -0500 Subject: [PATCH 160/459] Add intro and remove publishers metnion as all publishers are committers --- AUTHORS.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index b959e1ce..475ca832 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,3 +1,7 @@ +# Authors + +Marked takes an encompassing approach to its community. As such, you can think of these as [concentric circles](https://medium.com/the-node-js-collection/healthy-open-source-967fa8be7951), where each subsequent group is enveloped by the previous one. + ## Users Users are anyone using Marked in some fashion. If you use Marked and would like to be added to a list of users, please reach out and let us know and maybe we can add you here or elsewhere. @@ -6,7 +10,7 @@ Users are anyone using Marked in some fashion. If you use Marked and would like Contributors are users who submit a PR, Issue, or collaborate in making Marked a better product and experience for all the users. -To be listed here, just make a contribution and, if it has significant impact, the committers and publishers may be able to add you here. If you're name is here, and you would rather it not be, just let us know. +To be listed here, just make a contribution and, if it has significant impact, the committers may be able to add you here. If you're name is here, and you would rather it not be, just let us know. - Jamie Davis @davisjam - Thank you for the security-related contributions! - Костя Третяк @KostyaTretyak From 5c24d9bd81ecc4126c742fda97039a52874f4f28 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 22:27:22 -0500 Subject: [PATCH 161/459] Add links to Issues and PRs --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 475ca832..2e7b696c 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -8,7 +8,7 @@ Users are anyone using Marked in some fashion. If you use Marked and would like ## Contributors -Contributors are users who submit a PR, Issue, or collaborate in making Marked a better product and experience for all the users. +Contributors are users who submit a [PR](https://github.com/markedjs/marked/pulls), [Issue](https://github.com/markedjs/marked/issues), or collaborate in making Marked a better product and experience for all the users. To be listed here, just make a contribution and, if it has significant impact, the committers may be able to add you here. If you're name is here, and you would rather it not be, just let us know. From d0dc71e366a5a0c1fd1630983e9e62b3e642473b Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 26 Feb 2018 23:08:49 -0500 Subject: [PATCH 162/459] Use correct failing test - pretty sure it used to be case_insensitive_refs though --- .github/PULL_REQUEST_TEMPLATE/release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index 715f2efe..bf24c608 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -19,5 +19,5 @@ Note: If merges to `master` occur after submitting this PR and before running `$ - [ ] Version in `package.json` has been updated (see [RELEASE.md](https://github.com/markedjs/marked/blob/master/RELEASE.md)). - [ ] The `marked.min.js` has been updated; or, - [ ] release does not change library. -- [ ] case_insensitive_refs is only failing test (remove once CI is in place and all tests pass). +- [ ] cm_autolinks is only failing test (remove once CI is in place and all tests pass). - [ ] All lint checks pass (remove once CI is in place). From 7c19a690f6f05cbb2feb46bd7b58e7b184c3daa6 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 27 Feb 2018 00:20:58 -0500 Subject: [PATCH 163/459] Changing the voice for publishers section and minor grammar in admins --- AUTHORS.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 2e7b696c..297ea32f 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -27,11 +27,13 @@ Committers are usually selected from contributors who enter the discussions rega ## Admins -Admins are committers who also have the responsibility, privilege, and burden of selecting committers and making sure the project itself runs smoothly, which includes community maintenance, governance, dispute resolution, and so on. (Letting the contributors easily enter into the project and begin contributing, with minimal friction.) +Admins are committers who also have the responsibility, privilege, and burden of selecting committers and making sure the project itself runs smoothly, which includes community maintenance, governance, dispute resolution, and so on. (Letting the contributors easily enter into, and work within, the project to begin contributing, with as little friction as possible.) ## Publishers -Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPMJS and performing outreach and external stakeholder communications. Also, when stuff goes pear-shaped, we're the ones who take the most heat. (Admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external issues.) +Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPMJS and performing outreach and external stakeholder communications. Further, when things goes pear-shaped, they're the ones taking most of the heat. Finally, when things go well, they're the primary ones praising the contributors who made it possible. + +(In other words, while admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external concerns.) - Josh Bruce @joshbruce From 1f1ffbe97b643ff6cb18ce0aaee550b24611fee0 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 27 Feb 2018 00:27:22 -0500 Subject: [PATCH 164/459] A little more detail around CI things --- .github/PULL_REQUEST_TEMPLATE.md | 5 ++++- .github/PULL_REQUEST_TEMPLATE/release.md | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b893892b..c8d249d9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -40,7 +40,10 @@ Describe what code combination got you there ## Committer +In most cases, this should be a different person than the contributor. + - [ ] Draft GitHub release notes have been updated. -- [ ] case_insensitive_refs is only failing test (remove once CI is in place and all tests pass). +- [ ] cm_autolinks is the only failing test (remove once CI is in place and all tests pass). - [ ] All lint checks pass (remove once CI is in place). +- [ ] CI is green (no forced merge required). - [ ] Merge PR \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index bf24c608..8d417b7e 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -16,8 +16,11 @@ Note: If merges to `master` occur after submitting this PR and before running `$ ## Committer +In most cases, this should be someone different than the publisher. + - [ ] Version in `package.json` has been updated (see [RELEASE.md](https://github.com/markedjs/marked/blob/master/RELEASE.md)). - [ ] The `marked.min.js` has been updated; or, - [ ] release does not change library. -- [ ] cm_autolinks is only failing test (remove once CI is in place and all tests pass). +- [ ] cm_autolinks is the only failing test (remove once CI is in place and all tests pass). - [ ] All lint checks pass (remove once CI is in place). +- [ ] CI is green (no forced merge required). From 5dc9e0e54cb395753a485b5ef338db7947b3c07d Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 27 Feb 2018 08:04:27 -0500 Subject: [PATCH 165/459] Add snyk.io rep --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 297ea32f..cacc87bb 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -12,6 +12,7 @@ Contributors are users who submit a [PR](https://github.com/markedjs/marked/pull To be listed here, just make a contribution and, if it has significant impact, the committers may be able to add you here. If you're name is here, and you would rather it not be, just let us know. +- Karen Yavine @karenyavine - Thank you for helping keep us out of the security penalyt box! - Jamie Davis @davisjam - Thank you for the security-related contributions! - Костя Третяк @KostyaTretyak From 55c6581a716a4932ce3bfbe63ce35189003a963b Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 27 Feb 2018 08:05:36 -0500 Subject: [PATCH 166/459] Add git commands for updating master from upstream --- .github/PULL_REQUEST_TEMPLATE/release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index 8d417b7e..998acf22 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -10,7 +10,7 @@ Note: If merges to `master` occur after submitting this PR and before running `$ npm pubish` you should be able to -1. pull from `upstream/master` into the branch holding this version, +1. pull from `upstream/master` (`git pull upstream master`) into the branch holding this version, 2. run `$ npm run build` to regenerate the `min` file, and 3. commit and push the updated changes. From d69f14f22a983e089beceb997fa4a511177e65f5 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 27 Feb 2018 08:05:56 -0500 Subject: [PATCH 167/459] Update min --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index ac09b88a..f6c87ef6 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/chjj/marked */ -!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||k.defaults,this.rules=t.normal,this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",t.html=p(t.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/]*)*?\/?>/).replace(/tag/g,t._tag).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag","<"+t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._inside=/(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,r._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=p(r.link).replace("inside",r._inside).replace("href",r._href).getRegex(),r.reflink=p(r.reflink).replace("inside",r._inside).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=a(this.mangle(s[1]))):n=a(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^/i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):a(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(a(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(a(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=a(s[0])):(n=a(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},s.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:a(e,!0))+"\n
    \n":"
    "+(n?e:a(e,!0))+"\n
    "},i.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"'+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var s='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;eAn error occurred:

    "+a(e.message+"",!0)+"
    ";throw e}}f.exec=f,k.options=k.setOptions=function(e){return d(k.defaults,e),k},k.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1,baseUrl:null},k.Parser=o,k.parser=o.parse,k.Renderer=i,k.TextRenderer=l,k.Lexer=n,k.lexer=n.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.parse=k,"undefined"!=typeof module&&"object"==typeof exports?module.exports=k:"function"==typeof define&&define.amd?define(function(){return k}):e.marked=k}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||k.defaults,this.rules=t.normal,this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",t.html=p(t.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,t._tag).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag","<"+t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._inside=/(?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,r._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=p(r.link).replace("inside",r._inside).replace("href",r._href).getRegex(),r.reflink=p(r.reflink).replace("inside",r._inside).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=a(this.mangle(s[1]))):n=a(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):a(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(a(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(a(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=a(s[0])):(n=a(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},s.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:a(e,!0))+"\n
    \n":"
    "+(n?e:a(e,!0))+"\n
    "},i.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"'+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var s='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;eAn error occurred:

    "+a(e.message+"",!0)+"
    ";throw e}}f.exec=f,k.options=k.setOptions=function(e){return d(k.defaults,e),k},k.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1,baseUrl:null},k.Parser=o,k.parser=o.parse,k.Renderer=i,k.TextRenderer=l,k.Lexer=n,k.lexer=n.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.parse=k,"undefined"!=typeof module&&"object"==typeof exports?module.exports=k:"function"==typeof define&&define.amd?define(function(){return k}):e.marked=k}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file From fd150313b03f1daf55799ed84f5714c95b945abf Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 27 Feb 2018 08:14:43 -0500 Subject: [PATCH 168/459] fix broken link --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83d2548e..fe38b4b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -92,4 +92,4 @@ npm run build ## Releasing -Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [releasing documentation](https://github.com/markedjs/marked/blob/master/RELEASING.md). +Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [releasing documentation](https://github.com/markedjs/marked/blob/master/RELEASE.md). From fe5c110b2e22b7854f01b68f87352ce071575ce0 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 27 Feb 2018 13:16:03 -0500 Subject: [PATCH 169/459] Update security section --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 73453c64..09960f81 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,9 @@ By supporting the above Markdown flavors, it's possible that Marked can help you

    Security

    -The only completely secure system is the one that doesn't exist in the first place. Having said that, we take the security of Marked very seriously; however, none of us are necessarily security experts, so to speak. Therefore, if you find something, [say something](https://github.com/markedjs/marked/issues), or, better yet, fix the thing! :) +The only completely secure system is the one that doesn't exist in the first place. Having said that, we take the security of Marked very seriously. + +Therefore, please disclose potential security issues by email to the project [committers](https://github.com/markedjs/marked/blob/master/AUTHORS.md). We will provide an initial assessment of security reports within 48 hours and should apply patches within 2 weeks (also, feel free to contribute a fix for the issue).

    Contributing

    From 7d1afaf7c4ff6b260b3fd437a9f9214c4bad715e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 27 Feb 2018 13:27:29 -0500 Subject: [PATCH 170/459] Add listed owners as well --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09960f81..b6916eda 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ By supporting the above Markdown flavors, it's possible that Marked can help you The only completely secure system is the one that doesn't exist in the first place. Having said that, we take the security of Marked very seriously. -Therefore, please disclose potential security issues by email to the project [committers](https://github.com/markedjs/marked/blob/master/AUTHORS.md). We will provide an initial assessment of security reports within 48 hours and should apply patches within 2 weeks (also, feel free to contribute a fix for the issue). +Therefore, please disclose potential security issues by email to the project [committers](https://github.com/markedjs/marked/blob/master/AUTHORS.md) as well as the [listed owners within NPM](https://docs.npmjs.com/cli/owner). We will provide an initial assessment of security reports within 48 hours and should apply patches within 2 weeks (also, feel free to contribute a fix for the issue).

    Contributing

    From 7613bfad490f1d0a36ad0ba5dfed43bfa5abcca6 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 27 Feb 2018 23:53:56 -0500 Subject: [PATCH 171/459] Update contributing --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe38b4b4..2974e2fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,6 +56,10 @@ Marked provides templates for submitting both pull requests and issues. When you The PR templates include checklists for both the submitter and the reviewer, which, in most cases, will not be the same person. +## Submitting PRs continued + + + ## Scripts When it comes to NPM commands, we try to use the native scripts provided by the NPM framework. From 17ccd64fd3ef9fed98614d9c35d06530eaddd937 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 27 Feb 2018 23:55:34 -0500 Subject: [PATCH 172/459] Update contributing --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2974e2fa..577ae5ea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,7 +59,6 @@ The PR templates include checklists for both the submitter and the reviewer, whi ## Submitting PRs continued - ## Scripts When it comes to NPM commands, we try to use the native scripts provided by the NPM framework. From 144f3ea8e15f9976e6c1203b7243bb10c5f2402e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 09:14:06 -0500 Subject: [PATCH 173/459] Change to table layout and create titles --- AUTHORS.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index cacc87bb..f9de51c8 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -12,17 +12,25 @@ Contributors are users who submit a [PR](https://github.com/markedjs/marked/pull To be listed here, just make a contribution and, if it has significant impact, the committers may be able to add you here. If you're name is here, and you would rather it not be, just let us know. -- Karen Yavine @karenyavine - Thank you for helping keep us out of the security penalyt box! -- Jamie Davis @davisjam - Thank you for the security-related contributions! -- Костя Третяк @KostyaTretyak +|Name |GitHub handle |Title | +|:------------|:--------------|:---------------------------------------------------------------------| +|Karen Yavine |@karenyavine |Snyk's Security Saint (helps keep us out of the security penalty box) | +|Jamie Davis |@davisjam |Sultan of security | +|Костя Третяк |@KostyaTretyak |-- | + +- - Thank you for the security-related contributions! +- ## Committers Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not their own). -- Tony Brix @UziTech - really good at the test harness and environment setup -- Federico Soave @Feder1co5oave - really good at the regex things -- Steven @styfle +|Name |GiHub handle |Area(s) of decision making authority | +|:--------------|:--------------|:------------------------------------| +|Federico Soave |@Feder1co5oave |Regent of the Regex | +|Tony Brix |@UziTech |Titan of the test harness | +|Steven |@styfle |Open source, of course | +|?? |?? |Eye for the CLI | Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). @@ -36,7 +44,9 @@ Publishers are admins who also have the responsibility, privilege, and burden of (In other words, while admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external concerns.) -- Josh Bruce @joshbruce +|Name | GitHub handle |Area(s) of decision making authority | +|:----------|:--------------|:------------------------------------| +|Josh Bruce |@joshbruce |Humaning Helper | ## Original author From b11e79a7560d3a13597e91742cf1beb87bc1187c Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 09:22:11 -0500 Subject: [PATCH 174/459] Add Dr. DevOps --- AUTHORS.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index f9de51c8..6a37bb78 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -25,12 +25,12 @@ To be listed here, just make a contribution and, if it has significant impact, t Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not their own). -|Name |GiHub handle |Area(s) of decision making authority | -|:--------------|:--------------|:------------------------------------| -|Federico Soave |@Feder1co5oave |Regent of the Regex | -|Tony Brix |@UziTech |Titan of the test harness | -|Steven |@styfle |Open source, of course | -|?? |?? |Eye for the CLI | +|Name |GiHub handle |Area(s) of decision making authority | +|:--------------|:--------------|:-------------------------------------| +|Federico Soave |@Feder1co5oave |Regent of the Regex | +|Tony Brix |@UziTech |Titan of the test harness | +|Steven |@styfle |Open source, of course | +|?? |?? |Eye for the CLI, Dr. DevOps | Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). From 0e4ca1df9b07174b14d18408a2c7a0e45bd8b7cb Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 09:26:51 -0500 Subject: [PATCH 175/459] Add GitHub Guru title --- AUTHORS.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 6a37bb78..00f8f470 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -25,12 +25,12 @@ To be listed here, just make a contribution and, if it has significant impact, t Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not their own). -|Name |GiHub handle |Area(s) of decision making authority | -|:--------------|:--------------|:-------------------------------------| -|Federico Soave |@Feder1co5oave |Regent of the Regex | -|Tony Brix |@UziTech |Titan of the test harness | -|Steven |@styfle |Open source, of course | -|?? |?? |Eye for the CLI, Dr. DevOps | +|Name |GiHub handle |Area(s) of decision making authority | +|:--------------|:--------------|:--------------------------------------| +|Federico Soave |@Feder1co5oave |Regent of the Regex | +|Tony Brix |@UziTech |Titan of the test harness | +|Steven |@styfle |Open source, of course and GitHub Guru | +|?? |?? |Eye for the CLI, Dr. DevOps | Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). From dc54a0b78854164a3c80a1d8821d77ff871d5536 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 09:40:49 -0500 Subject: [PATCH 176/459] Establish path to becoming an admin --- AUTHORS.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 00f8f470..907e9704 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -12,25 +12,22 @@ Contributors are users who submit a [PR](https://github.com/markedjs/marked/pull To be listed here, just make a contribution and, if it has significant impact, the committers may be able to add you here. If you're name is here, and you would rather it not be, just let us know. -|Name |GitHub handle |Title | +|Name |GitHub handle |Title and knowledge | |:------------|:--------------|:---------------------------------------------------------------------| |Karen Yavine |@karenyavine |Snyk's Security Saint (helps keep us out of the security penalty box) | |Jamie Davis |@davisjam |Sultan of security | |Костя Третяк |@KostyaTretyak |-- | -- - Thank you for the security-related contributions! -- - ## Committers Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not their own). -|Name |GiHub handle |Area(s) of decision making authority | -|:--------------|:--------------|:--------------------------------------| -|Federico Soave |@Feder1co5oave |Regent of the Regex | -|Tony Brix |@UziTech |Titan of the test harness | -|Steven |@styfle |Open source, of course and GitHub Guru | -|?? |?? |Eye for the CLI, Dr. DevOps | +|Name |GiHub handle |Area(s) of decision making authority and knowledge | +|:--------------|:--------------|:--------------------------------------------------| +|Federico Soave |@Feder1co5oave |Regent of the Regex | +|Tony Brix |@UziTech |Titan of the test harness | +|Steven |@styfle |Open source, of course and GitHub Guru | +|?? |?? |Eye for the CLI, Dr. DevOps | Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). @@ -38,15 +35,17 @@ Committers are usually selected from contributors who enter the discussions rega Admins are committers who also have the responsibility, privilege, and burden of selecting committers and making sure the project itself runs smoothly, which includes community maintenance, governance, dispute resolution, and so on. (Letting the contributors easily enter into, and work within, the project to begin contributing, with as little friction as possible.) +Admins are usually selected from the pool of committers who demonstrate good understanding of the marked culture, operations, and do they're best to help new contributors up to speed on how to contribute effectively to the project. + ## Publishers Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPMJS and performing outreach and external stakeholder communications. Further, when things goes pear-shaped, they're the ones taking most of the heat. Finally, when things go well, they're the primary ones praising the contributors who made it possible. (In other words, while admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external concerns.) -|Name | GitHub handle |Area(s) of decision making authority | -|:----------|:--------------|:------------------------------------| -|Josh Bruce |@joshbruce |Humaning Helper | +|Name | GitHub handle |Area(s) of decision making authority and knowledge | +|:----------|:--------------|:--------------------------------------------------| +|Josh Bruce |@joshbruce |Humaning Helper and Product Owner | ## Original author From 60f8fc10deb27fc0bc0244fac8baafb94737ae4f Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 09:41:40 -0500 Subject: [PATCH 177/459] Typo --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 907e9704..e95f8efc 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -39,7 +39,7 @@ Admins are usually selected from the pool of committers who demonstrate good und ## Publishers -Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPMJS and performing outreach and external stakeholder communications. Further, when things goes pear-shaped, they're the ones taking most of the heat. Finally, when things go well, they're the primary ones praising the contributors who made it possible. +Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPMJS and performing outreach and external stakeholder communications. Further, when things go pear-shaped, they're the ones taking most of the heat. Finally, when things go well, they're the primary ones praising the contributors who made it possible. (In other words, while admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external concerns.) From 18a4619726011d79a0580abc42af2d114922a4de Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 28 Feb 2018 09:36:52 -0600 Subject: [PATCH 178/459] remove failing test for now --- test/new/{cm_autolinks.md => cm_autolinks.md.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/new/{cm_autolinks.md => cm_autolinks.md.bak} (100%) diff --git a/test/new/cm_autolinks.md b/test/new/cm_autolinks.md.bak similarity index 100% rename from test/new/cm_autolinks.md rename to test/new/cm_autolinks.md.bak From 8672c0c256c49dfccd3c420d3a6b61a359f70939 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 10:51:33 -0500 Subject: [PATCH 179/459] Adding more authority areas --- AUTHORS.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index e95f8efc..ee6461eb 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -27,7 +27,7 @@ Committers are contributors who also have the responsibility, privilege, some mi |Federico Soave |@Feder1co5oave |Regent of the Regex | |Tony Brix |@UziTech |Titan of the test harness | |Steven |@styfle |Open source, of course and GitHub Guru | -|?? |?? |Eye for the CLI, Dr. DevOps | +|?? |?? |Eye for the CLI, Dr. DevOps, Markdown Maestro | Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). @@ -43,9 +43,9 @@ Publishers are admins who also have the responsibility, privilege, and burden of (In other words, while admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external concerns.) -|Name | GitHub handle |Area(s) of decision making authority and knowledge | -|:----------|:--------------|:--------------------------------------------------| -|Josh Bruce |@joshbruce |Humaning Helper and Product Owner | +|Name | GitHub handle |Area(s) of decision making authority and knowledge | +|:----------|:--------------|:--------------------------------------------------------| +|Josh Bruce |@joshbruce |Humaning Helper, Heckler of Hypertext, and Product Owner | ## Original author From cdb2aba4769323bbbb09c1debac0c5c6d5228751 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 10:53:09 -0500 Subject: [PATCH 180/459] Add Markdown version to release notes --- .github/PULL_REQUEST_TEMPLATE/release.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index 998acf22..e2977517 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -2,6 +2,7 @@ - [ ] `$ npm version` has been run. - [ ] Release notes in [draft GitHub release](https://github.com/markedjs/marked/releases) are up to date +- [ ] Release notes include which flavors and versions of Markdown are supported by this release - [ ] Reviewer checklist is complete. - [ ] Merge PR. - [ ] Publish GitHub release using `master` with correct version number. From e11eb76bdeba5afc5931c237a8a825c85238ad4e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 10:56:02 -0500 Subject: [PATCH 181/459] Remove inclusion of submitting PRs --- CONTRIBUTING.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 577ae5ea..fe38b4b4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,9 +56,6 @@ Marked provides templates for submitting both pull requests and issues. When you The PR templates include checklists for both the submitter and the reviewer, which, in most cases, will not be the same person. -## Submitting PRs continued - - ## Scripts When it comes to NPM commands, we try to use the native scripts provided by the NPM framework. From 9386ea198cc85e137329cb82e6acd496dba5a671 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 11:31:51 -0500 Subject: [PATCH 182/459] Add @intcreator --- AUTHORS.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index ee6461eb..f011f8c4 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -12,11 +12,13 @@ Contributors are users who submit a [PR](https://github.com/markedjs/marked/pull To be listed here, just make a contribution and, if it has significant impact, the committers may be able to add you here. If you're name is here, and you would rather it not be, just let us know. -|Name |GitHub handle |Title and knowledge | -|:------------|:--------------|:---------------------------------------------------------------------| -|Karen Yavine |@karenyavine |Snyk's Security Saint (helps keep us out of the security penalty box) | -|Jamie Davis |@davisjam |Sultan of security | -|Костя Третяк |@KostyaTretyak |-- | +|Name |GitHub handle |Title and knowledge | +|:-------------------|:----------------|:---------------------------------------------------------------------| +|Karen Yavine |@karenyavine |Snyk's Security Saint (helps keep us out of the security penalty box) | +|Jamie Davis |@davisjam |Sultan of security | +|Federico Soave |@Feder1co5oave |Regent of the Regex | +|Brandon der Blätter |@intcreator |Curious Contributor (new contributor asking questions and suggesting things) | +|Костя Третяк |@KostyaTretyak |-- | ## Committers @@ -24,10 +26,9 @@ Committers are contributors who also have the responsibility, privilege, some mi |Name |GiHub handle |Area(s) of decision making authority and knowledge | |:--------------|:--------------|:--------------------------------------------------| -|Federico Soave |@Feder1co5oave |Regent of the Regex | -|Tony Brix |@UziTech |Titan of the test harness | +|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | |Steven |@styfle |Open source, of course and GitHub Guru | -|?? |?? |Eye for the CLI, Dr. DevOps, Markdown Maestro | +|?? |?? |Eye for the CLI, Markdown Maestro | Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). From 1ff244537b27c4152bc723f807c2afa033b102a5 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 28 Feb 2018 10:53:23 -0600 Subject: [PATCH 183/459] remove committer checkboxes --- .github/PULL_REQUEST_TEMPLATE.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c8d249d9..0b406981 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ - + ## Description @@ -28,22 +28,20 @@ Describe the output you received from marked ## What was attempted -Describe what code combination got you there +Describe what code combination got you there ---> +--> ## Contributor - [ ] Test(s) exist to ensure functionality and minimize regresstion (if no tests added, list tests covering this PR); or, - [ ] no tests required for this PR. - [ ] If submitting new feature, it has been documented in the appropriate places. - + ## Committer In most cases, this should be a different person than the contributor. - [ ] Draft GitHub release notes have been updated. -- [ ] cm_autolinks is the only failing test (remove once CI is in place and all tests pass). -- [ ] All lint checks pass (remove once CI is in place). - [ ] CI is green (no forced merge required). -- [ ] Merge PR \ No newline at end of file +- [ ] Merge PR From 6bba114fef81d127026c363a5feffbff6dfd1964 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 12:13:42 -0500 Subject: [PATCH 184/459] Add note about decision making authority --- AUTHORS.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index f011f8c4..34d55934 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -24,11 +24,13 @@ To be listed here, just make a contribution and, if it has significant impact, t Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not their own). -|Name |GiHub handle |Area(s) of decision making authority and knowledge | -|:--------------|:--------------|:--------------------------------------------------| -|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | -|Steven |@styfle |Open source, of course and GitHub Guru | -|?? |?? |Eye for the CLI, Markdown Maestro | +A note on "decision making authority". This is related to submitting PRs and the [advice process](http://www.reinventingorganizationswiki.com/Decision_Making). The person marked as having decision making authority over a certain area should be sought for advice in that area before committing to a course of action. + +|Name |GiHub handle |Area(s) of decision making authority and knowledge | +|:--------------|:--------------|:------------------------------------------------------| +|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | +|Steven |@styfle |Open source, of course and GitHub Guru | +|?? |?? |Eye for the CLI, Markdown Maestro, Regent of the Regex | Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). @@ -44,9 +46,9 @@ Publishers are admins who also have the responsibility, privilege, and burden of (In other words, while admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external concerns.) -|Name | GitHub handle |Area(s) of decision making authority and knowledge | -|:----------|:--------------|:--------------------------------------------------------| -|Josh Bruce |@joshbruce |Humaning Helper, Heckler of Hypertext, and Product Owner | +|Name | GitHub handle |Area(s) of decision making authority and knowledge | +|:----------|:--------------|:-----------------------------------------------------------| +|Josh Bruce |@joshbruce |Humaning Helper, Heckler of Hypertext, and Release Wrangler | ## Original author From 0c4d21c7ec1ff83e2df835662989dc381348311e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 12:15:04 -0500 Subject: [PATCH 185/459] Expound definition of Curious Contributor --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 34d55934..84952496 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -17,7 +17,7 @@ To be listed here, just make a contribution and, if it has significant impact, t |Karen Yavine |@karenyavine |Snyk's Security Saint (helps keep us out of the security penalty box) | |Jamie Davis |@davisjam |Sultan of security | |Federico Soave |@Feder1co5oave |Regent of the Regex | -|Brandon der Blätter |@intcreator |Curious Contributor (new contributor asking questions and suggesting things) | +|Brandon der Blätter |@intcreator |Curious Contributor (new contributor asking questions and suggesting things resulting in positive movement) | |Костя Третяк |@KostyaTretyak |-- | ## Committers From ed0b6a45d3313c415186cc59f1627cce2bf46312 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 12:54:27 -0500 Subject: [PATCH 186/459] Adding davisjam --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 84952496..47f6a57a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -15,7 +15,6 @@ To be listed here, just make a contribution and, if it has significant impact, t |Name |GitHub handle |Title and knowledge | |:-------------------|:----------------|:---------------------------------------------------------------------| |Karen Yavine |@karenyavine |Snyk's Security Saint (helps keep us out of the security penalty box) | -|Jamie Davis |@davisjam |Sultan of security | |Federico Soave |@Feder1co5oave |Regent of the Regex | |Brandon der Blätter |@intcreator |Curious Contributor (new contributor asking questions and suggesting things resulting in positive movement) | |Костя Третяк |@KostyaTretyak |-- | @@ -30,6 +29,7 @@ A note on "decision making authority". This is related to submitting PRs and the |:--------------|:--------------|:------------------------------------------------------| |Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | |Steven |@styfle |Open source, of course and GitHub Guru | +|Jamie Davis |@davisjam |Sultan of security | |?? |?? |Eye for the CLI, Markdown Maestro, Regent of the Regex | Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). From 2a9852dff7021b8ca99ca93186d605a1395ecfb0 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 13:05:17 -0500 Subject: [PATCH 187/459] Add Master of Marked badge --- AUTHORS.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 47f6a57a..6db4e2aa 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -15,7 +15,7 @@ To be listed here, just make a contribution and, if it has significant impact, t |Name |GitHub handle |Title and knowledge | |:-------------------|:----------------|:---------------------------------------------------------------------| |Karen Yavine |@karenyavine |Snyk's Security Saint (helps keep us out of the security penalty box) | -|Federico Soave |@Feder1co5oave |Regent of the Regex | +|Federico Soave |@Feder1co5oave |Regent of the Regex, Master of Marked (demonstrates extreme knowledge in how Marked works) | |Brandon der Blätter |@intcreator |Curious Contributor (new contributor asking questions and suggesting things resulting in positive movement) | |Костя Третяк |@KostyaTretyak |-- | @@ -25,12 +25,12 @@ Committers are contributors who also have the responsibility, privilege, some mi A note on "decision making authority". This is related to submitting PRs and the [advice process](http://www.reinventingorganizationswiki.com/Decision_Making). The person marked as having decision making authority over a certain area should be sought for advice in that area before committing to a course of action. -|Name |GiHub handle |Area(s) of decision making authority and knowledge | -|:--------------|:--------------|:------------------------------------------------------| -|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | -|Steven |@styfle |Open source, of course and GitHub Guru | -|Jamie Davis |@davisjam |Sultan of security | -|?? |?? |Eye for the CLI, Markdown Maestro, Regent of the Regex | +|Name |GiHub handle |Area(s) of decision making authority and knowledge | +|:--------------|:--------------|:------------------------------------------------------------------------| +|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | +|Steven |@styfle |Open source, of course and GitHub Guru | +|Jamie Davis |@davisjam |Sultan of security | +|?? |?? |Eye for the CLI, Markdown Maestro, Regent of the Regex, Master of Marked | Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). From adbaff55f23d3fa10525626e360a303912d4538d Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 13:08:51 -0500 Subject: [PATCH 188/459] Fixing typo before back to the day job --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 6db4e2aa..af6cb2d1 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -38,7 +38,7 @@ Committers are usually selected from contributors who enter the discussions rega Admins are committers who also have the responsibility, privilege, and burden of selecting committers and making sure the project itself runs smoothly, which includes community maintenance, governance, dispute resolution, and so on. (Letting the contributors easily enter into, and work within, the project to begin contributing, with as little friction as possible.) -Admins are usually selected from the pool of committers who demonstrate good understanding of the marked culture, operations, and do they're best to help new contributors up to speed on how to contribute effectively to the project. +Admins are usually selected from the pool of committers who demonstrate good understanding of the marked culture, operations, and do their best to help new contributors up to speed on how to contribute effectively to the project. ## Publishers From f73461df60fa385c5d76c760c21a1430a8d8ae39 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 13:29:48 -0500 Subject: [PATCH 189/459] Update methods for entry and exit of users, contributors, committers, and admins --- AUTHORS.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index af6cb2d1..09cbf23d 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -4,14 +4,16 @@ Marked takes an encompassing approach to its community. As such, you can think o ## Users -Users are anyone using Marked in some fashion. If you use Marked and would like to be added to a list of users, please reach out and let us know and maybe we can add you here or elsewhere. +Users are anyone using Marked in some fashion. + +To be listed: please let us know or submit a PR. + +To be removed: please let us know or submit a PR. ## Contributors Contributors are users who submit a [PR](https://github.com/markedjs/marked/pulls), [Issue](https://github.com/markedjs/marked/issues), or collaborate in making Marked a better product and experience for all the users. -To be listed here, just make a contribution and, if it has significant impact, the committers may be able to add you here. If you're name is here, and you would rather it not be, just let us know. - |Name |GitHub handle |Title and knowledge | |:-------------------|:----------------|:---------------------------------------------------------------------| |Karen Yavine |@karenyavine |Snyk's Security Saint (helps keep us out of the security penalty box) | @@ -19,6 +21,10 @@ To be listed here, just make a contribution and, if it has significant impact, t |Brandon der Blätter |@intcreator |Curious Contributor (new contributor asking questions and suggesting things resulting in positive movement) | |Костя Третяк |@KostyaTretyak |-- | +To be listed: make a contribution and, if it has significant impact, the committers may be able to add you here. + +To be removed: please let us know or submit a PR. + ## Committers Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not their own). @@ -29,22 +35,26 @@ A note on "decision making authority". This is related to submitting PRs and the |:--------------|:--------------|:------------------------------------------------------------------------| |Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | |Steven |@styfle |Open source, of course and GitHub Guru | -|Jamie Davis |@davisjam |Sultan of security | +|Jamie Davis |@davisjam |Sultan of Security | |?? |?? |Eye for the CLI, Markdown Maestro, Regent of the Regex, Master of Marked | -Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). +To be listed: Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). + +To be removed: You can remove yourself through the [GitHub UI](https://help.github.com/articles/removing-yourself-from-a-collaborator-s-repository/). ## Admins Admins are committers who also have the responsibility, privilege, and burden of selecting committers and making sure the project itself runs smoothly, which includes community maintenance, governance, dispute resolution, and so on. (Letting the contributors easily enter into, and work within, the project to begin contributing, with as little friction as possible.) -Admins are usually selected from the pool of committers who demonstrate good understanding of the marked culture, operations, and do their best to help new contributors up to speed on how to contribute effectively to the project. +To be listed: Admins are usually selected from the pool of committers who demonstrate good understanding of the marked culture, operations, and do their best to help new contributors get up to speed on how to contribute effectively to the project. + +To removed: You can remove yourself through the [GitHub UI](https://help.github.com/articles/removing-yourself-from-a-collaborator-s-repository/). ## Publishers Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPMJS and performing outreach and external stakeholder communications. Further, when things go pear-shaped, they're the ones taking most of the heat. Finally, when things go well, they're the primary ones praising the contributors who made it possible. -(In other words, while admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external concerns.) +(In other words, while Admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external concerns.) |Name | GitHub handle |Area(s) of decision making authority and knowledge | |:----------|:--------------|:-----------------------------------------------------------| From a4ed51a7c2b2d713aeedf3cfa7e7d0fd5350055b Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 13:39:26 -0500 Subject: [PATCH 190/459] Changed sultan to seeker...not sure how PC we want to be --- AUTHORS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 09cbf23d..a404589e 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -35,7 +35,7 @@ A note on "decision making authority". This is related to submitting PRs and the |:--------------|:--------------|:------------------------------------------------------------------------| |Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | |Steven |@styfle |Open source, of course and GitHub Guru | -|Jamie Davis |@davisjam |Sultan of Security | +|Jamie Davis |@davisjam |Seeker of Security | |?? |?? |Eye for the CLI, Markdown Maestro, Regent of the Regex, Master of Marked | To be listed: Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). @@ -48,7 +48,7 @@ Admins are committers who also have the responsibility, privilege, and burden of To be listed: Admins are usually selected from the pool of committers who demonstrate good understanding of the marked culture, operations, and do their best to help new contributors get up to speed on how to contribute effectively to the project. -To removed: You can remove yourself through the [GitHub UI](https://help.github.com/articles/removing-yourself-from-a-collaborator-s-repository/). +To be removed: You can remove yourself through the [GitHub UI](https://help.github.com/articles/removing-yourself-from-a-collaborator-s-repository/). ## Publishers From cac486339625916433c28c6afec9de3c9797d71d Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:25:21 -0500 Subject: [PATCH 191/459] Gamification of authors and badges --- .github/PULL_REQUEST_TEMPLATE.md | 4 +- .github/PULL_REQUEST_TEMPLATE/badges.md | 37 ++++++++++ AUTHORS.md | 89 ++++++++++++++++++++----- 3 files changed, 112 insertions(+), 18 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE/badges.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0b406981..e732e15d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,9 @@ If release PR, add ?template=release.md to the PR url to use the release PR template. - Otherwise, you are stating the this PR fixes an issue that has been submitted; or, + If related to badging, add ?template=badges.md to the PR url to use the badges PR template. + + Otherwise, you are stating this PR fixes an issue that has been submitted; or, describes the issue or proposal under considersation. --> diff --git a/.github/PULL_REQUEST_TEMPLATE/badges.md b/.github/PULL_REQUEST_TEMPLATE/badges.md new file mode 100644 index 00000000..c5a622af --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/badges.md @@ -0,0 +1,37 @@ +**@mention the contributor:** + +This is a recommendation to: + +- [ ] Add a badge +- [ ] Remove a badge + + + +If you're the one mentioned in this PR: + +- [ ] Submit a comment on whether you will accept the badge or not; or, +- [ ] whether you will or will not dispute the recommendation to remove. + + + +Note: All committers must approve via review before mergining. \ No newline at end of file diff --git a/AUTHORS.md b/AUTHORS.md index a404589e..e4d21a0b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -4,7 +4,7 @@ Marked takes an encompassing approach to its community. As such, you can think o ## Users -Users are anyone using Marked in some fashion. +Users are anyone using Marked in some fashion, without them, there's no reason for us to exist. To be listed: please let us know or submit a PR. @@ -14,12 +14,12 @@ To be removed: please let us know or submit a PR. Contributors are users who submit a [PR](https://github.com/markedjs/marked/pulls), [Issue](https://github.com/markedjs/marked/issues), or collaborate in making Marked a better product and experience for all the users. -|Name |GitHub handle |Title and knowledge | -|:-------------------|:----------------|:---------------------------------------------------------------------| -|Karen Yavine |@karenyavine |Snyk's Security Saint (helps keep us out of the security penalty box) | -|Federico Soave |@Feder1co5oave |Regent of the Regex, Master of Marked (demonstrates extreme knowledge in how Marked works) | -|Brandon der Blätter |@intcreator |Curious Contributor (new contributor asking questions and suggesting things resulting in positive movement) | -|Костя Третяк |@KostyaTretyak |-- | +|Name |GitHub handle |Badge of honor | +|:-------------------|:----------------|:-------------------------------------| +|Karen Yavine |@karenyavine |Snyk's Security Saint | +|Federico Soave |@Feder1co5oave |Regent of the Regex, Master of Marked | +|Brandon der Blätter |@intcreator |Curious Contributor | +|Костя Третяк |@KostyaTretyak |-- | To be listed: make a contribution and, if it has significant impact, the committers may be able to add you here. @@ -31,12 +31,11 @@ Committers are contributors who also have the responsibility, privilege, some mi A note on "decision making authority". This is related to submitting PRs and the [advice process](http://www.reinventingorganizationswiki.com/Decision_Making). The person marked as having decision making authority over a certain area should be sought for advice in that area before committing to a course of action. -|Name |GiHub handle |Area(s) of decision making authority and knowledge | -|:--------------|:--------------|:------------------------------------------------------------------------| -|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | -|Steven |@styfle |Open source, of course and GitHub Guru | -|Jamie Davis |@davisjam |Seeker of Security | -|?? |?? |Eye for the CLI, Markdown Maestro, Regent of the Regex, Master of Marked | +|Name |GiHub handle |Decision making |Badges of honor (tag for questions) | +|:--------------|:--------------|:----------------------------------------|------------------------------------| +|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | | +|Steven |@styfle |Open source, of course and GitHub Guru | | +|Jamie Davis |@davisjam |Seeker of Security | | To be listed: Committers are usually selected from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). @@ -56,12 +55,68 @@ Publishers are admins who also have the responsibility, privilege, and burden of (In other words, while Admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external concerns.) -|Name | GitHub handle |Area(s) of decision making authority and knowledge | -|:----------|:--------------|:-----------------------------------------------------------| -|Josh Bruce |@joshbruce |Humaning Helper, Heckler of Hypertext, and Release Wrangler | +|Name |GitHub handle |Decision making |Badges of honor (tag for questions) | +|:----------|:--------------|:------------------------|:-------------------------------------| +|Josh Bruce |@joshbruce |Release Wrangler |Humaning Helper, Heckler of Hypertext | ## Original author The original author is the publisher who started it all. -Christopher Jeffrey @chjj +|Christopher Jeffrey @chjj + +

    Badges

    + +Badges? You don't *need* no stinkin' badges. Movie references aside. (It was either that or, "Let's play a game", but that would have been creepy…that's why it will most likely come later.) + +If you *want* 'em, we got 'em, and here's how you get 'em (and…dramatic paus…why not two?… how they can be taken away). + +1. Adding the appropriate badge to the desired contributor in the desired column, even if they're not listed here yet. +2. Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). +3. Follow the instructions for submitting a badge PR. (There are more details to find within.) + +Badges at play: + +
    +
    Curious Contributor
    +
    A contributor with less than one year on this page who is actively engaged in submitting PRs, Issues, making recommendations, sharing thoughts…without being too annoying about it (let's be clear, submitting 100 Issues recommending the Marked Committers send everyone candy is trying for the badge, not honestly earning it).
    +
    Dr. DevOps
    +
    +

    Someone who understands and contributes to improving the developer experience and flow of Marked into the world.

    +
    + "The main characteristic of the DevOps movement is to strongly advocate automation and monitoring at all steps of software construction, from integration, testing, releasing to deployment and infrastructure management. DevOps aims at shorter development cycles, increased deployment frequency, more dependable releases, in close alignment with business objectives." ~[Wikipedia](https://en.wikipedia.org/wiki/DevOps) +
    +
    +
    Eye for the CLI
    +
    At this point? Pretty much anyone who can update that `man` file to the current Marked version without regression in the CLI tool itself.
    +
    GitHub Guru
    +
    Someone who always seems to be able to tell you easier ways to do things with GitHub.
    +
    Humaning Helper
    +
    Someone who goes out of their way to help contributors feel welcomed and valued. Further, someone who take the extra steps(s) necessary to help new contributors get up to speped. Finally, they maintain composure even in times of disagreement and dispute settlement.
    +
    Heckler of Hypertext
    +
    Someone who demonstrates an esoteric level of knowledge when it comes to HTML. In other words, someone who says things like, "Did you know most Markdown flavors don't have a way to render a description list (`dl`)? All the more reason Markdown `!==` HTML."
    +
    Markdown Maestro
    +
    You know that person who knows about way too many different flavors of Markdown? The one who maybe seems a little too obsessed with the possibilities of Markdown beyond HTML? Come on. You know who they are. Or, at least you could, if you give them this badge.
    +
    Master of Marked
    +
    Someone who demonstrates knows the ins and outs of the codebase for Marked.
    +
    Open source, of course
    +
    Someone who advocates for and has a proven understanding of how to operate within open source communities.
    +
    Regent of the Regex
    +

    Can you demonstrate you understand the following without Google and Stackoverflow?

    +

    /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/

    +

    Because this author can't yet. That's who gets these.

    +
    +
    Seeker of Security
    +
    Someone who has demonstrated a high degree of expertise or authority when it comes to software security.
    +
    Titan of the Test Harness
    +
    Someone who demonstrates high-levels of understanding regarding Marked's test harness.
    +
    + +Special badges that come with the job: + +
    +
    Release Wrangler
    +
    This is a badge given to all Publishers.
    +
    Snyk's Security Saint
    +
    This is a badge given to whomever primarily reaches out from Snyk to let us know about security issues.
    +
    From 967adbc387e1527391a4ab0c546909cfd9c5fa8e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:27:20 -0500 Subject: [PATCH 192/459] Inline anchors and minor correction --- AUTHORS.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index e4d21a0b..fa192018 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -25,6 +25,8 @@ To be listed: make a contribution and, if it has significant impact, the committ To be removed: please let us know or submit a PR. +[Details on badges](#badges) + ## Committers Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not their own). @@ -41,6 +43,8 @@ To be listed: Committers are usually selected from contributors who enter the di To be removed: You can remove yourself through the [GitHub UI](https://help.github.com/articles/removing-yourself-from-a-collaborator-s-repository/). +[Details on badges](#badges) + ## Admins Admins are committers who also have the responsibility, privilege, and burden of selecting committers and making sure the project itself runs smoothly, which includes community maintenance, governance, dispute resolution, and so on. (Letting the contributors easily enter into, and work within, the project to begin contributing, with as little friction as possible.) @@ -49,6 +53,8 @@ To be listed: Admins are usually selected from the pool of committers who demons To be removed: You can remove yourself through the [GitHub UI](https://help.github.com/articles/removing-yourself-from-a-collaborator-s-repository/). +[Details on badges](#badges) + ## Publishers Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPMJS and performing outreach and external stakeholder communications. Further, when things go pear-shaped, they're the ones taking most of the heat. Finally, when things go well, they're the primary ones praising the contributors who made it possible. @@ -59,11 +65,13 @@ Publishers are admins who also have the responsibility, privilege, and burden of |:----------|:--------------|:------------------------|:-------------------------------------| |Josh Bruce |@joshbruce |Release Wrangler |Humaning Helper, Heckler of Hypertext | +[Details on badges](#badges) + ## Original author The original author is the publisher who started it all. -|Christopher Jeffrey @chjj +Christopher Jeffrey @chjj

    Badges

    From 0ab725380374934fbca17f9dfef74db5225a3209 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:28:21 -0500 Subject: [PATCH 193/459] Make new paragraph --- AUTHORS.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index fa192018..b3d30e6b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -75,7 +75,9 @@ Christopher Jeffrey @chjj

    Badges

    -Badges? You don't *need* no stinkin' badges. Movie references aside. (It was either that or, "Let's play a game", but that would have been creepy…that's why it will most likely come later.) +Badges? You don't *need* no stinkin' badges. + +Movie references aside. (It was either that or, "Let's play a game", but that would have been creepy…that's why it will most likely come later.) If you *want* 'em, we got 'em, and here's how you get 'em (and…dramatic paus…why not two?… how they can be taken away). From 56e1bc07cb99f1ec33e733b231c4bf9fe889ebbc Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:29:42 -0500 Subject: [PATCH 194/459] Minor comdey --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index b3d30e6b..2c3bf6b2 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -79,7 +79,7 @@ Badges? You don't *need* no stinkin' badges. Movie references aside. (It was either that or, "Let's play a game", but that would have been creepy…that's why it will most likely come later.) -If you *want* 'em, we got 'em, and here's how you get 'em (and…dramatic paus…why not two?… how they can be taken away). +If you *want* 'em, we got 'em, and here's how you get 'em (and…dramatic pause…why not two dramatic pauses for emphasis?… how they can be taken away). 1. Adding the appropriate badge to the desired contributor in the desired column, even if they're not listed here yet. 2. Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). From 03dcc2655d27cb90c91cfcb744ac9d0a7633c404 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:30:17 -0500 Subject: [PATCH 195/459] Adding to add --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 2c3bf6b2..584a7c2f 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -81,7 +81,7 @@ Movie references aside. (It was either that or, "Let's play a game", but that wo If you *want* 'em, we got 'em, and here's how you get 'em (and…dramatic pause…why not two dramatic pauses for emphasis?… how they can be taken away). -1. Adding the appropriate badge to the desired contributor in the desired column, even if they're not listed here yet. +1. Add the appropriate badge to the desired contributor in the desired column, even if they're not listed here yet. 2. Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). 3. Follow the instructions for submitting a badge PR. (There are more details to find within.) From 8328e06dd58693eded2f1b64e7e1dd223873bbea Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:32:02 -0500 Subject: [PATCH 196/459] Make task list --- AUTHORS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 584a7c2f..5d156b98 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -81,9 +81,9 @@ Movie references aside. (It was either that or, "Let's play a game", but that wo If you *want* 'em, we got 'em, and here's how you get 'em (and…dramatic pause…why not two dramatic pauses for emphasis?… how they can be taken away). -1. Add the appropriate badge to the desired contributor in the desired column, even if they're not listed here yet. -2. Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). -3. Follow the instructions for submitting a badge PR. (There are more details to find within.) +- [ ] Add the appropriate badge to the desired contributor in the desired column, even if they're not listed here yet. +- [ ] Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). +- [ ] Follow the instructions for submitting a badge PR. (There are more details to find within. Come on. Everybody likes surprise right? Actually, we just try to put documentation where it belongs, closer to the code and part of the sequence of events.) Badges at play: From d9107eca78b0a2577a09ddc19d998180cfd4fb41 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:33:06 -0500 Subject: [PATCH 197/459] Change to ordered list --- AUTHORS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 5d156b98..56419cd6 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -81,9 +81,9 @@ Movie references aside. (It was either that or, "Let's play a game", but that wo If you *want* 'em, we got 'em, and here's how you get 'em (and…dramatic pause…why not two dramatic pauses for emphasis?… how they can be taken away). -- [ ] Add the appropriate badge to the desired contributor in the desired column, even if they're not listed here yet. -- [ ] Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). -- [ ] Follow the instructions for submitting a badge PR. (There are more details to find within. Come on. Everybody likes surprise right? Actually, we just try to put documentation where it belongs, closer to the code and part of the sequence of events.) +1. [ ] Add the appropriate badge to the desired contributor in the desired column, even if they're not listed here yet. +2. [ ] Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). +3. [ ] Follow the instructions for submitting a badge PR. (There are more details to find within. Come on. Everybody likes surprise right? Actually, we just try to put documentation where it belongs, closer to the code and part of the sequence of events.) Badges at play: From cfec9baa64d6e6b8811ff7fb927a23814ba7d774 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:33:38 -0500 Subject: [PATCH 198/459] Well, unordered lists don't work...bummer --- AUTHORS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 56419cd6..5d156b98 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -81,9 +81,9 @@ Movie references aside. (It was either that or, "Let's play a game", but that wo If you *want* 'em, we got 'em, and here's how you get 'em (and…dramatic pause…why not two dramatic pauses for emphasis?… how they can be taken away). -1. [ ] Add the appropriate badge to the desired contributor in the desired column, even if they're not listed here yet. -2. [ ] Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). -3. [ ] Follow the instructions for submitting a badge PR. (There are more details to find within. Come on. Everybody likes surprise right? Actually, we just try to put documentation where it belongs, closer to the code and part of the sequence of events.) +- [ ] Add the appropriate badge to the desired contributor in the desired column, even if they're not listed here yet. +- [ ] Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). +- [ ] Follow the instructions for submitting a badge PR. (There are more details to find within. Come on. Everybody likes surprise right? Actually, we just try to put documentation where it belongs, closer to the code and part of the sequence of events.) Badges at play: From 1164b5233608960fd1c79286417cb37125b47e74 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:34:44 -0500 Subject: [PATCH 199/459] Minor grammar --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 5d156b98..88e7d078 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -83,7 +83,7 @@ If you *want* 'em, we got 'em, and here's how you get 'em (and…dramatic p - [ ] Add the appropriate badge to the desired contributor in the desired column, even if they're not listed here yet. - [ ] Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). -- [ ] Follow the instructions for submitting a badge PR. (There are more details to find within. Come on. Everybody likes surprise right? Actually, we just try to put documentation where it belongs, closer to the code and part of the sequence of events.) +- [ ] Follow the instructions for submitting a badge PR. (There are more details to find within. Come on. Everybody likes surprises, right? No? Actually, we just try to put documentation where it belongs, closer to the code and part of the sequence of events.) Badges at play: From 962b41b6a042b90242bc28ad66e1a4473dfb74c4 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:37:03 -0500 Subject: [PATCH 200/459] Typos --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 88e7d078..385ffd2e 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -102,7 +102,7 @@ Badges at play:
    GitHub Guru
    Someone who always seems to be able to tell you easier ways to do things with GitHub.
    Humaning Helper
    -
    Someone who goes out of their way to help contributors feel welcomed and valued. Further, someone who take the extra steps(s) necessary to help new contributors get up to speped. Finally, they maintain composure even in times of disagreement and dispute settlement.
    +
    Someone who goes out of their way to help contributors feel welcomed and valued. Further, someone who takes the extra steps(s) necessary to help new contributors get up to speed. Finally, they maintain composure even in times of disagreement and dispute resolution.
    Heckler of Hypertext
    Someone who demonstrates an esoteric level of knowledge when it comes to HTML. In other words, someone who says things like, "Did you know most Markdown flavors don't have a way to render a description list (`dl`)? All the more reason Markdown `!==` HTML."
    Markdown Maestro
    From 1e34ae2005f4ff1dea01aa4207f2ce83157deef9 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:38:25 -0500 Subject: [PATCH 201/459] Typo --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 385ffd2e..d9306e83 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -108,7 +108,7 @@ Badges at play:
    Markdown Maestro
    You know that person who knows about way too many different flavors of Markdown? The one who maybe seems a little too obsessed with the possibilities of Markdown beyond HTML? Come on. You know who they are. Or, at least you could, if you give them this badge.
    Master of Marked
    -
    Someone who demonstrates knows the ins and outs of the codebase for Marked.
    +
    Someone who demonstrates they know the ins and outs of the codebase for Marked.
    Open source, of course
    Someone who advocates for and has a proven understanding of how to operate within open source communities.
    Regent of the Regex
    From a1b44047753cbd2f101e352df370ee2be961843f Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:41:33 -0500 Subject: [PATCH 202/459] Removing a badge reasons --- .github/PULL_REQUEST_TEMPLATE/badges.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE/badges.md b/.github/PULL_REQUEST_TEMPLATE/badges.md index c5a622af..5c157736 100644 --- a/.github/PULL_REQUEST_TEMPLATE/badges.md +++ b/.github/PULL_REQUEST_TEMPLATE/badges.md @@ -32,6 +32,12 @@ If you're the one mentioned in this PR: Anyway, you get the idea. This isn't about good or bad...it's just about giving the community a simple game mechanic by which to publicly say, "Thank you" or "Here's what my status is" in the community or "Hey, I think something's wrong here" in a civil manner. + Why would you want to remove someone's badge? Loads of reasons... + + 1. Maybe they have decision making authority on something. You asked for their advice. And, you ended up waiting almost a month before receiving a response. + 2. Maybe it was relevant at the time (Master of Marked) but you think they've lost their former level of skill (fell out of practice, for example). They could always get it back. + 3. Maybe to signal to them that, "Hey, you seem to have forgotten about us. Are you still around (or alive)?" + --> Note: All committers must approve via review before mergining. \ No newline at end of file From 327275c5a48482ced47beb1a09985c93c8d63150 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:48:00 -0500 Subject: [PATCH 203/459] DRI for merging the badge PR --- .github/PULL_REQUEST_TEMPLATE/badges.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/badges.md b/.github/PULL_REQUEST_TEMPLATE/badges.md index 5c157736..f995535b 100644 --- a/.github/PULL_REQUEST_TEMPLATE/badges.md +++ b/.github/PULL_REQUEST_TEMPLATE/badges.md @@ -15,29 +15,31 @@ This is a recommendation to: If you're the one mentioned in this PR: -- [ ] Submit a comment on whether you will accept the badge or not; or, -- [ ] whether you will or will not dispute the recommendation to remove. +- [ ] whether you will accept the badge or not; or, +- [ ] whether you will or will not dispute the recommendation to remove + +within 30 days (silence is consent at this point, can't have the pull requests page filled with PRs related to badges forever). -Note: All committers must approve via review before mergining. \ No newline at end of file +Note: All committers must approve via review before merging, the disapproving committer can simply close the PR. \ No newline at end of file From ee0a2ac9b50b1b93fa6cf6d1c87aaef7d1ee1679 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:49:00 -0500 Subject: [PATCH 204/459] Minor phrasing --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e732e15d..f0b0a110 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ If release PR, add ?template=release.md to the PR url to use the release PR template. - If related to badging, add ?template=badges.md to the PR url to use the badges PR template. + If badging PR, add ?template=badges.md to the PR url to use the badges PR template. Otherwise, you are stating this PR fixes an issue that has been submitted; or, describes the issue or proposal under considersation. From d2c81548a2f179c992eea20eb28cf73dd3f057a7 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:50:31 -0500 Subject: [PATCH 205/459] Add further instruction --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f0b0a110..a7c85031 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,7 +6,7 @@ If badging PR, add ?template=badges.md to the PR url to use the badges PR template. Otherwise, you are stating this PR fixes an issue that has been submitted; or, - describes the issue or proposal under considersation. + describes the issue or proposal under considersation and contains the project-related code to implement. --> From 0b05047b9105ffe47fb1c917221462f1114ed8d1 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 28 Feb 2018 23:51:19 -0500 Subject: [PATCH 206/459] Add instructions --- .github/PULL_REQUEST_TEMPLATE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a7c85031..2e4aeab8 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -20,6 +20,8 @@ /).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,t._tag).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag","<"+t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._inside=/(?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,r._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=p(r.link).replace("inside",r._inside).replace("href",r._href).getRegex(),r.reflink=p(r.reflink).replace("inside",r._inside).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=a(this.mangle(s[1]))):n=a(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):a(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(a(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(a(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=a(s[0])):(n=a(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},s.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:a(e,!0))+"\n
    \n":"
    "+(n?e:a(e,!0))+"\n
    "},i.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"'+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var s='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;eAn error occurred:

    "+a(e.message+"",!0)+"
    ";throw e}}f.exec=f,k.options=k.setOptions=function(e){return d(k.defaults,e),k},k.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1,baseUrl:null},k.Parser=o,k.parser=o.parse,k.Renderer=i,k.TextRenderer=l,k.Lexer=n,k.lexer=n.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.parse=k,"undefined"!=typeof module&&"object"==typeof exports?module.exports=k:"function"==typeof define&&define.amd?define(function(){return k}):e.marked=k}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||k.defaults,this.rules=t.normal,this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",t.html=p(t.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,t._tag).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag","<"+t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._inside=/(?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,r._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=p(r.link).replace("inside",r._inside).replace("href",r._href).getRegex(),r.reflink=p(r.reflink).replace("inside",r._inside).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=a(this.mangle(s[1]))):n=a(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):a(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(a(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(a(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=a(s[0])):(n=a(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},s.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:a(e,!0))+"\n
    \n":"
    "+(n?e:a(e,!0))+"\n
    "},i.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"'+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var s='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;eAn error occurred:

    "+a(e.message+"",!0)+"
    ";throw e}}f.exec=f,k.options=k.setOptions=function(e){return d(k.defaults,e),k},k.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1,baseUrl:null},k.Parser=o,k.parser=o.parse,k.Renderer=i,k.TextRenderer=l,k.Lexer=n,k.lexer=n.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.parse=k,"undefined"!=typeof module&&"object"==typeof exports?module.exports=k:"function"==typeof define&&define.amd?define(function(){return k}):e.marked=k}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file diff --git a/test/index.js b/test/index.js index b1f50fcc..73aa0a82 100644 --- a/test/index.js +++ b/test/index.js @@ -3,7 +3,7 @@ /** * marked tests * Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed) - * https://github.com/chjj/marked + * https://github.com/markedjs/marked */ /** From ffd386a6b2d99deeab025b0949463f4358140933 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 20 Feb 2018 01:13:04 +0100 Subject: [PATCH 217/459] add commonmark tests for (inline) raw html --- test/new/cm_raw_html.html | 77 ++++++++++++++++++++++++++++++++++++++ test/new/cm_raw_html.md | 78 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 test/new/cm_raw_html.html create mode 100644 test/new/cm_raw_html.md diff --git a/test/new/cm_raw_html.html b/test/new/cm_raw_html.html new file mode 100644 index 00000000..f3da050e --- /dev/null +++ b/test/new/cm_raw_html.html @@ -0,0 +1,77 @@ +

    Raw HTML

    + +

    Example 584

    + +

    + +

    Example 585

    + +

    + +

    Example 586

    + +

    + +

    Example 587

    + +

    + +

    Example 588

    + +

    Foo

    + +

    Example 589

    + +

    <33> <__>

    + +

    Example 590

    + +

    <a h*#ref="hi">

    + +

    Example 591

    + +

    <a href="hi'> <a href=hi'>

    + +

    Example 592

    + +

    < a>< +foo><bar/ >

    + +

    Example 593

    + +

    <a href='bar'title=title>

    + +

    Example 594

    + +

    + +

    Example 595

    + +

    </a href="foo">

    + +

    Example 596

    + +

    foo

    + +

    Example 599

    + +

    foo

    + +

    Example 600

    + +

    foo

    + +

    Example 601

    + +

    foo &<]]>

    + +

    Example 602

    + +

    foo

    + +

    Example 603

    + +

    foo

    diff --git a/test/new/cm_raw_html.md b/test/new/cm_raw_html.md new file mode 100644 index 00000000..becbb8a6 --- /dev/null +++ b/test/new/cm_raw_html.md @@ -0,0 +1,78 @@ +Raw HTML +=================== + +### Example 584 + + + +### Example 585 + + + +### Example 586 + + + +### Example 587 + + + +### Example 588 + +Foo + +### Example 589 + +<33> <__> + +### Example 590 + + + +### Example 591 + + + +### Example 596 + +foo + +### Example 599 + +foo + +### Example 600 + +foo + +### Example 601 + +foo &<]]> + +### Example 602 + +foo + +### Example 603 + +foo From 056f4e2657e462bb42e2ea2d2ff8d271964ce88c Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 27 Jan 2018 04:45:04 +0100 Subject: [PATCH 218/459] add commonmark tests for html comments --- test/new/html_comments.html | 33 +++++++++++++++++++++++++++++++++ test/new/html_comments.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 test/new/html_comments.html create mode 100644 test/new/html_comments.md diff --git a/test/new/html_comments.html b/test/new/html_comments.html new file mode 100644 index 00000000..6687308a --- /dev/null +++ b/test/new/html_comments.html @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + +
    <!-- too much indentation -->
    +
    + +

    <!--> not a comment -->

    + +

    <!---> not a comment -->

    + + --> \ No newline at end of file diff --git a/test/new/html_comments.md b/test/new/html_comments.md new file mode 100644 index 00000000..df045fb4 --- /dev/null +++ b/test/new/html_comments.md @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + not a comment --> + + not a comment --> + + --> \ No newline at end of file From 9450b091326d607b13a3b5e1f800807e96729d7a Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 20 Feb 2018 01:19:44 +0100 Subject: [PATCH 219/459] new inline html rule, to comply with commonmark --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 5ca95941..1ab8984b 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -461,7 +461,7 @@ var inline = { escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, url: noop, - tag: /^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/]*)*?\/?>/, + tag: /^|^<\/[a-zA-Z][\w\-]*\s*>|^<[a-zA-Z][\w\-]*(?:\s+[\w:-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*?\s*\/?>|^<\?[\s\S]*?\?>|^|^/, link: /^!?\[(inside)\]\(href\)/, reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/, From 652ba97a2cb443bce66172bfdbe3df84bf9e4546 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 27 Jan 2018 03:58:48 +0100 Subject: [PATCH 220/459] new html comment rule to comply with commonmark (html5). non-compliant: allow `--` inside html comments. adjust inline tag rule accordingly. --- lib/marked.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 1ab8984b..3196e563 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -52,8 +52,10 @@ block._tag = '(?!(?:' + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b'; +block._comment = //; + block.html = edit(block.html) - .replace('comment', //) + .replace('comment', block._comment) .replace('closed', /<(tag)[\s\S]+?<\/\1>/) .replace('closing', /]*)*?\/?>/) .replace(/tag/g, block._tag) @@ -461,7 +463,7 @@ var inline = { escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, url: noop, - tag: /^|^<\/[a-zA-Z][\w\-]*\s*>|^<[a-zA-Z][\w\-]*(?:\s+[\w:-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*?\s*\/?>|^<\?[\s\S]*?\?>|^|^/, + tag: /^comment|^<\/[a-zA-Z][\w\-]*\s*>|^<[a-zA-Z][\w\-]*(?:\s+[\w:-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*?\s*\/?>|^<\?[\s\S]*?\?>|^|^/, link: /^!?\[(inside)\]\(href\)/, reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/, @@ -479,7 +481,11 @@ inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0 inline.autolink = edit(inline.autolink) .replace('scheme', inline._scheme) .replace('email', inline._email) - .getRegex() + .getRegex(); + +inline.tag = edit(inline.tag) + .replace('comment', block._comment) + .getRegex(); inline._inside = /(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/; inline._href = /\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/; From b2611c1b0503c7d52313a86fc3c7106f26a4e415 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Fri, 23 Feb 2018 20:07:39 +0100 Subject: [PATCH 221/459] allow colons in tag names and attributes. Decrease group depth in regex --- lib/marked.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 3196e563..99a94226 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -463,7 +463,7 @@ var inline = { escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, url: noop, - tag: /^comment|^<\/[a-zA-Z][\w\-]*\s*>|^<[a-zA-Z][\w\-]*(?:\s+[\w:-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*?\s*\/?>|^<\?[\s\S]*?\?>|^|^/, + tag: /^comment|^<\/[a-zA-Z][\w:-]*\s*>|^<[a-zA-Z][\w:-]*(?:attribute)*?\s*\/?>|^<\?[\s\S]*?\?>|^|^/, link: /^!?\[(inside)\]\(href\)/, reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/, @@ -483,8 +483,11 @@ inline.autolink = edit(inline.autolink) .replace('email', inline._email) .getRegex(); +inline._attribute = /\s+[\w:-]+(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; + inline.tag = edit(inline.tag) .replace('comment', block._comment) + .replace('attribute', inline._attribute) .getRegex(); inline._inside = /(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/; From f2ebd4310aa8ac4687798f4991ec681462685fa8 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 4 Mar 2018 03:00:11 +0100 Subject: [PATCH 222/459] allow a regex source string as a parameter for edit() --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 99a94226..03fdba75 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1179,7 +1179,7 @@ function unescape(html) { } function edit(regex, opt) { - regex = regex.source; + regex = regex.source || regex; opt = opt || ''; return { replace: function(name, val) { From 27d4da6d38102d5f4281dbe826eb8049de6a6233 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 4 Mar 2018 03:00:34 +0100 Subject: [PATCH 223/459] refactor tag inline rule --- lib/marked.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 03fdba75..2dc9f62f 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -463,7 +463,12 @@ var inline = { escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, url: noop, - tag: /^comment|^<\/[a-zA-Z][\w:-]*\s*>|^<[a-zA-Z][\w:-]*(?:attribute)*?\s*\/?>|^<\?[\s\S]*?\?>|^|^/, + tag: '^comment' + + '|^' // self-closing tag + + '|^<[a-zA-Z][\\w:-]*(?:attribute)*?\\s*/?>' // open tag + + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. + + '|^' // declaration, e.g. + + '|^', // CDATA section link: /^!?\[(inside)\]\(href\)/, reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\]]*\]|\\[\[\]]|[^\[\]])*)\]/, From 4de3c98282a55eff593308b30b772eaf57f7a9f8 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 24 Feb 2018 06:03:26 +0100 Subject: [PATCH 224/459] refactor html block rule --- lib/marked.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 2dc9f62f..19111ffd 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -20,7 +20,9 @@ var block = { nptable: noop, blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, + html: '^ *(?:comment *(?:\\n|\\s*$)' + + '|closed *(?:\\n{2,}|\\s*$)' + + '|closing *(?:\\n{2,}|\\s*$))', def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop, lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, From c12c5d7af22a1cdafb1a674f1101b54290acea47 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 20 Feb 2018 01:16:51 +0100 Subject: [PATCH 225/459] rename gfm_links -> gfm_autolinks --- test/new/{gfm_links.html => gfm_autolinks.html} | 0 test/new/{gfm_links.md => gfm_autolinks.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename test/new/{gfm_links.html => gfm_autolinks.html} (100%) rename test/new/{gfm_links.md => gfm_autolinks.md} (100%) diff --git a/test/new/gfm_links.html b/test/new/gfm_autolinks.html similarity index 100% rename from test/new/gfm_links.html rename to test/new/gfm_autolinks.html diff --git a/test/new/gfm_links.md b/test/new/gfm_autolinks.md similarity index 100% rename from test/new/gfm_links.md rename to test/new/gfm_autolinks.md From 316db0af4b0281b747f857a9f29daded6277bcfc Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Mon, 26 Feb 2018 03:17:48 +0100 Subject: [PATCH 226/459] rename test headings-id -> headings_id --- test/new/{headings-id.html => headings_id.html} | 0 test/new/{headings-id.md => headings_id.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename test/new/{headings-id.html => headings_id.html} (100%) rename test/new/{headings-id.md => headings_id.md} (100%) diff --git a/test/new/headings-id.html b/test/new/headings_id.html similarity index 100% rename from test/new/headings-id.html rename to test/new/headings_id.html diff --git a/test/new/headings-id.md b/test/new/headings_id.md similarity index 100% rename from test/new/headings-id.md rename to test/new/headings_id.md From d89012f729b696c293816ba496d35d48cd8609e5 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Mon, 26 Feb 2018 03:19:20 +0100 Subject: [PATCH 227/459] remove superfluous test fixture (already covered by original/links_reference_style and new/cm_link_defs) --- test/new/links_reference_style.html | 62 ---------------------- test/new/links_reference_style.md | 81 ----------------------------- 2 files changed, 143 deletions(-) delete mode 100644 test/new/links_reference_style.html delete mode 100644 test/new/links_reference_style.md diff --git a/test/new/links_reference_style.html b/test/new/links_reference_style.html deleted file mode 100644 index e12da3f2..00000000 --- a/test/new/links_reference_style.html +++ /dev/null @@ -1,62 +0,0 @@ -

    Foo bar.

    - -

    Foo bar.

    - -

    Foo bar.

    - -

    With embedded [brackets].

    - -

    Indented once.

    - -

    Indented twice.

    - -

    Indented thrice.

    - -

    Indented [four][] times.

    - -
    [four]: /url
    -
    - -
    - -

    this should work

    - -

    So should this.

    - -

    And this.

    - -

    And this.

    - -

    And this.

    - -

    But not [that] [].

    - -

    Nor [that][].

    - -

    Nor [that].

    - -

    [Something in brackets like this should work]

    - -

    [Same with this.]

    - -

    In this case, this points to something else.

    - -

    Backslashing should suppress [this] and [this].

    - -

    A link reference definition cannot interrupt a paragraph. -[bar]: /baz

    -

    [bar]

    - -

    However, it can directly follow other block elements, such as headings

    -

    Foo

    -
    -

    bar

    -
    - -
    - -

    Here's one where the link -breaks across lines.

    - -

    Here's another where the link -breaks across lines, but with a line-ending space.

    diff --git a/test/new/links_reference_style.md b/test/new/links_reference_style.md deleted file mode 100644 index 39aa93bb..00000000 --- a/test/new/links_reference_style.md +++ /dev/null @@ -1,81 +0,0 @@ -Foo [bar] [1]. - -Foo [bar][1]. - -Foo [bar] -[1]. - -[1]: /url/ "Title" - - -With [embedded [brackets]] [b]. - - -Indented [once][]. - -Indented [twice][]. - -Indented [thrice][]. - -Indented [four][] times. - - [once]: /url - - [twice]: /url - - [thrice]: /url - - [four]: /url - - -[b]: /url/ - -* * * - -[this] [this] should work - -So should [this][this]. - -And [this] []. - -And [this][]. - -And [this]. - -But not [that] []. - -Nor [that][]. - -Nor [that]. - -[Something in brackets like [this][] should work] - -[Same with [this].] - -In this case, [this](/somethingelse/) points to something else. - -Backslashing should suppress \[this] and [this\]. - -[this]: foo - -A link reference definition cannot interrupt a paragraph. -[bar]: /baz - -[bar] - -However, it can directly follow other block elements, such as headings - -# [Foo] -[foo]: /url -> bar - -* * * - -Here's one where the [link -breaks] across lines. - -Here's another where the [link -breaks] across lines, but with a line-ending space. - - -[link breaks]: /url/ From 8e30cd2e51ca1e467df9a3c116670e24611e7419 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 4 Mar 2018 03:37:38 +0100 Subject: [PATCH 228/459] !fixup b2611c1b05 Disallow colons in tag names --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 19111ffd..a0bd216d 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -467,7 +467,7 @@ var inline = { url: noop, tag: '^comment' + '|^' // self-closing tag - + '|^<[a-zA-Z][\\w:-]*(?:attribute)*?\\s*/?>' // open tag + + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. + '|^' // declaration, e.g. + '|^', // CDATA section @@ -490,7 +490,7 @@ inline.autolink = edit(inline.autolink) .replace('email', inline._email) .getRegex(); -inline._attribute = /\s+[\w:-]+(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; +inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; inline.tag = edit(inline.tag) .replace('comment', block._comment) From dce66a28494df872a713e0326c69a2d818e2ca8f Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 3 Mar 2018 21:33:02 -0600 Subject: [PATCH 229/459] add first test --- test/unit/marked-spec.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/unit/marked-spec.js diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js new file mode 100644 index 00000000..f430302d --- /dev/null +++ b/test/unit/marked-spec.js @@ -0,0 +1,5 @@ +var marked = require('../../lib/marked.js'); + +it('should run the test', function () { + expect(marked('Hello World!')).toContain('Hello World!'); +}); From 79325aa9e1dcc2e96a35579ad6e475a8afc7eb05 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sun, 4 Mar 2018 00:47:02 -0600 Subject: [PATCH 230/459] add tests --- package.json | 8 +++++--- test/integration/marked-spec.js | 5 +++++ test/specs/specs-spec.js | 12 ++++++++++++ test/unit/marked-spec.js | 4 +++- 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 test/integration/marked-spec.js create mode 100644 test/specs/specs-spec.js diff --git a/package.json b/package.json index 737f86df..b8a4702e 100644 --- a/package.json +++ b/package.json @@ -38,9 +38,11 @@ "uglify-js": "^3.3.10" }, "scripts": { - "test": "npm run test:unit && npm run test:spec", - "test:unit": "jasmine --config=jasmine.json", - "test:spec": "node test", + "test": "jasmine --config=jasmine.json", + "test:unit": "npm test -- test/unit/**/*-spec.js", + "test:specs": "npm test -- test/specs/**/*-spec.js", + "test:integration": "npm test -- test/integration/**/*-spec.js", + "test:old": "node test", "test:lint": "eslint lib/marked.js test/index.js", "bench": "node test --bench", "lint": "eslint --fix lib/marked.js test/index.js", diff --git a/test/integration/marked-spec.js b/test/integration/marked-spec.js new file mode 100644 index 00000000..6d3b9ee7 --- /dev/null +++ b/test/integration/marked-spec.js @@ -0,0 +1,5 @@ +var marked = require('../../marked.min.js'); + +it('should run the test', function () { + expect(marked('Hello World!')).toBe('

    Hello World!

    \n'); +}); diff --git a/test/specs/specs-spec.js b/test/specs/specs-spec.js new file mode 100644 index 00000000..c30a8429 --- /dev/null +++ b/test/specs/specs-spec.js @@ -0,0 +1,12 @@ +var tests = require('../'); + +it('should run spec tests', function () { + // hide output + spyOn(console, 'log'); + if (!tests.runTests({stop: true})) { + // if tests fail rerun tests and show output + console.log.and.callThrough(); + tests.runTests(); + fail(); + } +}); diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js index f430302d..83f4fb57 100644 --- a/test/unit/marked-spec.js +++ b/test/unit/marked-spec.js @@ -1,5 +1,7 @@ var marked = require('../../lib/marked.js'); it('should run the test', function () { - expect(marked('Hello World!')).toContain('Hello World!'); + spyOn(marked, 'parse').and.callThrough(); + marked.parse('Hello World!'); + expect(marked.parse).toHaveBeenCalled(); }); From 9c6c13f3d3d095bdcb2d9a3b72095e21398ec8d7 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sun, 4 Mar 2018 00:51:00 -0600 Subject: [PATCH 231/459] fix tests --- test/specs/specs-spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/specs/specs-spec.js b/test/specs/specs-spec.js index c30a8429..65526c86 100644 --- a/test/specs/specs-spec.js +++ b/test/specs/specs-spec.js @@ -1,12 +1,12 @@ -var tests = require('../'); +var specTests = require('../'); it('should run spec tests', function () { // hide output spyOn(console, 'log'); - if (!tests.runTests({stop: true})) { + if (!specTests({stop: true})) { // if tests fail rerun tests and show output console.log.and.callThrough(); - tests.runTests(); + specTests(); fail(); } }); From 57681809993972c205bd48df26bd3c6cb46bf835 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sun, 4 Mar 2018 07:40:04 -0600 Subject: [PATCH 232/459] travis build stages (#1113) * add travis build stages * add emoji --- .travis.yml | 25 +++++++++++++------------ test/index.js | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8f089ff8..4964bcc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,17 @@ language: node_js -node_js: - - "0.10" - - "4" - - "lts/*" - - "node" -script: | - if [ `node --version | cut -d . -f 1,2` = "v0.10" ]; then - sed -i s/0o755/0755/ test/index.js; - npm test; - else - npm run test:lint && npm test; - fi + +jobs: + include: + - stage: spec tests 👩🏽‍💻 + node_js: v0.10 + - node_js: v4 + - node_js: lts/* + - node_js: node + + - stage: lint ✨ + node_js: lts/* + script: npm run test:lint + cache: directories: - node_modules diff --git a/test/index.js b/test/index.js index 73aa0a82..f9d7da1e 100644 --- a/test/index.js +++ b/test/index.js @@ -352,7 +352,7 @@ function time(options) { function fix() { ['compiled_tests', 'original', 'new'].forEach(function(dir) { try { - fs.mkdirSync(path.resolve(__dirname, dir), 0o755); + fs.mkdirSync(path.resolve(__dirname, dir)); } catch (e) { ; } From ecbf4b04300edfadc0799900607e5636cbd9381e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sun, 4 Mar 2018 08:43:00 -0500 Subject: [PATCH 233/459] Minor docs update for easier maintenance (#1116) * Add markdown flavors to issues and pr templates Take the burden off the core team to identify which markdown flavor is experiencing the issue. * Add Totally Tron badge * Rename RELEASE to PUBLISHING * Move comment based on review * Rename USAGE_ to USING_ --- .github/ISSUE_TEMPLATE.md | 2 ++ .github/PULL_REQUEST_TEMPLATE.md | 2 ++ AUTHORS.md | 2 ++ CONTRIBUTING.md | 4 ++-- RELEASE.md => PUBLISHING.md | 0 USAGE_ADVANCED.md => USING_ADVANCED.md | 0 USAGE_EXTENSIBILITY.md => USING_PRO.md | 0 7 files changed, 8 insertions(+), 2 deletions(-) rename RELEASE.md => PUBLISHING.md (100%) rename USAGE_ADVANCED.md => USING_ADVANCED.md (100%) rename USAGE_EXTENSIBILITY.md => USING_PRO.md (100%) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 60309083..e0465a78 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,7 @@ **Marked version:** +**Markdown flavor:** Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a + +**Markdown flavor:** Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a + ## Description - Fixes #### (if fixing a known issue; otherwise, describe issue using the following format) diff --git a/AUTHORS.md b/AUTHORS.md index 8c0eba80..094b42bc 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -132,6 +132,8 @@ Badges at play:
    Someone who has demonstrated a high degree of expertise or authority when it comes to software security.
    Titan of the Test Harness
    Someone who demonstrates high-levels of understanding regarding Marked's test harness.
    +
    Totally Tron
    +
    Someone who demonstrates they are willing and able to "fight for the users", both developers dependent on marked to do their jobs as well as end-users interacting with the output (particularly in the realm of those with the disabilities).
    Special badges that come with the job: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe38b4b4..9fbb4950 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,6 +90,6 @@ To build your own minified version of Marked: npm run build ``` -## Releasing +## Publishing -Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [releasing documentation](https://github.com/markedjs/marked/blob/master/RELEASE.md). +Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [publishing documentation](https://github.com/markedjs/marked/blob/master/PUBLISHING.md). diff --git a/RELEASE.md b/PUBLISHING.md similarity index 100% rename from RELEASE.md rename to PUBLISHING.md diff --git a/USAGE_ADVANCED.md b/USING_ADVANCED.md similarity index 100% rename from USAGE_ADVANCED.md rename to USING_ADVANCED.md diff --git a/USAGE_EXTENSIBILITY.md b/USING_PRO.md similarity index 100% rename from USAGE_EXTENSIBILITY.md rename to USING_PRO.md From e3a988cf51edd3fdbeb913316dd381c8008cf071 Mon Sep 17 00:00:00 2001 From: Alexander Odell Date: Sun, 4 Mar 2018 15:02:00 +0100 Subject: [PATCH 234/459] Fix usage links in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6916eda..96ee203b 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ $ cat hello.html ``` -Marked offers [advanced configurations](https://github.com/markedjs/marked/blob/master/USAGE_ADVANCED.md) and [extensibility](https://github.com/markedjs/marked/blob/master/USAGE_EXTENSIBILITY.md) as well. +Marked offers [advanced configurations](https://github.com/markedjs/marked/blob/master/USING_ADVANCED.md) and [extensibility](https://github.com/markedjs/marked/blob/master/USING_PRO.md) as well.

    Supported Markdown specifications

    From bcf9abbcf5fb1625122269617849777551d527f7 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 4 Mar 2018 15:56:55 +0100 Subject: [PATCH 235/459] divide html_comments test into subtests --- test/new/html_comments.html | 24 ++++++++++++++++++++++++ test/new/html_comments.md | 28 ++++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/test/new/html_comments.html b/test/new/html_comments.html index 6687308a..1bf99aaf 100644 --- a/test/new/html_comments.html +++ b/test/new/html_comments.html @@ -1,31 +1,55 @@ +

    Example 1

    + +

    Example 2

    + +

    Example 3

    + +

    Example 4

    + +

    Example 5

    + +

    Example 6

    + +

    Example 7

    + +

    Example 8

    + +

    Example 9

    + +

    Example 10

    + +

    Example 11

    +
    <!-- too much indentation -->
     
    +

    Example 12

    +

    <!--> not a comment -->

    <!---> not a comment -->

    diff --git a/test/new/html_comments.md b/test/new/html_comments.md index df045fb4..06aff02e 100644 --- a/test/new/html_comments.md +++ b/test/new/html_comments.md @@ -1,30 +1,54 @@ +### Example 1 + +### Example 2 + - + +### Example 3 + +### Example 4 + - + +### Example 5 + +### Example 6 + +### Example 7 + +### Example 8 + +### Example 9 + +### Example 10 + +### Example 11 + +### Example 12 + not a comment --> not a comment --> From 1b8ca2bee0440311e9e21d07dadcd0c4b84c3c1d Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 4 Mar 2018 16:03:17 +0100 Subject: [PATCH 236/459] option `pedantic` overrides `gfm`, and turns off gfm, tables and breaks. FIXME update README --- lib/marked.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index a0bd216d..956f63cd 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -115,7 +115,7 @@ function Lexer(options) { this.options = options || marked.defaults; this.rules = block.normal; - if (this.options.gfm) { + if (!this.options.pedantic && this.options.gfm) { if (this.options.tables) { this.rules = block.tables; } else { @@ -565,14 +565,14 @@ function InlineLexer(links, options) { throw new Error('Tokens array requires a `links` property.'); } - if (this.options.gfm) { + if (this.options.pedantic) { + this.rules = inline.pedantic; + } else if (this.options.gfm) { if (this.options.breaks) { this.rules = inline.breaks; } else { this.rules = inline.gfm; } - } else if (this.options.pedantic) { - this.rules = inline.pedantic; } } From c1ef53c605cfe41d3e0f59a2f2ce3a1db148558d Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 4 Mar 2018 16:09:17 +0100 Subject: [PATCH 237/459] add commonmark tests for html blocks --- test/new/cm_html_blocks.html | 299 +++++++++++++++++++++++++++++++++ test/new/cm_html_blocks.md | 311 +++++++++++++++++++++++++++++++++++ 2 files changed, 610 insertions(+) create mode 100644 test/new/cm_html_blocks.html create mode 100644 test/new/cm_html_blocks.md diff --git a/test/new/cm_html_blocks.html b/test/new/cm_html_blocks.html new file mode 100644 index 00000000..623e5f10 --- /dev/null +++ b/test/new/cm_html_blocks.html @@ -0,0 +1,299 @@ +

    HTML blocks

    + +

    Example 116

    + +
    +
    +**Hello**,
    +

    world. +

    +
    + +

    Example 117

    + + + + + +
    + hi +
    +

    okay.

    + +

    Example 118

    + + +*foo* + +

    Example 120

    + +
    +

    Markdown

    +
    + +

    Example 121

    + +
    +
    + +

    Example 122

    + +
    +
    + +

    Example 123

    + +
    +*foo* +

    bar

    + +

    Example 124

    + +
    Example 125 + +
    Example 126 + +
    Example 127 + + + +

    Example 128

    + +
    +foo +
    + +

    Example 129

    + +
    +``` c +int x = 33; +``` + +

    Example 130

    + + +*bar* + + +

    Example 131

    + + +*bar* + + +

    Example 132

    + + +*bar* + + +

    Example 133

    + + +*bar* + +

    Example 134

    + + +*foo* + + +

    Example 135

    + + +

    foo

    +
    + +

    Example 136

    + +

    foo

    + +

    Example 137

    + +
    
    +import Text.HTML.TagSoup
    +
    +main :: IO ()
    +main = print $ parseTags tags
    +
    +

    okay

    + +

    Example 138

    + + +

    okay

    + +

    Example 139

    + + +

    okay

    + +

    Example 140

    + + +

    foo

    + +

    Example 144

    + +*bar* +

    baz

    + +

    Example 145

    + +1. *bar* + +

    Example 146

    + + +

    okay

    + +

    Example 147

    + +'; + +?> +

    okay

    + +

    Example 148

    + + + +

    Example 149

    + + +

    okay

    + +

    Example 150

    + + +
    <!-- foo -->
    +
    + +

    Example 151

    + +
    +
    <div>
    +
    + +

    Example 152

    + +

    Foo

    +
    +bar +
    + +

    Example 153

    + +
    +bar +
    +*foo* + +

    Example 154

    + +

    Foo + +baz

    + +

    Example 155

    + +
    +

    Emphasized text.

    +
    + +

    Example 156

    + +
    +*Emphasized* text. +
    + +

    Example 157

    + + + + + +
    +Hi +
    + +

    Example 158

    + + + +
    <td>
    +  Hi
    +</td>
    +
    + +
    + diff --git a/test/new/cm_html_blocks.md b/test/new/cm_html_blocks.md new file mode 100644 index 00000000..89e3b172 --- /dev/null +++ b/test/new/cm_html_blocks.md @@ -0,0 +1,311 @@ +HTML blocks +=================== + +### Example 116 + +
    +
    +**Hello**,
    +
    +_world_.
    +
    +
    + +### Example 117 + + + + + +
    + hi +
    + +okay. + +### Example 118 + +
    +*foo* + +### Example 120 + +
    + +*Markdown* + +
    + +### Example 121 + +
    +
    + +### Example 122 + +
    +
    + +### Example 123 + +
    +*foo* + +*bar* + +### Example 124 + + + +### Example 128 + +
    +foo +
    + +### Example 129 + +
    +``` c +int x = 33; +``` + +### Example 130 + + +*bar* + + +### Example 131 + + +*bar* + + +### Example 132 + + +*bar* + + +### Example 133 + + +*bar* + +### Example 134 + + +*foo* + + +### Example 135 + + + +*foo* + + + +### Example 136 + +*foo* + +### Example 137 + +
    
    +import Text.HTML.TagSoup
    +
    +main :: IO ()
    +main = print $ parseTags tags
    +
    +okay + +### Example 138 + + +okay + +### Example 139 + + +okay + +### Example 140 + + +*foo* + +### Example 144 + +*bar* +*baz* + +### Example 145 + +1. *bar* + +### Example 146 + + +okay + +### Example 147 + +'; + +?> +okay + +### Example 148 + + + +### Example 149 + + +okay + +### Example 150 + + + + + +### Example 151 + +
    + +
    + +### Example 152 + +Foo +
    +bar +
    + +### Example 153 + +
    +bar +
    +*foo* + +### Example 154 + +Foo + +baz + +### Example 155 + +
    + +*Emphasized* text. + +
    + +### Example 156 + +
    +*Emphasized* text. +
    + +### Example 157 + + + + + + + + + +
    +Hi +
    + +### Example 158 + + + + + + + + + +
    + Hi +
    + From 56972f82a4f8c7c13a913df698bb41de0614b7f6 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 4 Mar 2018 16:12:22 +0100 Subject: [PATCH 238/459] save the current html block parsing in the pedantic mode --- lib/marked.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 956f63cd..5d74f754 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -105,6 +105,23 @@ block.tables = merge({}, block.gfm, { table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ }); +/** + * Pedantic grammar + */ + +block.pedantic = merge({}, block.normal, { + html: edit( + '^ *(?:comment *(?:\\n|\\s*$)' + + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag + + '|]*)*?/?> *(?:\\n{2,}|\\s*$))') + .replace('comment', block._comment) + .replace(/tag/g, '(?!(?:' + + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b') + .getRegex() +}); + /** * Block Lexer */ @@ -115,7 +132,9 @@ function Lexer(options) { this.options = options || marked.defaults; this.rules = block.normal; - if (!this.options.pedantic && this.options.gfm) { + if (this.options.pedantic) { + this.rules = block.pedantic; + } else if (this.options.gfm) { if (this.options.tables) { this.rules = block.tables; } else { From d08039e1f2cc87cd3ec9232f82deb538d956d3a9 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 4 Mar 2018 16:18:46 +0100 Subject: [PATCH 239/459] new rule for html blocks, to comply with commonmark. BREAKING CHANGE: inline markdown is not parsed inside html blocks. --- lib/marked.js | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 5d74f754..abb3d994 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -20,13 +20,20 @@ var block = { nptable: noop, blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: '^ *(?:comment *(?:\\n|\\s*$)' - + '|closed *(?:\\n{2,}|\\s*$)' - + '|closing *(?:\\n{2,}|\\s*$))', + html: '^ {0,3}(?:' // optional indentation + + '<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) + + '|comment[^\\n]*(\\n+|$)' // (2) + + '|<\\?[\\s\\S]*?\\?>\\n*' // (3) + + '|\\n*' // (4) + + '|\\n*' // (5) + + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) + + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag + + '|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + + ')', def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop, lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - paragraph: /^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/, + paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/, text: /^[^\n]+/ }; @@ -49,25 +56,24 @@ block.list = edit(block.list) .replace('def', '\\n+(?=' + block.def.source + ')') .getRegex(); -block._tag = '(?!(?:' - + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' - + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' - + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b'; - +block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + + '|track|ul'; block._comment = //; - -block.html = edit(block.html) +block.html = edit(block.html, 'i') .replace('comment', block._comment) - .replace('closed', /<(tag)[\s\S]+?<\/\1>/) - .replace('closing', /]*)*?\/?>/) - .replace(/tag/g, block._tag) + .replace('tag', block._tag) + .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"]*"| *= *'[^']*'| *= *[^\s"'=<>`]+)?/) .getRegex(); block.paragraph = edit(block.paragraph) .replace('hr', block.hr) .replace('heading', block.heading) .replace('lheading', block.lheading) - .replace('tag', '<' + block._tag) + .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks .getRegex(); block.blockquote = edit(block.blockquote) @@ -1163,10 +1169,8 @@ Parser.prototype.tok = function() { return this.renderer.listitem(body); } case 'html': { - var html = !this.token.pre && !this.options.pedantic - ? this.inline.output(this.token.text) - : this.token.text; - return this.renderer.html(html); + //TODO parse inline content if parameter markdown=1 + return this.renderer.html(this.token.text); } case 'paragraph': { return this.renderer.paragraph(this.inline.output(this.token.text)); From 7abf7022c1998c99545b496a119d5c4821d9f2fc Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 4 Mar 2018 16:26:15 +0100 Subject: [PATCH 240/459] adjust html_comments test case in accordance with commonmark --- test/new/html_comments.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/new/html_comments.html b/test/new/html_comments.html index 1bf99aaf..872b45f6 100644 --- a/test/new/html_comments.html +++ b/test/new/html_comments.html @@ -54,4 +54,4 @@ comment

    <!---> not a comment -->

    - --> \ No newline at end of file + --> From fb2f3173111f4b1c5ff5401e678d2af2ce9df9c7 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Mon, 5 Mar 2018 22:10:45 +0100 Subject: [PATCH 241/459] rearrange test in cm_html_blocks to test end of file --- test/new/cm_html_blocks.html | 15 ++++++++------- test/new/cm_html_blocks.md | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/test/new/cm_html_blocks.html b/test/new/cm_html_blocks.html index 623e5f10..80fdff57 100644 --- a/test/new/cm_html_blocks.html +++ b/test/new/cm_html_blocks.html @@ -155,13 +155,6 @@ p {color:blue;}

    okay

    -

    Example 140

    - - okay -### Example 140 - - + + +
    +
    + +

    Marked.js Documentation

    +
    + +
    +
    + + + + + + \ No newline at end of file From c22be25663d64c408926bd9d62d179c6acbf8578 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 13 Mar 2018 14:54:49 -0400 Subject: [PATCH 298/459] Create CNAME for marked.js.org --- docs/CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/CNAME diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 00000000..c92fdfcb --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +marked.js.org From 03d0ed0062335384e4fdff0f9ec291efffe92165 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 14 Mar 2018 16:49:40 -0400 Subject: [PATCH 299/459] [editorconfig]: All md files except in test use tab (#1111) * All md files except in test use tab * Remove translate_tabs_to_spaces --- .editorconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 3cc69935..9f5e052b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,6 +12,5 @@ charset = utf-8 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -translate_tabs_to_spaces = true -indent_style = space +indent_style = tab indent_size = 4 \ No newline at end of file From 6b4f2ffa109f714304ce6be4deab6dd3a09701f2 Mon Sep 17 00:00:00 2001 From: Paul Roub Date: Thu, 15 Mar 2018 12:56:59 -0400 Subject: [PATCH 300/459] Start ordered lists using the initial numbers from markdown lists Adds tests for list creation and continuation when starting with a number other than 1. Emits 'start' attribute only when necessary; simple cases behave as always. --- lib/marked.js | 19 ++++++++++------ .../original/ordered_and_unordered_lists.html | 22 +++++++++++++++++++ test/original/ordered_and_unordered_lists.md | 14 ++++++++++++ 3 files changed, 48 insertions(+), 7 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 2fdeb33e..a2884e8f 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -164,7 +164,8 @@ Lexer.prototype.token = function(src, top) { space, i, tag, - l; + l, + isordered; while (src) { // newline @@ -279,10 +280,12 @@ Lexer.prototype.token = function(src, top) { if (cap = this.rules.list.exec(src)) { src = src.substring(cap[0].length); bull = cap[2]; + isordered = bull.length > 1; this.tokens.push({ type: 'list_start', - ordered: bull.length > 1 + ordered: isordered, + start: isordered ? +bull[0] : '' }); // Get each top-level item. @@ -836,9 +839,10 @@ Renderer.prototype.hr = function() { return this.options.xhtml ? '
    \n' : '
    \n'; }; -Renderer.prototype.list = function(body, ordered) { - var type = ordered ? 'ol' : 'ul'; - return '<' + type + '>\n' + body + '\n'; +Renderer.prototype.list = function(body, ordered, start) { + var type = ordered ? 'ol' : 'ul', + startatt = ordered && start > 1 ? (' start="' + start + '"') : ''; + return '<' + type + startatt + '>\n' + body + '\n'; }; Renderer.prototype.listitem = function(text) { @@ -1099,13 +1103,14 @@ Parser.prototype.tok = function() { } case 'list_start': { body = ''; - var ordered = this.token.ordered; + var ordered = this.token.ordered, + start = this.token.start; while (this.next().type !== 'list_end') { body += this.tok(); } - return this.renderer.list(body, ordered); + return this.renderer.list(body, ordered, start); } case 'list_item_start': { body = ''; diff --git a/test/original/ordered_and_unordered_lists.html b/test/original/ordered_and_unordered_lists.html index ba71eab3..88066002 100644 --- a/test/original/ordered_and_unordered_lists.html +++ b/test/original/ordered_and_unordered_lists.html @@ -146,3 +146,25 @@ back.

    that

    + + +

    Ordered lists start from initial number:

    + +
      +
    1. Three
    2. +
    3. Four
    4. +
    + + +

    Ordered lists continue with initial number:

    + +
      +
    1. First
    2. +
    3. Second: +
        +
      • Fee
      • +
      • Fie
      • +
      • Foe
      • +
    4. +
    5. Third
    6. +
    diff --git a/test/original/ordered_and_unordered_lists.md b/test/original/ordered_and_unordered_lists.md index 7f3b4977..3d5454d3 100644 --- a/test/original/ordered_and_unordered_lists.md +++ b/test/original/ordered_and_unordered_lists.md @@ -129,3 +129,17 @@ This was an error in Markdown 1.0.1: * sub that + +Ordered lists start from initial number: + +3. Three +1. Four + +Ordered lists continue with initial number: + +3. First +4. Second: + * Fee + * Fie + * Foe +5. Third From e3489ca1c8e6a669c8b650c256655361a6303b36 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 20 Mar 2018 16:14:44 -0400 Subject: [PATCH 301/459] Add marked mark maker badge --- AUTHORS.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 094b42bc..3773d743 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -97,7 +97,7 @@ Badges? If you *want* 'em, we got 'em, and here's how you get 'em (and…dr - [ ] Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). - [ ] Follow the instructions for submitting a badge PR. (There are more details to find within. Come on. Everybody likes surprises, right? No? Actually, we just try to put documentation where it belongs, closer to the code and part of the sequence of events.) -Badges at play: +### Badges at play:
    Curious Contributor
    @@ -136,9 +136,11 @@ Badges at play:
    Someone who demonstrates they are willing and able to "fight for the users", both developers dependent on marked to do their jobs as well as end-users interacting with the output (particularly in the realm of those with the disabilities).
    -Special badges that come with the job: +### Special badges that come with the job:
    +
    Maker of the Marked mark
    +
    This badge is given to the person or oganization credited with creating the logo (or logotype) used in Marked communications for a given period of time. **Marked mark maker from 2017 to present**, for example.
    Release Wrangler
    This is a badge given to all Publishers.
    Snyk's Security Saint
    From 682b9c62b8f8e0b967245785d4ccfdf5b31b58dc Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 20 Mar 2018 16:21:36 -0400 Subject: [PATCH 302/459] grammar --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 3773d743..80f97d6a 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -140,7 +140,7 @@ Badges? If you *want* 'em, we got 'em, and here's how you get 'em (and…dr
    Maker of the Marked mark
    -
    This badge is given to the person or oganization credited with creating the logo (or logotype) used in Marked communications for a given period of time. **Marked mark maker from 2017 to present**, for example.
    +
    This badge is given to the person or oganization credited with creating the logo (or logotype) used in Marked communications for a given period of time. **Maker of the Marked mark from 2017 to present**, for example.
    Release Wrangler
    This is a badge given to all Publishers.
    Snyk's Security Saint
    From 697af11e53bc25975bbdcc80ebc05393066dcb95 Mon Sep 17 00:00:00 2001 From: Paul Roub Date: Tue, 20 Mar 2018 17:03:11 -0400 Subject: [PATCH 303/459] Added integration tests for explicitly-initialized ordered lists. Fixed a bug in the initial implementation of ordered-list initialization. Add a simpler unit test around starting-from-zero. --- lib/marked.js | 4 ++-- marked.min.js | 2 +- test/integration/marked-spec.js | 15 ++++++++++++++- test/original/ordered_and_unordered_lists.html | 14 ++++---------- test/original/ordered_and_unordered_lists.md | 12 ++++-------- 5 files changed, 25 insertions(+), 22 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index a2884e8f..b27e233c 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -285,7 +285,7 @@ Lexer.prototype.token = function(src, top) { this.tokens.push({ type: 'list_start', ordered: isordered, - start: isordered ? +bull[0] : '' + start: isordered ? +bull : '' }); // Get each top-level item. @@ -841,7 +841,7 @@ Renderer.prototype.hr = function() { Renderer.prototype.list = function(body, ordered, start) { var type = ordered ? 'ol' : 'ul', - startatt = ordered && start > 1 ? (' start="' + start + '"') : ''; + startatt = (ordered && +start !== 1) ? (' start="' + start + '"') : ''; return '<' + type + startatt + '>\n' + body + '\n'; }; diff --git a/marked.min.js b/marked.min.js index 88a00d0f..3f2eb428 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||k.defaults,this.rules=t.normal,this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",t.html=p(t.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,t._tag).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag","<"+t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),l=i[2],this.tokens.push({type:"list_start",ordered:l.length>1}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._inside=/(?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,r._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=p(r.link).replace("inside",r._inside).replace("href",r._href).getRegex(),r.reflink=p(r.reflink).replace("inside",r._inside).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=a(this.mangle(s[1]))):n=a(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):a(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(a(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(a(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=a(s[0])):(n=a(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},s.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:a(e,!0))+"\n
    \n":"
    "+(n?e:a(e,!0))+"\n
    "},i.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"'+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var s='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;eAn error occurred:

    "+a(e.message+"",!0)+"
    ";throw e}}f.exec=f,k.options=k.setOptions=function(e){return d(k.defaults,e),k},k.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1,baseUrl:null},k.Parser=o,k.parser=o.parse,k.Renderer=i,k.TextRenderer=l,k.Lexer=n,k.lexer=n.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.parse=k,"undefined"!=typeof module&&"object"==typeof exports?module.exports=k:"function"==typeof define&&define.amd?define(function(){return k}):e.marked=k}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file +(function(root){"use strict";var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};block._label=/(?:\\[\[\]]|[^\[\]])+/;block._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/;block.def=edit(block.def).replace("label",block._label).replace("title",block._title).getRegex();block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=edit(block.item,"gm").replace(/bull/g,block.bullet).getRegex();block.list=edit(block.list).replace(/bull/g,block.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+block.def.source+")").getRegex();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b";block.html=edit(block.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,block._tag).getRegex();block.paragraph=edit(block.paragraph).replace("hr",block.hr).replace("heading",block.heading).replace("lheading",block.lheading).replace("tag","<"+block._tag).getRegex();block.blockquote=edit(block.blockquote).replace("paragraph",block.paragraph).getRegex();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=edit(block.paragraph).replace("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|").getRegex();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top){src=src.replace(/^ +$/gm,"");var next,loose,cap,bull,b,item,space,i,tag,l,isordered;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]||""});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];isordered=bull.length>1;this.tokens.push({type:"list_start",ordered:isordered,start:isordered?+bull:""});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&(cap[1]==="pre"||cap[1]==="script"||cap[1]==="style"),text:cap[0]});continue}if(top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);if(cap[3])cap[3]=cap[3].substring(1,cap[3].length-1);tag=cap[1].toLowerCase();if(!this.tokens.links[tag]){this.tokens.links[tag]={href:cap[2],title:cap[3]}}continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:noop,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=edit(inline.link).replace("inside",inline._inside).replace("href",inline._href).getRegex();inline.reflink=edit(inline.reflink).replace("inside",inline._inside).getRegex();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:edit(inline.escape).replace("])","~|])").getRegex(),url:edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",inline._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:edit(inline.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()});inline.breaks=merge({},inline.gfm,{br:edit(inline.br).replace("{2,}","*").getRegex(),text:edit(inline.gfm.text).replace("{2,}","*").getRegex()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=escape(this.mangle(cap[1]));href="mailto:"+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){cap[0]=this.rules._backpedal.exec(cap[0])[0];src=src.substring(cap[0].length);if(cap[2]==="@"){text=escape(cap[0]);href="mailto:"+text}else{text=escape(cap[0]);if(cap[1]==="www."){href="http://"+text}else{href=text}}out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^
    /i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(cap[0]):escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2].trim(),true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.text(escape(this.smartypants(cap[0])));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){if(!this.options.mangle)return text;var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
    "+(escaped?code:escape(code,true))+"\n
    "}return'
    '+(escaped?code:escape(code,true))+"\n
    \n"};Renderer.prototype.blockquote=function(quote){return"
    \n"+quote+"
    \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"};Renderer.prototype.list=function(body,ordered,start){var type=ordered?"ol":"ul",startatt=ordered&&+start!==1?' start="'+start+'"':"";return"<"+type+startatt+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
  • "+text+"
  • \n"};Renderer.prototype.paragraph=function(text){return"

    "+text+"

    \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
    \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
    ":"
    "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return text}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0||prot.indexOf("data:")===0){return text}}if(this.options.baseUrl&&!originIndependentUrl.test(href)){href=resolveUrl(this.options.baseUrl,href)}var out='
    ";return out};Renderer.prototype.image=function(href,title,text){if(this.options.baseUrl&&!originIndependentUrl.test(href)){href=resolveUrl(this.options.baseUrl,href)}var out=''+text+'":">";return out};Renderer.prototype.text=function(text){return text};function TextRenderer(){}TextRenderer.prototype.strong=TextRenderer.prototype.em=TextRenderer.prototype.codespan=TextRenderer.prototype.del=TextRenderer.prototype.text=function(text){return text};TextRenderer.prototype.link=TextRenderer.prototype.image=function(href,title,text){return""+text};TextRenderer.prototype.br=function(){return""};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options){var parser=new Parser(options);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options);this.inlineText=new InlineLexer(src.links,merge({},this.options,{renderer:new TextRenderer}));this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,unescape(this.inlineText.output(this.token.text)))}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function edit(regex,opt){regex=regex.source;opt=opt||"";return{replace:function(name,val){val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return this},getRegex:function(){return new RegExp(regex,opt)}}}function resolveUrl(base,href){if(!baseUrls[" "+base]){if(/^[^:]+:\/*[^/]*$/.test(base)){baseUrls[" "+base]=base+"/"}else{baseUrls[" "+base]=base.replace(/[^/]*$/,"")}}base=baseUrls[" "+base];if(href.slice(0,2)==="//"){return base.replace(/:[\s\S]*/,":")+href}else if(href.charAt(0)==="/"){return base.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+href}else{return base+href}}var baseUrls={};var originIndependentUrl=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occurred:

    "+escape(e.message+"",true)+"
    "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false,baseUrl:null};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.TextRenderer=TextRenderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{root.marked=marked}})(this||(typeof window!=="undefined"?window:global)); \ No newline at end of file diff --git a/test/integration/marked-spec.js b/test/integration/marked-spec.js index 6d3b9ee7..a699bfaf 100644 --- a/test/integration/marked-spec.js +++ b/test/integration/marked-spec.js @@ -1,5 +1,18 @@ -var marked = require('../../marked.min.js'); +var marked = require('../../marked.js'); it('should run the test', function () { expect(marked('Hello World!')).toBe('

    Hello World!

    \n'); }); + +// http://spec.commonmark.org/0.28/#example-230 +it('should start an ordered list at 0 when requested', function () { + expect( + marked('0. ok')). + toBe("
      \n
    1. ok
    2. \n
    \n") +}); + +// http://spec.commonmark.org/0.28/#example-234 +it('indents code within an explicitly-started ordered list', function () { + expect(marked(" 10. foo\n\n bar")). + toBe("
      \n
    1. foo

      \n
      bar\n
    2. \n
    \n"); +}); diff --git a/test/original/ordered_and_unordered_lists.html b/test/original/ordered_and_unordered_lists.html index 88066002..45469479 100644 --- a/test/original/ordered_and_unordered_lists.html +++ b/test/original/ordered_and_unordered_lists.html @@ -156,15 +156,9 @@ back.

    -

    Ordered lists continue with initial number:

    +

    Ordered lists start from initial zero:

    -
      -
    1. First
    2. -
    3. Second: -
        -
      • Fee
      • -
      • Fie
      • -
      • Foe
      • -
    4. -
    5. Third
    6. +
        +
      1. Zero
      2. +
      3. One
      diff --git a/test/original/ordered_and_unordered_lists.md b/test/original/ordered_and_unordered_lists.md index 3d5454d3..ea2b9c00 100644 --- a/test/original/ordered_and_unordered_lists.md +++ b/test/original/ordered_and_unordered_lists.md @@ -88,7 +88,7 @@ Multiple paragraphs: Item 2. graf two. The quick brown fox jumped over the lazy dog's back. - + 2. Item 2. 3. Item 3. @@ -135,11 +135,7 @@ Ordered lists start from initial number: 3. Three 1. Four -Ordered lists continue with initial number: +Ordered lists start from initial zero: -3. First -4. Second: - * Fee - * Fie - * Foe -5. Third +0. Zero +1. One From de18d8a726554f98a9aafbc334acecf4f3a4e423 Mon Sep 17 00:00:00 2001 From: Paul Roub Date: Tue, 20 Mar 2018 17:09:30 -0400 Subject: [PATCH 304/459] Use production, not unminified, code in marked spec test --- test/integration/marked-spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/marked-spec.js b/test/integration/marked-spec.js index a699bfaf..b312f8ee 100644 --- a/test/integration/marked-spec.js +++ b/test/integration/marked-spec.js @@ -1,4 +1,4 @@ -var marked = require('../../marked.js'); +var marked = require('../../marked.min.js'); it('should run the test', function () { expect(marked('Hello World!')).toBe('

      Hello World!

      \n'); From 341d128bee128c07179a9c278fcf08068992b448 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 20 Mar 2018 20:19:26 -0400 Subject: [PATCH 305/459] Merge branch 'master' into update-badges --- docs/AUTHORS.md | 148 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 docs/AUTHORS.md diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md new file mode 100644 index 00000000..80f97d6a --- /dev/null +++ b/docs/AUTHORS.md @@ -0,0 +1,148 @@ +# Authors + +Marked takes an encompassing approach to its community. As such, you can think of these as [concentric circles](https://medium.com/the-node-js-collection/healthy-open-source-967fa8be7951), where each subsequent group is enveloped by the previous one. + +## Users + +Users are anyone using Marked in some fashion, without them, there's no reason for us to exist. + +To be listed: please let us know or submit a PR. + +To be removed: please let us know or submit a PR. + +## Contributors + +Contributors are users who submit a [PR](https://github.com/markedjs/marked/pulls), [Issue](https://github.com/markedjs/marked/issues), or collaborate in making Marked a better product and experience for all the users. + +|Name |GitHub handle |Badge of honor | +|:-------------------|:----------------|:-------------------------------------| +|Karen Yavine |@karenyavine |Snyk's Security Saint | +|Federico Soave |@Feder1co5oave |Regent of the Regex, Master of Marked | +|Brandon der Blätter |@intcreator |Curious Contributor | +|Костя Третяк |@KostyaTretyak |-- | + +To be listed: make a contribution and, if it has significant impact, the committers may be able to add you here. + +To be removed: please let us know or submit a PR. + +[Details on badges](#badges) + +## Committers + +Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not their own). + +A note on "decision making authority". This is related to submitting PRs and the [advice process](http://www.reinventingorganizationswiki.com/Decision_Making). The person marked as having decision making authority over a certain area should be sought for advice in that area before committing to a course of action. + +|Name |GiHub handle |Decision making |Badges of honor (tag for questions) | +|:--------------|:--------------|:----------------------------------------|------------------------------------| +|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | | +|Steven |@styfle |Open source, of course and GitHub Guru | | +|Jamie Davis |@davisjam |Seeker of Security | | + +**Should not exceed 5:** For larger PRs affecting more of the codebase and, most likely, review by more people, we try to keep this pool small and responsive and let those with decision making authority have final say without negative repercussions from the other committers. + +To be listed: Committers are usually selected (or they volunteer, using the same process) from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). + +To be removed: You can remove yourself through the [GitHub UI](https://help.github.com/articles/removing-yourself-from-a-collaborator-s-repository/). + +A note on volunteering: + +1. Please do not volunteer unless you believe you can demonstrate to your peers you can do the work required. +2. Please do not overcommit yourself; we count on those committed to the project to be responsive. Really consider, with all you have going on, wehther you able to really commit to it. +3. Don't let the previous frighten you away, it can always be changed later by you or your peers. + +[Details on badges](#badges) + +## Admins + +Admins are committers who also have the responsibility, privilege, and burden of selecting committers and making sure the project itself runs smoothly, which includes community maintenance, governance, dispute resolution, and so on. (Letting the contributors easily enter into, and work within, the project to begin contributing, with as little friction as possible.) + +**Should not exceed 3:** When there are too many people with the ability to reolves disputes, the dispute itself can quickly turn into a dispute amongst the admins themselves; therefore, we want this group to be small enough to commit to action and large enough to not put too much burden on one person. (Should ensure faster resolution and responsiveness.) + +To be listed: Admins are usually selected from the pool of committers (or they volunteer, using the same process) who demonstrate good understanding of the marked culture, operations, and do their best to help new contributors get up to speed on how to contribute effectively to the project. + +To be removed: You can remove yourself through the [GitHub UI](https://help.github.com/articles/removing-yourself-from-a-collaborator-s-repository/). + +[Details on badges](#badges) + +## Publishers + +Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPM and performing outreach and external stakeholder communications. Further, when things go pear-shaped, they're the ones taking most of the heat. Finally, when things go well, they're the primary ones praising the contributors who made it possible. + +(In other words, while Admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external concerns.) + +|Name |GitHub handle |Decision making |Badges of honor (tag for questions) | +|:----------|:--------------|:------------------------|:-------------------------------------| +|Josh Bruce |@joshbruce |Release Wrangler |Humaning Helper, Heckler of Hypertext | + +**Should not exceed 2:** Having more people with the authority to publish a release can quickly turn into a consensus seeking nightmare (design by committee). Having only one is preferred (Directly Responsible Individual); however, given the nature of the project and its history, having an immediate fallback, and a potential deep fallback (Original author) is probably a good idea. + +[Details on badges](#badges) + +## Original author + +The original author is the publisher who started it all. + +Christopher Jeffrey @chjj + +

      Badges

      + +Badges? You don't *need* no stinkin' badges. + +Movie references aside. (It was either that or, "Let's play a game", but that would have been creepy…that's why it will most likely come later.) + +Badges? If you *want* 'em, we got 'em, and here's how you get 'em (and…dramatic pause…why not two dramatic pauses for emphasis?… how they can be taken away). + +- [ ] Add the appropriate badge to the desired contributor in the desired column of this page, even if they're not listed here yet. +- [ ] Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). +- [ ] Follow the instructions for submitting a badge PR. (There are more details to find within. Come on. Everybody likes surprises, right? No? Actually, we just try to put documentation where it belongs, closer to the code and part of the sequence of events.) + +### Badges at play: + +
      +
      Curious Contributor
      +
      A contributor with less than one year on this page who is actively engaged in submitting PRs, Issues, making recommendations, sharing thoughts…without being too annoying about it (let's be clear, submitting 100 Issues recommending the Marked Committers send everyone candy is trying for the badge, not honestly earning it).
      +
      Dr. DevOps
      +
      +

      Someone who understands and contributes to improving the developer experience and flow of Marked into the world.

      +
      + "The main characteristic of the DevOps movement is to strongly advocate automation and monitoring at all steps of software construction, from integration, testing, releasing to deployment and infrastructure management. DevOps aims at shorter development cycles, increased deployment frequency, more dependable releases, in close alignment with business objectives." ~ Wikipedia +
      +
      +
      Eye for the CLI
      +
      At this point? Pretty much anyone who can update that `man` file to the current Marked version without regression in the CLI tool itself.
      +
      GitHub Guru
      +
      Someone who always seems to be able to tell you easier ways to do things with GitHub.
      +
      Humaning Helper
      +
      Someone who goes out of their way to help contributors feel welcomed and valued. Further, someone who takes the extra steps(s) necessary to help new contributors get up to speed. Finally, they maintain composure even in times of disagreement and dispute resolution.
      +
      Heckler of Hypertext
      +
      Someone who demonstrates an esoteric level of knowledge when it comes to HTML. In other words, someone who says things like, "Did you know most Markdown flavors don't have a way to render a description list (`dl`)? All the more reason Markdown `!==` HTML."
      +
      Markdown Maestro
      +
      You know that person who knows about way too many different flavors of Markdown? The one who maybe seems a little too obsessed with the possibilities of Markdown beyond HTML? Come on. You know who they are. Or, at least you could, if you give them this badge.
      +
      Master of Marked
      +
      Someone who demonstrates they know the ins and outs of the codebase for Marked.
      +
      Open source, of course
      +
      Someone who advocates for and has a proven understanding of how to operate within open source communities.
      +
      Regent of the Regex
      +

      Can you demonstrate you understand the following without Google and Stackoverflow?

      +

      /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/

      +

      Because this author can't yet. That's who gets these.

      +
      +
      Seeker of Security
      +
      Someone who has demonstrated a high degree of expertise or authority when it comes to software security.
      +
      Titan of the Test Harness
      +
      Someone who demonstrates high-levels of understanding regarding Marked's test harness.
      +
      Totally Tron
      +
      Someone who demonstrates they are willing and able to "fight for the users", both developers dependent on marked to do their jobs as well as end-users interacting with the output (particularly in the realm of those with the disabilities).
      +
      + +### Special badges that come with the job: + +
      +
      Maker of the Marked mark
      +
      This badge is given to the person or oganization credited with creating the logo (or logotype) used in Marked communications for a given period of time. **Maker of the Marked mark from 2017 to present**, for example.
      +
      Release Wrangler
      +
      This is a badge given to all Publishers.
      +
      Snyk's Security Saint
      +
      This is a badge given to whomever primarily reaches out from Snyk to let us know about security issues.
      +
      From 265d6c1b3909b95401caf97a20376b2d52fb0f0c Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 20 Mar 2018 20:20:31 -0400 Subject: [PATCH 306/459] pre-commit --- README.md | 64 ++------- docs/CNAME | 1 + CODE_OF_CONDUCT.md => docs/CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md => docs/CONTRIBUTING.md | 8 +- PUBLISHING.md => docs/PUBLISHING.md | 2 +- docs/README.md | 99 +++++++++++++ USING_ADVANCED.md => docs/USING_ADVANCED.md | 0 USING_PRO.md => docs/USING_PRO.md | 0 {doc => docs}/broken.md | 0 docs/img/logo-black-and-white.svg | 133 ++++++++++++++++++ docs/img/logo-black.svg | 32 +++++ docs/index.html | 107 ++++++++++++++ 12 files changed, 387 insertions(+), 61 deletions(-) create mode 100644 docs/CNAME rename CODE_OF_CONDUCT.md => docs/CODE_OF_CONDUCT.md (96%) rename CONTRIBUTING.md => docs/CONTRIBUTING.md (85%) rename PUBLISHING.md => docs/PUBLISHING.md (94%) create mode 100644 docs/README.md rename USING_ADVANCED.md => docs/USING_ADVANCED.md (100%) rename USING_PRO.md => docs/USING_PRO.md (100%) rename {doc => docs}/broken.md (100%) create mode 100644 docs/img/logo-black-and-white.svg create mode 100644 docs/img/logo-black.svg create mode 100644 docs/index.html diff --git a/README.md b/README.md index 96ee203b..57f72074 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,19 @@ - - -

      Marked

      +# Marked Marked is -1. built for speed.* -2. a low-level markdown compiler that allows frequent parsing of large chunks of markdown without caching or blocking for long periods of time.** -3. light-weight while implementing all markdown features from the supported flavors & specifications.*** +1. built for speed. +2. a low-level markdown compiler that allows frequent parsing of large chunks of markdown without caching or blocking for long periods of time. +3. light-weight while implementing all markdown features from the supported flavors & specifications. 4. available as a command line interface (CLI) and running in client- or server-side JavaScript projects. -

      * Still working on metrics for comparative analysis and definition.
      -** As few dependencies as possible.
      -*** Strict compliance could result in slower processing when running comparative benchmarking.

      - -

      Installation

      +## Installation **CLI:** `npm install -g marked` **In-browser:** `npm install marked --save` -

      Usage

      +## Usage **CLI** @@ -48,52 +33,21 @@ $ cat hello.html Marked in the browser - +
      ``` -Marked offers [advanced configurations](https://github.com/markedjs/marked/blob/master/USING_ADVANCED.md) and [extensibility](https://github.com/markedjs/marked/blob/master/USING_PRO.md) as well. -

      Supported Markdown specifications

      - -We actively support the features of the following [Markdown flavors](https://github.com/commonmark/CommonMark/wiki/Markdown-Flavors). - -|Flavor |Version | -|:----------------------------------------------------------|:----------| -|The original markdown.pl |-- | -|[CommonMark](http://spec.commonmark.org/0.28/) |0.28 | -|[GitHub Flavored Markdown](https://github.github.com/gfm/) |0.28 | - -By supporting the above Markdown flavors, it's possible that Marked can help you use other flavors as well; however, these are not actively supported by the community. - -

      Security

      - -The only completely secure system is the one that doesn't exist in the first place. Having said that, we take the security of Marked very seriously. - -Therefore, please disclose potential security issues by email to the project [committers](https://github.com/markedjs/marked/blob/master/AUTHORS.md) as well as the [listed owners within NPM](https://docs.npmjs.com/cli/owner). We will provide an initial assessment of security reports within 48 hours and should apply patches within 2 weeks (also, feel free to contribute a fix for the issue). - -

      Contributing

      - -The marked community enjoys a spirit of collaboration and contribution from all comers. Whether you're just getting started with Markdown, JavaScript, and Marked or you're a veteran with it all figured out, we're here to help each other improve as professionals while helping Marked improve technically. Please see our [contributing documentation](https://github.com/markedjs/marked/blob/master/CONTRIBUTING.md) for more details. - -For our Contribution License Agreement, see our [license](https://github.com/markedjs/marked/blob/master/LICENSE.md). - -

      Authors

      - -For list of credited authors and contributors, please see our [authors page](https://github.com/markedjs/marked/blob/master/AUTHORS.md). - -

      License

      +## License Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) -See [license](https://github.com/markedjs/marked/blob/master/LICENSE.md) for more details. - diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 00000000..c92fdfcb --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +marked.js.org diff --git a/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md similarity index 96% rename from CODE_OF_CONDUCT.md rename to docs/CODE_OF_CONDUCT.md index 3fe8c89a..077c0fc7 100644 --- a/CODE_OF_CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team by submitting a PR with changes to the [AUTHORS](https://github.com/markedjs/marked/blob/master/AUTHORS.md) page (or emailing josh@8fold.com). All +reported by contacting the project team by submitting a PR with changes to the [AUTHORS](AUTHORS.md) page (or emailing josh@8fold.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. diff --git a/CONTRIBUTING.md b/docs/CONTRIBUTING.md similarity index 85% rename from CONTRIBUTING.md rename to docs/CONTRIBUTING.md index 9fbb4950..d2198554 100644 --- a/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -25,15 +25,15 @@ The following table lists the ticket type labels we use when there is work to be |Ticket type label |Description | |:----------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------| |L0 - security |A security vulnerability within the Marked library is discovered. | -|L1 - broken |Valid usage results in incorrect output compared to [supported specifications](https://github.com/markedjs/marked/blob/master/AUTHORS.md#specifications) OR causes marked to crash AND there is no known workaround for the issue. | +|L1 - broken |Valid usage results in incorrect output compared to [supported specifications](AUTHORS.md#specifications) OR causes marked to crash AND there is no known workaround for the issue. | |L2 - annoying |Similar to L1 - broken only there is a known workaround avaialable for the issue. | |RR - refactor and re-engineer |Results in an improvement to developers using Marked (improved readability) or end-users (faster performance) or both. | -|NFS - new feature (spec related) |A capability Marked does not currently provide but is in one of the [supported specifications](https://github.com/markedjs/marked/blob/master/AUTHORS.md#specifications)| +|NFS - new feature (spec related) |A capability Marked does not currently provide but is in one of the [supported specifications](AUTHORS.md#specifications)| |NFU - new feature (user requested) |A capability Marked does not currently provide but has been requested by users of Marked. | ## Test early, often, and everything -We try to write test cases to validate output (writing tests based on the [supported specifications](https://github.com/markedjs/marked/blob/master/AUTHORS.md#specifications)) and minimize regression (writing tests for issues fixed). Therefore, if you would like to contribute, some things you should know regarding the test harness. +We try to write test cases to validate output (writing tests based on the [supported specifications](AUTHORS.md#specifications)) and minimize regression (writing tests for issues fixed). Therefore, if you would like to contribute, some things you should know regarding the test harness. |Location |Description | |:-------------|:---------------------------------------------------| @@ -92,4 +92,4 @@ npm run build ## Publishing -Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [publishing documentation](https://github.com/markedjs/marked/blob/master/PUBLISHING.md). +Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [publishing documentation](PUBLISHING.md). diff --git a/PUBLISHING.md b/docs/PUBLISHING.md similarity index 94% rename from PUBLISHING.md rename to docs/PUBLISHING.md index 82a45d4b..4732fdf7 100644 --- a/PUBLISHING.md +++ b/docs/PUBLISHING.md @@ -1,6 +1,6 @@ # Releasing Marked -- [ ] See [contributing](https://github.com/markedjs/marked/blob/master/CONTRIBUTING.md) +- [ ] See [contributing](CONTRIBUTING.md) - [ ] Create release branch from `master` (`release-x.y.z`) - [ ] Submit PR with minimal name: Release x.y.z - [ ] Complete PR checklists diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..95dacd51 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,99 @@ + + +

      Marked

      + +Marked is + +1. built for speed.* +2. a low-level markdown compiler that allows frequent parsing of large chunks of markdown without caching or blocking for long periods of time.** +3. light-weight while implementing all markdown features from the supported flavors & specifications.*** +4. available as a command line interface (CLI) and running in client- or server-side JavaScript projects. + +

      * Still working on metrics for comparative analysis and definition.
      +** As few dependencies as possible.
      +*** Strict compliance could result in slower processing when running comparative benchmarking.

      + +

      Installation

      + +**CLI:** `npm install -g marked` + +**In-browser:** `npm install marked --save` + +

      Usage

      + +**CLI** + +``` bash +$ marked -o hello.html +hello world +^D +$ cat hello.html +

      hello world

      +``` + +**Browser** + +```html + + + + + Marked in the browser + + + +
      + + + +``` + + +Marked offers [advanced configurations](USING_ADVANCED.md) and [extensibility](USING_PRO.md) as well. + +

      Supported Markdown specifications

      + +We actively support the features of the following [Markdown flavors](https://github.com/commonmark/CommonMark/wiki/Markdown-Flavors). + +|Flavor |Version | +|:----------------------------------------------------------|:----------| +|The original markdown.pl |-- | +|[CommonMark](http://spec.commonmark.org/0.28/) |0.28 | +|[GitHub Flavored Markdown](https://github.github.com/gfm/) |0.28 | + +By supporting the above Markdown flavors, it's possible that Marked can help you use other flavors as well; however, these are not actively supported by the community. + +

      Security

      + +The only completely secure system is the one that doesn't exist in the first place. Having said that, we take the security of Marked very seriously. + +Therefore, please disclose potential security issues by email to the project [committers](AUTHORS.md) as well as the [listed owners within NPM](https://docs.npmjs.com/cli/owner). We will provide an initial assessment of security reports within 48 hours and should apply patches within 2 weeks (also, feel free to contribute a fix for the issue). + +

      Contributing

      + +The marked community enjoys a spirit of collaboration and contribution from all comers. Whether you're just getting started with Markdown, JavaScript, and Marked or you're a veteran with it all figured out, we're here to help each other improve as professionals while helping Marked improve technically. Please see our [contributing documentation](CONTRIBUTING.md) for more details. + +For our Contribution License Agreement, see our [license](https://github.com/markedjs/marked/blob/master/LICENSE.md). + +

      Authors

      + +For list of credited authors and contributors, please see our [authors page](AUTHORS.md). + +

      License

      + +Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) + +See [license](https://github.com/markedjs/marked/blob/master/LICENSE.md) for more details. + diff --git a/USING_ADVANCED.md b/docs/USING_ADVANCED.md similarity index 100% rename from USING_ADVANCED.md rename to docs/USING_ADVANCED.md diff --git a/USING_PRO.md b/docs/USING_PRO.md similarity index 100% rename from USING_PRO.md rename to docs/USING_PRO.md diff --git a/doc/broken.md b/docs/broken.md similarity index 100% rename from doc/broken.md rename to docs/broken.md diff --git a/docs/img/logo-black-and-white.svg b/docs/img/logo-black-and-white.svg new file mode 100644 index 00000000..5f6c0b78 --- /dev/null +++ b/docs/img/logo-black-and-white.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/img/logo-black.svg b/docs/img/logo-black.svg new file mode 100644 index 00000000..a67fb80e --- /dev/null +++ b/docs/img/logo-black.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 00000000..5be59468 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,107 @@ + + + + + Marked.js Documentation + + + +
      +
      + +

      Marked.js Documentation

      +
      + +
      +
      + + + + + + \ No newline at end of file From 044683b12a49a20a736e9369d375f9328c52190d Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 20 Mar 2018 20:23:24 -0400 Subject: [PATCH 307/459] Remove Authors ~Head --- docs/AUTHORS.md~HEAD | 148 ------------------------------------------- 1 file changed, 148 deletions(-) delete mode 100644 docs/AUTHORS.md~HEAD diff --git a/docs/AUTHORS.md~HEAD b/docs/AUTHORS.md~HEAD deleted file mode 100644 index 80f97d6a..00000000 --- a/docs/AUTHORS.md~HEAD +++ /dev/null @@ -1,148 +0,0 @@ -# Authors - -Marked takes an encompassing approach to its community. As such, you can think of these as [concentric circles](https://medium.com/the-node-js-collection/healthy-open-source-967fa8be7951), where each subsequent group is enveloped by the previous one. - -## Users - -Users are anyone using Marked in some fashion, without them, there's no reason for us to exist. - -To be listed: please let us know or submit a PR. - -To be removed: please let us know or submit a PR. - -## Contributors - -Contributors are users who submit a [PR](https://github.com/markedjs/marked/pulls), [Issue](https://github.com/markedjs/marked/issues), or collaborate in making Marked a better product and experience for all the users. - -|Name |GitHub handle |Badge of honor | -|:-------------------|:----------------|:-------------------------------------| -|Karen Yavine |@karenyavine |Snyk's Security Saint | -|Federico Soave |@Feder1co5oave |Regent of the Regex, Master of Marked | -|Brandon der Blätter |@intcreator |Curious Contributor | -|Костя Третяк |@KostyaTretyak |-- | - -To be listed: make a contribution and, if it has significant impact, the committers may be able to add you here. - -To be removed: please let us know or submit a PR. - -[Details on badges](#badges) - -## Committers - -Committers are contributors who also have the responsibility, privilege, some might even say burden of being able to review and merge contributions (just usually not their own). - -A note on "decision making authority". This is related to submitting PRs and the [advice process](http://www.reinventingorganizationswiki.com/Decision_Making). The person marked as having decision making authority over a certain area should be sought for advice in that area before committing to a course of action. - -|Name |GiHub handle |Decision making |Badges of honor (tag for questions) | -|:--------------|:--------------|:----------------------------------------|------------------------------------| -|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | | -|Steven |@styfle |Open source, of course and GitHub Guru | | -|Jamie Davis |@davisjam |Seeker of Security | | - -**Should not exceed 5:** For larger PRs affecting more of the codebase and, most likely, review by more people, we try to keep this pool small and responsive and let those with decision making authority have final say without negative repercussions from the other committers. - -To be listed: Committers are usually selected (or they volunteer, using the same process) from contributors who enter the discussions regarding the future direction of Marked (maybe even doing informal reviews of contributions despite not being able to merge them yourself). - -To be removed: You can remove yourself through the [GitHub UI](https://help.github.com/articles/removing-yourself-from-a-collaborator-s-repository/). - -A note on volunteering: - -1. Please do not volunteer unless you believe you can demonstrate to your peers you can do the work required. -2. Please do not overcommit yourself; we count on those committed to the project to be responsive. Really consider, with all you have going on, wehther you able to really commit to it. -3. Don't let the previous frighten you away, it can always be changed later by you or your peers. - -[Details on badges](#badges) - -## Admins - -Admins are committers who also have the responsibility, privilege, and burden of selecting committers and making sure the project itself runs smoothly, which includes community maintenance, governance, dispute resolution, and so on. (Letting the contributors easily enter into, and work within, the project to begin contributing, with as little friction as possible.) - -**Should not exceed 3:** When there are too many people with the ability to reolves disputes, the dispute itself can quickly turn into a dispute amongst the admins themselves; therefore, we want this group to be small enough to commit to action and large enough to not put too much burden on one person. (Should ensure faster resolution and responsiveness.) - -To be listed: Admins are usually selected from the pool of committers (or they volunteer, using the same process) who demonstrate good understanding of the marked culture, operations, and do their best to help new contributors get up to speed on how to contribute effectively to the project. - -To be removed: You can remove yourself through the [GitHub UI](https://help.github.com/articles/removing-yourself-from-a-collaborator-s-repository/). - -[Details on badges](#badges) - -## Publishers - -Publishers are admins who also have the responsibility, privilege, and burden of publishing the new releases to NPM and performing outreach and external stakeholder communications. Further, when things go pear-shaped, they're the ones taking most of the heat. Finally, when things go well, they're the primary ones praising the contributors who made it possible. - -(In other words, while Admins are focused primarily on the internal workings of the project, Publishers are focused on internal *and* external concerns.) - -|Name |GitHub handle |Decision making |Badges of honor (tag for questions) | -|:----------|:--------------|:------------------------|:-------------------------------------| -|Josh Bruce |@joshbruce |Release Wrangler |Humaning Helper, Heckler of Hypertext | - -**Should not exceed 2:** Having more people with the authority to publish a release can quickly turn into a consensus seeking nightmare (design by committee). Having only one is preferred (Directly Responsible Individual); however, given the nature of the project and its history, having an immediate fallback, and a potential deep fallback (Original author) is probably a good idea. - -[Details on badges](#badges) - -## Original author - -The original author is the publisher who started it all. - -Christopher Jeffrey @chjj - -

      Badges

      - -Badges? You don't *need* no stinkin' badges. - -Movie references aside. (It was either that or, "Let's play a game", but that would have been creepy…that's why it will most likely come later.) - -Badges? If you *want* 'em, we got 'em, and here's how you get 'em (and…dramatic pause…why not two dramatic pauses for emphasis?… how they can be taken away). - -- [ ] Add the appropriate badge to the desired contributor in the desired column of this page, even if they're not listed here yet. -- [ ] Submit a PR (we're big on PRs around here, if you haven't noticed, help us help you). -- [ ] Follow the instructions for submitting a badge PR. (There are more details to find within. Come on. Everybody likes surprises, right? No? Actually, we just try to put documentation where it belongs, closer to the code and part of the sequence of events.) - -### Badges at play: - -
      -
      Curious Contributor
      -
      A contributor with less than one year on this page who is actively engaged in submitting PRs, Issues, making recommendations, sharing thoughts…without being too annoying about it (let's be clear, submitting 100 Issues recommending the Marked Committers send everyone candy is trying for the badge, not honestly earning it).
      -
      Dr. DevOps
      -
      -

      Someone who understands and contributes to improving the developer experience and flow of Marked into the world.

      -
      - "The main characteristic of the DevOps movement is to strongly advocate automation and monitoring at all steps of software construction, from integration, testing, releasing to deployment and infrastructure management. DevOps aims at shorter development cycles, increased deployment frequency, more dependable releases, in close alignment with business objectives." ~ Wikipedia -
      -
      -
      Eye for the CLI
      -
      At this point? Pretty much anyone who can update that `man` file to the current Marked version without regression in the CLI tool itself.
      -
      GitHub Guru
      -
      Someone who always seems to be able to tell you easier ways to do things with GitHub.
      -
      Humaning Helper
      -
      Someone who goes out of their way to help contributors feel welcomed and valued. Further, someone who takes the extra steps(s) necessary to help new contributors get up to speed. Finally, they maintain composure even in times of disagreement and dispute resolution.
      -
      Heckler of Hypertext
      -
      Someone who demonstrates an esoteric level of knowledge when it comes to HTML. In other words, someone who says things like, "Did you know most Markdown flavors don't have a way to render a description list (`dl`)? All the more reason Markdown `!==` HTML."
      -
      Markdown Maestro
      -
      You know that person who knows about way too many different flavors of Markdown? The one who maybe seems a little too obsessed with the possibilities of Markdown beyond HTML? Come on. You know who they are. Or, at least you could, if you give them this badge.
      -
      Master of Marked
      -
      Someone who demonstrates they know the ins and outs of the codebase for Marked.
      -
      Open source, of course
      -
      Someone who advocates for and has a proven understanding of how to operate within open source communities.
      -
      Regent of the Regex
      -

      Can you demonstrate you understand the following without Google and Stackoverflow?

      -

      /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/

      -

      Because this author can't yet. That's who gets these.

      -
      -
      Seeker of Security
      -
      Someone who has demonstrated a high degree of expertise or authority when it comes to software security.
      -
      Titan of the Test Harness
      -
      Someone who demonstrates high-levels of understanding regarding Marked's test harness.
      -
      Totally Tron
      -
      Someone who demonstrates they are willing and able to "fight for the users", both developers dependent on marked to do their jobs as well as end-users interacting with the output (particularly in the realm of those with the disabilities).
      -
      - -### Special badges that come with the job: - -
      -
      Maker of the Marked mark
      -
      This badge is given to the person or oganization credited with creating the logo (or logotype) used in Marked communications for a given period of time. **Maker of the Marked mark from 2017 to present**, for example.
      -
      Release Wrangler
      -
      This is a badge given to all Publishers.
      -
      Snyk's Security Saint
      -
      This is a badge given to whomever primarily reaches out from Snyk to let us know about security issues.
      -
      From 78a0258d81509f90ee5d6c9daac63f109ad9e00a Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 20 Mar 2018 20:43:50 -0400 Subject: [PATCH 308/459] styfle to admin --- docs/AUTHORS.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 094b42bc..341126b1 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -36,7 +36,6 @@ A note on "decision making authority". This is related to submitting PRs and the |Name |GiHub handle |Decision making |Badges of honor (tag for questions) | |:--------------|:--------------|:----------------------------------------|------------------------------------| |Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | | -|Steven |@styfle |Open source, of course and GitHub Guru | | |Jamie Davis |@davisjam |Seeker of Security | | **Should not exceed 5:** For larger PRs affecting more of the codebase and, most likely, review by more people, we try to keep this pool small and responsive and let those with decision making authority have final say without negative repercussions from the other committers. @@ -57,6 +56,10 @@ A note on volunteering: Admins are committers who also have the responsibility, privilege, and burden of selecting committers and making sure the project itself runs smoothly, which includes community maintenance, governance, dispute resolution, and so on. (Letting the contributors easily enter into, and work within, the project to begin contributing, with as little friction as possible.) +|Name |GiHub handle |Decision making |Badges of honor (tag for questions) | +|:--------------|:--------------|:----------------------------------------|------------------------------------| +|Steven |@styfle |Open source, of course and GitHub Guru |Humaning Helper | + **Should not exceed 3:** When there are too many people with the ability to reolves disputes, the dispute itself can quickly turn into a dispute amongst the admins themselves; therefore, we want this group to be small enough to commit to action and large enough to not put too much burden on one person. (Should ensure faster resolution and responsiveness.) To be listed: Admins are usually selected from the pool of committers (or they volunteer, using the same process) who demonstrate good understanding of the marked culture, operations, and do their best to help new contributors get up to speed on how to contribute effectively to the project. From c3ef1f7877406aa0d8ca90bacae05136c18a8c84 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 20 Mar 2018 20:54:26 -0400 Subject: [PATCH 309/459] Alphabetize and add carlos --- docs/AUTHORS.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 80f97d6a..bd5b6a9c 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -14,12 +14,13 @@ To be removed: please let us know or submit a PR. Contributors are users who submit a [PR](https://github.com/markedjs/marked/pulls), [Issue](https://github.com/markedjs/marked/issues), or collaborate in making Marked a better product and experience for all the users. -|Name |GitHub handle |Badge of honor | -|:-------------------|:----------------|:-------------------------------------| -|Karen Yavine |@karenyavine |Snyk's Security Saint | -|Federico Soave |@Feder1co5oave |Regent of the Regex, Master of Marked | -|Brandon der Blätter |@intcreator |Curious Contributor | -|Костя Третяк |@KostyaTretyak |-- | +|Name |GitHub handle |Badge of honor | +|:-------------------|:----------------|:---------------------------------------------| +|Brandon der Blätter |@intcreator |Curious Contributor | +|Carlos Valle |@carlosvalle |Maker of the Marked mark from 2018 to present | +|Federico Soave |@Feder1co5oave |Regent of the Regex, Master of Marked | +|Karen Yavine |@karenyavine |Snyk's Security Saint | +|Костя Третяк |@KostyaTretyak |-- | To be listed: make a contribution and, if it has significant impact, the committers may be able to add you here. @@ -35,9 +36,9 @@ A note on "decision making authority". This is related to submitting PRs and the |Name |GiHub handle |Decision making |Badges of honor (tag for questions) | |:--------------|:--------------|:----------------------------------------|------------------------------------| -|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | | -|Steven |@styfle |Open source, of course and GitHub Guru | | |Jamie Davis |@davisjam |Seeker of Security | | +|Steven |@styfle |Open source, of course and GitHub Guru | | +|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | | **Should not exceed 5:** For larger PRs affecting more of the codebase and, most likely, review by more people, we try to keep this pool small and responsive and let those with decision making authority have final say without negative repercussions from the other committers. From f69a82f7bcf856d2001f8c980d96c924910e74ac Mon Sep 17 00:00:00 2001 From: Paul Roub Date: Wed, 21 Mar 2018 09:23:13 -0400 Subject: [PATCH 310/459] Remove redundant cast --- lib/marked.js | 2 +- marked.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index b27e233c..5552616e 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -841,7 +841,7 @@ Renderer.prototype.hr = function() { Renderer.prototype.list = function(body, ordered, start) { var type = ordered ? 'ol' : 'ul', - startatt = (ordered && +start !== 1) ? (' start="' + start + '"') : ''; + startatt = (ordered && start !== 1) ? (' start="' + start + '"') : ''; return '<' + type + startatt + '>\n' + body + '\n'; }; diff --git a/marked.min.js b/marked.min.js index 3f2eb428..1599b0f0 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -(function(root){"use strict";var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};block._label=/(?:\\[\[\]]|[^\[\]])+/;block._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/;block.def=edit(block.def).replace("label",block._label).replace("title",block._title).getRegex();block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=edit(block.item,"gm").replace(/bull/g,block.bullet).getRegex();block.list=edit(block.list).replace(/bull/g,block.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+block.def.source+")").getRegex();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b";block.html=edit(block.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,block._tag).getRegex();block.paragraph=edit(block.paragraph).replace("hr",block.hr).replace("heading",block.heading).replace("lheading",block.lheading).replace("tag","<"+block._tag).getRegex();block.blockquote=edit(block.blockquote).replace("paragraph",block.paragraph).getRegex();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=edit(block.paragraph).replace("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|").getRegex();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top){src=src.replace(/^ +$/gm,"");var next,loose,cap,bull,b,item,space,i,tag,l,isordered;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]||""});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];isordered=bull.length>1;this.tokens.push({type:"list_start",ordered:isordered,start:isordered?+bull:""});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&(cap[1]==="pre"||cap[1]==="script"||cap[1]==="style"),text:cap[0]});continue}if(top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);if(cap[3])cap[3]=cap[3].substring(1,cap[3].length-1);tag=cap[1].toLowerCase();if(!this.tokens.links[tag]){this.tokens.links[tag]={href:cap[2],title:cap[3]}}continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:noop,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=edit(inline.link).replace("inside",inline._inside).replace("href",inline._href).getRegex();inline.reflink=edit(inline.reflink).replace("inside",inline._inside).getRegex();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:edit(inline.escape).replace("])","~|])").getRegex(),url:edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",inline._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:edit(inline.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()});inline.breaks=merge({},inline.gfm,{br:edit(inline.br).replace("{2,}","*").getRegex(),text:edit(inline.gfm.text).replace("{2,}","*").getRegex()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=escape(this.mangle(cap[1]));href="mailto:"+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){cap[0]=this.rules._backpedal.exec(cap[0])[0];src=src.substring(cap[0].length);if(cap[2]==="@"){text=escape(cap[0]);href="mailto:"+text}else{text=escape(cap[0]);if(cap[1]==="www."){href="http://"+text}else{href=text}}out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(cap[0]):escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2].trim(),true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.text(escape(this.smartypants(cap[0])));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){if(!this.options.mangle)return text;var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
      "+(escaped?code:escape(code,true))+"\n
      "}return'
      '+(escaped?code:escape(code,true))+"\n
      \n"};Renderer.prototype.blockquote=function(quote){return"
      \n"+quote+"
      \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
      \n":"
      \n"};Renderer.prototype.list=function(body,ordered,start){var type=ordered?"ol":"ul",startatt=ordered&&+start!==1?' start="'+start+'"':"";return"<"+type+startatt+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
    7. "+text+"
    8. \n"};Renderer.prototype.paragraph=function(text){return"

      "+text+"

      \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
      \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
      ":"
      "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return text}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0||prot.indexOf("data:")===0){return text}}if(this.options.baseUrl&&!originIndependentUrl.test(href)){href=resolveUrl(this.options.baseUrl,href)}var out='
      ";return out};Renderer.prototype.image=function(href,title,text){if(this.options.baseUrl&&!originIndependentUrl.test(href)){href=resolveUrl(this.options.baseUrl,href)}var out=''+text+'":">";return out};Renderer.prototype.text=function(text){return text};function TextRenderer(){}TextRenderer.prototype.strong=TextRenderer.prototype.em=TextRenderer.prototype.codespan=TextRenderer.prototype.del=TextRenderer.prototype.text=function(text){return text};TextRenderer.prototype.link=TextRenderer.prototype.image=function(href,title,text){return""+text};TextRenderer.prototype.br=function(){return""};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options){var parser=new Parser(options);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options);this.inlineText=new InlineLexer(src.links,merge({},this.options,{renderer:new TextRenderer}));this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,unescape(this.inlineText.output(this.token.text)))}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function edit(regex,opt){regex=regex.source;opt=opt||"";return{replace:function(name,val){val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return this},getRegex:function(){return new RegExp(regex,opt)}}}function resolveUrl(base,href){if(!baseUrls[" "+base]){if(/^[^:]+:\/*[^/]*$/.test(base)){baseUrls[" "+base]=base+"/"}else{baseUrls[" "+base]=base.replace(/[^/]*$/,"")}}base=baseUrls[" "+base];if(href.slice(0,2)==="//"){return base.replace(/:[\s\S]*/,":")+href}else if(href.charAt(0)==="/"){return base.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+href}else{return base+href}}var baseUrls={};var originIndependentUrl=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occurred:

      "+escape(e.message+"",true)+"
      "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false,baseUrl:null};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.TextRenderer=TextRenderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{root.marked=marked}})(this||(typeof window!=="undefined"?window:global)); \ No newline at end of file +(function(root){"use strict";var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};block._label=/(?:\\[\[\]]|[^\[\]])+/;block._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/;block.def=edit(block.def).replace("label",block._label).replace("title",block._title).getRegex();block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=edit(block.item,"gm").replace(/bull/g,block.bullet).getRegex();block.list=edit(block.list).replace(/bull/g,block.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+block.def.source+")").getRegex();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b";block.html=edit(block.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,block._tag).getRegex();block.paragraph=edit(block.paragraph).replace("hr",block.hr).replace("heading",block.heading).replace("lheading",block.lheading).replace("tag","<"+block._tag).getRegex();block.blockquote=edit(block.blockquote).replace("paragraph",block.paragraph).getRegex();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=edit(block.paragraph).replace("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|").getRegex();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top){src=src.replace(/^ +$/gm,"");var next,loose,cap,bull,b,item,space,i,tag,l,isordered;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]||""});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];isordered=bull.length>1;this.tokens.push({type:"list_start",ordered:isordered,start:isordered?+bull:""});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&(cap[1]==="pre"||cap[1]==="script"||cap[1]==="style"),text:cap[0]});continue}if(top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);if(cap[3])cap[3]=cap[3].substring(1,cap[3].length-1);tag=cap[1].toLowerCase();if(!this.tokens.links[tag]){this.tokens.links[tag]={href:cap[2],title:cap[3]}}continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:noop,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=edit(inline.link).replace("inside",inline._inside).replace("href",inline._href).getRegex();inline.reflink=edit(inline.reflink).replace("inside",inline._inside).getRegex();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:edit(inline.escape).replace("])","~|])").getRegex(),url:edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",inline._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:edit(inline.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()});inline.breaks=merge({},inline.gfm,{br:edit(inline.br).replace("{2,}","*").getRegex(),text:edit(inline.gfm.text).replace("{2,}","*").getRegex()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=escape(this.mangle(cap[1]));href="mailto:"+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){cap[0]=this.rules._backpedal.exec(cap[0])[0];src=src.substring(cap[0].length);if(cap[2]==="@"){text=escape(cap[0]);href="mailto:"+text}else{text=escape(cap[0]);if(cap[1]==="www."){href="http://"+text}else{href=text}}out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^
      /i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(cap[0]):escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2].trim(),true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.text(escape(this.smartypants(cap[0])));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){if(!this.options.mangle)return text;var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
      "+(escaped?code:escape(code,true))+"\n
      "}return'
      '+(escaped?code:escape(code,true))+"\n
      \n"};Renderer.prototype.blockquote=function(quote){return"
      \n"+quote+"
      \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
      \n":"
      \n"};Renderer.prototype.list=function(body,ordered,start){var type=ordered?"ol":"ul",startatt=ordered&&start!==1?' start="'+start+'"':"";return"<"+type+startatt+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
    9. "+text+"
    10. \n"};Renderer.prototype.paragraph=function(text){return"

      "+text+"

      \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
      \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
      ":"
      "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return text}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0||prot.indexOf("data:")===0){return text}}if(this.options.baseUrl&&!originIndependentUrl.test(href)){href=resolveUrl(this.options.baseUrl,href)}var out='
      ";return out};Renderer.prototype.image=function(href,title,text){if(this.options.baseUrl&&!originIndependentUrl.test(href)){href=resolveUrl(this.options.baseUrl,href)}var out=''+text+'":">";return out};Renderer.prototype.text=function(text){return text};function TextRenderer(){}TextRenderer.prototype.strong=TextRenderer.prototype.em=TextRenderer.prototype.codespan=TextRenderer.prototype.del=TextRenderer.prototype.text=function(text){return text};TextRenderer.prototype.link=TextRenderer.prototype.image=function(href,title,text){return""+text};TextRenderer.prototype.br=function(){return""};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options){var parser=new Parser(options);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options);this.inlineText=new InlineLexer(src.links,merge({},this.options,{renderer:new TextRenderer}));this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,unescape(this.inlineText.output(this.token.text)))}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function edit(regex,opt){regex=regex.source;opt=opt||"";return{replace:function(name,val){val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return this},getRegex:function(){return new RegExp(regex,opt)}}}function resolveUrl(base,href){if(!baseUrls[" "+base]){if(/^[^:]+:\/*[^/]*$/.test(base)){baseUrls[" "+base]=base+"/"}else{baseUrls[" "+base]=base.replace(/[^/]*$/,"")}}base=baseUrls[" "+base];if(href.slice(0,2)==="//"){return base.replace(/:[\s\S]*/,":")+href}else if(href.charAt(0)==="/"){return base.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+href}else{return base+href}}var baseUrls={};var originIndependentUrl=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occurred:

      "+escape(e.message+"",true)+"
      "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false,baseUrl:null};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.TextRenderer=TextRenderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{root.marked=marked}})(this||(typeof window!=="undefined"?window:global)); \ No newline at end of file From 2c20df95c45d5f9bca06d7598571a37fafb02e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=81=93=E5=8C=96=E5=B8=AB?= Date: Thu, 22 Mar 2018 01:53:40 +0900 Subject: [PATCH 311/459] Fix usage links in USING_ADVANCED.md --- docs/USING_ADVANCED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/USING_ADVANCED.md b/docs/USING_ADVANCED.md index eef4c2c1..c3660ac5 100644 --- a/docs/USING_ADVANCED.md +++ b/docs/USING_ADVANCED.md @@ -42,7 +42,7 @@ console.log(myMarked('I am using __markdown__.')); |Member |Type |Notes | |:----------|:---------|:----------------------------------------------------------------------------------------------------------------------------| |highlight |`function`|A function to highlight code blocks. See also:
      Asynchronous highlighting. | -|renderer |`object` |An object containing functions to render tokens to HTML. See [extensibility](https://github.com/markedjs/marked/blob/master/USAGE_EXTENSIBILITY.md) for more details. Default: `new Renderer()`| +|renderer |`object` |An object containing functions to render tokens to HTML. See [extensibility](https://github.com/markedjs/marked/blob/master/docs/USING_PRO.md) for more details. Default: `new Renderer()`| |pedantic |`boolean` |Conform to obscure parts of `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Default: `false`| |gfm |`boolean` |Use approved [GitHub Flavored Markdown (GFM) specification](https://github.github.com/gfm/). | |tables |`boolean` |Use [GFM Tables extension](https://github.github.com/gfm/#tables-extension-). Requires `gfm` be `true`. | From 5d5fa049ad669ead249812d370c78da9ea7f94de Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Thu, 22 Mar 2018 12:22:13 -0400 Subject: [PATCH 312/459] 0.3.18 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e48745b..cfba80de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "marked", - "version": "0.3.17", + "version": "0.3.18", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b8a4702e..a2cdb752 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "marked", "description": "A markdown parser built for speed", "author": "Christopher Jeffrey", - "version": "0.3.17", + "version": "0.3.18", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", From 98c9d147ad3969eabf647f8fd1fe7b211544670a Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Thu, 22 Mar 2018 12:33:05 -0400 Subject: [PATCH 313/459] Update home page --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a2cdb752..c59bfbfb 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "bin": "./bin/marked", "man": "./man/marked.1", "repository": "git://github.com/markedjs/marked.git", - "homepage": "https://github.com/markedjs/marked", + "homepage": "https://marked.js.org", "bugs": { "url": "http://github.com/markedjs/marked/issues" }, From 24c0b7fd660e7a9755086074ad27623c426355da Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 22 Mar 2018 11:57:04 -0500 Subject: [PATCH 314/459] fix installation nav --- docs/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/README.md b/docs/README.md index 95dacd51..be8d25e6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@
      • About
      • -
      • Installation
      • +
      • Installation
      • Usage
      • Supported Markdown specifications
      • Security
      • @@ -11,7 +11,7 @@

        Marked

        -Marked is +Marked is 1. built for speed.* 2. a low-level markdown compiler that allows frequent parsing of large chunks of markdown without caching or blocking for long periods of time.** @@ -96,4 +96,3 @@ For list of credited authors and contributors, please see our [authors page](AUT Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) See [license](https://github.com/markedjs/marked/blob/master/LICENSE.md) for more details. - From f5a4add797bc2f60cb21ae8d485ca34d3703b481 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 22 Mar 2018 13:49:47 -0500 Subject: [PATCH 315/459] add home link to header --- docs/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/index.html b/docs/index.html index 5be59468..fde7c1f0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -65,10 +65,12 @@
        - + + +

        Marked.js Documentation

        - +
        From fd9f44413301b5ba186f61db06b8ddfa1336a983 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 22 Mar 2018 14:22:57 -0500 Subject: [PATCH 316/459] add github ribbon --- docs/index.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/index.html b/docs/index.html index fde7c1f0..3b2738f8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,6 +12,7 @@ } #container { + position: relative; max-width: 800px; margin: auto; padding: 10px; @@ -60,6 +61,13 @@ background-color: rgba(27,31,35,0.05); border-radius: 3px; } + + .github-ribbon { + position: absolute; + top: 0; + right: 0; + border: 0; + } @@ -71,6 +79,10 @@

        Marked.js Documentation

        + + Fork me on GitHub + +
    @@ -102,8 +114,8 @@ + '

    ' + e.message + '

    '; }); } - + fetchPage('README.md'); - \ No newline at end of file + From 9c01b83370792d9b0e6c2cb1903ca67191a76269 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 22 Mar 2018 14:33:27 -0500 Subject: [PATCH 317/459] link to README.md --- docs/index.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/index.html b/docs/index.html index 3b2738f8..c9b0fda4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -73,7 +73,7 @@
    - +

    Marked.js Documentation

    @@ -92,14 +92,15 @@ var content = document.querySelector('#content'); var body = document.querySelector('html'); - content.addEventListener('click', function (e) { - var a = e.target; - if (a.tagName.toLowerCase() === 'a' && a.href.indexOf(location.origin) === 0) { + body.addEventListener('click', function (e) { + var a = e.target.closest('a'); + if (a && a.href.indexOf(location.origin) === 0) { var page = a.href.slice(location.origin.length + location.pathname.length); if (page.slice(-3) === '.md') { e.preventDefault(); fetchPage(page); } + history.replaceState("", document.title, "/"); } }, false); From 210eed715b5c26f4db2b982236638ddde50159c7 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Thu, 22 Mar 2018 16:19:44 -0400 Subject: [PATCH 318/459] Update badge template (#1155) --- .github/PULL_REQUEST_TEMPLATE/badges.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/badges.md b/.github/PULL_REQUEST_TEMPLATE/badges.md index f995535b..6b77663a 100644 --- a/.github/PULL_REQUEST_TEMPLATE/badges.md +++ b/.github/PULL_REQUEST_TEMPLATE/badges.md @@ -1,7 +1,8 @@ **@mention the contributor:** -This is a recommendation to: +## Recommendation to: +- [ ] Change user group - [ ] Add a badge - [ ] Remove a badge @@ -13,10 +14,11 @@ This is a recommendation to: --> -If you're the one mentioned in this PR: +## As the one mentioned, I would like to: -- [ ] whether you will accept the badge or not; or, -- [ ] whether you will or will not dispute the recommendation to remove +- [ ] accept the recommendation; or, +- [ ] graciously decline; or, +- [ ] dispute the recommendation within 30 days (silence is consent at this point, can't have the pull requests page filled with PRs related to badges forever). From f29bceb025a31d95a6205d2fcfd6b2385905d8b9 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Thu, 22 Mar 2018 16:20:32 -0400 Subject: [PATCH 319/459] Update publishing template (#1154) --- .github/PULL_REQUEST_TEMPLATE/release.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index d2183990..29cd7f2e 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -3,7 +3,7 @@ - [ ] `$ npm version` has been run. - [ ] Release notes in [draft GitHub release](https://github.com/markedjs/marked/releases) are up to date - [ ] Release notes include which flavors and versions of Markdown are supported by this release -- [ ] Reviewer checklist is complete. +- [ ] Committer checklist is complete. - [ ] Merge PR. - [ ] Publish GitHub release using `master` with correct version number. - [ ] `$ npm publish` has been run. @@ -19,9 +19,7 @@ Note: If merges to `master` occur after submitting this PR and before running `$ In most cases, this should be someone different than the publisher. -- [ ] Version in `package.json` has been updated (see [RELEASE.md](https://github.com/markedjs/marked/blob/master/docs/RELEASE.md)). +- [ ] Version in `package.json` has been updated (see [PUBLISHING.md](https://github.com/markedjs/marked/blob/master/docs/PUBLISHING.md)). - [ ] The `marked.min.js` has been updated; or, - [ ] release does not change library. -- [ ] cm_autolinks is the only failing test (remove once CI is in place and all tests pass). -- [ ] All lint checks pass (remove once CI is in place). - [ ] CI is green (no forced merge required). From 29f4190117eb59ff9f644bc17046d141343647cf Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 23 Mar 2018 07:50:42 -0400 Subject: [PATCH 320/459] Ignore DS_Store on macos --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 14a781d9..68ccf75d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +.DS_Store node_modules/ test/compiled_tests From cf2def076f9b8c0ff9c09ae5be816f0605a976ef Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 23 Mar 2018 07:51:20 -0400 Subject: [PATCH 321/459] minify --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index 1599b0f0..129871ad 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -(function(root){"use strict";var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};block._label=/(?:\\[\[\]]|[^\[\]])+/;block._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/;block.def=edit(block.def).replace("label",block._label).replace("title",block._title).getRegex();block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=edit(block.item,"gm").replace(/bull/g,block.bullet).getRegex();block.list=edit(block.list).replace(/bull/g,block.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+block.def.source+")").getRegex();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b";block.html=edit(block.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,block._tag).getRegex();block.paragraph=edit(block.paragraph).replace("hr",block.hr).replace("heading",block.heading).replace("lheading",block.lheading).replace("tag","<"+block._tag).getRegex();block.blockquote=edit(block.blockquote).replace("paragraph",block.paragraph).getRegex();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=edit(block.paragraph).replace("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|").getRegex();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top){src=src.replace(/^ +$/gm,"");var next,loose,cap,bull,b,item,space,i,tag,l,isordered;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]||""});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];isordered=bull.length>1;this.tokens.push({type:"list_start",ordered:isordered,start:isordered?+bull:""});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&(cap[1]==="pre"||cap[1]==="script"||cap[1]==="style"),text:cap[0]});continue}if(top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);if(cap[3])cap[3]=cap[3].substring(1,cap[3].length-1);tag=cap[1].toLowerCase();if(!this.tokens.links[tag]){this.tokens.links[tag]={href:cap[2],title:cap[3]}}continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:noop,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=edit(inline.link).replace("inside",inline._inside).replace("href",inline._href).getRegex();inline.reflink=edit(inline.reflink).replace("inside",inline._inside).getRegex();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:edit(inline.escape).replace("])","~|])").getRegex(),url:edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",inline._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:edit(inline.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()});inline.breaks=merge({},inline.gfm,{br:edit(inline.br).replace("{2,}","*").getRegex(),text:edit(inline.gfm.text).replace("{2,}","*").getRegex()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=escape(this.mangle(cap[1]));href="mailto:"+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){cap[0]=this.rules._backpedal.exec(cap[0])[0];src=src.substring(cap[0].length);if(cap[2]==="@"){text=escape(cap[0]);href="mailto:"+text}else{text=escape(cap[0]);if(cap[1]==="www."){href="http://"+text}else{href=text}}out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(cap[0]):escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2].trim(),true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.text(escape(this.smartypants(cap[0])));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){if(!this.options.mangle)return text;var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"
    "+(escaped?code:escape(code,true))+"\n
    "}return'
    '+(escaped?code:escape(code,true))+"\n
    \n"};Renderer.prototype.blockquote=function(quote){return"
    \n"+quote+"
    \n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"'+text+"\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"};Renderer.prototype.list=function(body,ordered,start){var type=ordered?"ol":"ul",startatt=ordered&&start!==1?' start="'+start+'"':"";return"<"+type+startatt+">\n"+body+"\n"};Renderer.prototype.listitem=function(text){return"
  • "+text+"
  • \n"};Renderer.prototype.paragraph=function(text){return"

    "+text+"

    \n"};Renderer.prototype.table=function(header,body){return"\n"+"\n"+header+"\n"+"\n"+body+"\n"+"
    \n"};Renderer.prototype.tablerow=function(content){return"\n"+content+"\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"\n"};Renderer.prototype.strong=function(text){return""+text+""};Renderer.prototype.em=function(text){return""+text+""};Renderer.prototype.codespan=function(text){return""+text+""};Renderer.prototype.br=function(){return this.options.xhtml?"
    ":"
    "};Renderer.prototype.del=function(text){return""+text+""};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return text}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0||prot.indexOf("data:")===0){return text}}if(this.options.baseUrl&&!originIndependentUrl.test(href)){href=resolveUrl(this.options.baseUrl,href)}var out='
    ";return out};Renderer.prototype.image=function(href,title,text){if(this.options.baseUrl&&!originIndependentUrl.test(href)){href=resolveUrl(this.options.baseUrl,href)}var out=''+text+'":">";return out};Renderer.prototype.text=function(text){return text};function TextRenderer(){}TextRenderer.prototype.strong=TextRenderer.prototype.em=TextRenderer.prototype.codespan=TextRenderer.prototype.del=TextRenderer.prototype.text=function(text){return text};TextRenderer.prototype.link=TextRenderer.prototype.image=function(href,title,text){return""+text};TextRenderer.prototype.br=function(){return""};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options){var parser=new Parser(options);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options);this.inlineText=new InlineLexer(src.links,merge({},this.options,{renderer:new TextRenderer}));this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,unescape(this.inlineText.output(this.token.text)))}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function edit(regex,opt){regex=regex.source;opt=opt||"";return{replace:function(name,val){val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return this},getRegex:function(){return new RegExp(regex,opt)}}}function resolveUrl(base,href){if(!baseUrls[" "+base]){if(/^[^:]+:\/*[^/]*$/.test(base)){baseUrls[" "+base]=base+"/"}else{baseUrls[" "+base]=base.replace(/[^/]*$/,"")}}base=baseUrls[" "+base];if(href.slice(0,2)==="//"){return base.replace(/:[\s\S]*/,":")+href}else if(href.charAt(0)==="/"){return base.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+href}else{return base+href}}var baseUrls={};var originIndependentUrl=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occurred:

    "+escape(e.message+"",true)+"
    "}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false,baseUrl:null};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.TextRenderer=TextRenderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{root.marked=marked}})(this||(typeof window!=="undefined"?window:global)); \ No newline at end of file +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||k.defaults,this.rules=t.normal,this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",t.html=p(t.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,t._tag).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag","<"+t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._inside=/(?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,r._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=p(r.link).replace("inside",r._inside).replace("href",r._href).getRegex(),r.reflink=p(r.reflink).replace("inside",r._inside).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=a(this.mangle(s[1]))):n=a(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):a(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(a(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(a(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=a(s[0])):(n=a(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},s.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:a(e,!0))+"\n
    \n":"
    "+(n?e:a(e,!0))+"\n
    "},i.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"'+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var s='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;eAn error occurred:

    "+a(e.message+"",!0)+"
    ";throw e}}f.exec=f,k.options=k.setOptions=function(e){return d(k.defaults,e),k},k.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1,baseUrl:null},k.Parser=o,k.parser=o.parse,k.Renderer=i,k.TextRenderer=l,k.Lexer=n,k.lexer=n.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.parse=k,"undefined"!=typeof module&&"object"==typeof exports?module.exports=k:"function"==typeof define&&define.amd?define(function(){return k}):e.marked=k}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file From 03e015ca912ae4039862c73bd3cee8e04b589085 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 23 Mar 2018 07:51:20 -0400 Subject: [PATCH 322/459] 0.3.19 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index cfba80de..f82920a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "marked", - "version": "0.3.18", + "version": "0.3.19", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c59bfbfb..cc7c85dd 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "marked", "description": "A markdown parser built for speed", "author": "Christopher Jeffrey", - "version": "0.3.18", + "version": "0.3.19", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", From 0540ab69906c6522988ec82f7846a33a37b4b9b8 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Mar 2018 19:32:50 -0400 Subject: [PATCH 323/459] Move demo to docs --- {www => docs}/demo.css | 0 {www => docs}/demo.html | 0 {www => docs}/demo.js | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {www => docs}/demo.css (100%) rename {www => docs}/demo.html (100%) rename {www => docs}/demo.js (100%) diff --git a/www/demo.css b/docs/demo.css similarity index 100% rename from www/demo.css rename to docs/demo.css diff --git a/www/demo.html b/docs/demo.html similarity index 100% rename from www/demo.html rename to docs/demo.html diff --git a/www/demo.js b/docs/demo.js similarity index 100% rename from www/demo.js rename to docs/demo.js From 2296958a130935343c1df140d8b36f07841455a8 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Mar 2018 19:45:36 -0400 Subject: [PATCH 324/459] Add doctype to demo.html --- docs/demo.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/demo.html b/docs/demo.html index 4181e077..e1c4f6dd 100644 --- a/docs/demo.html +++ b/docs/demo.html @@ -1,4 +1,5 @@ - + + Marked Demo Page From 5a3565eec4e8c8b715c9a45c143a8097fbd47743 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Mar 2018 19:46:27 -0400 Subject: [PATCH 325/459] Change "Marked Demo Page" to "Marked Demo" --- docs/demo.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/demo.html b/docs/demo.html index e1c4f6dd..d06acab2 100644 --- a/docs/demo.html +++ b/docs/demo.html @@ -1,7 +1,7 @@ - Marked Demo Page + Marked Demo @@ -9,7 +9,7 @@
    From e9d5055fb4d6576c8fe4bd3dab5a1809f829dfae Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Mar 2018 19:46:49 -0400 Subject: [PATCH 326/459] Fix url to repo --- docs/demo.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/demo.html b/docs/demo.html index d06acab2..3183ae3b 100644 --- a/docs/demo.html +++ b/docs/demo.html @@ -9,7 +9,7 @@
    @@ -51,7 +51,7 @@ It's easy. It's not overly bloated, unlike HTML. Also, as the creator of [mark Ready to start writing? Either start changing stuff on the left or [clear everything](?blank=1) with a simple click. -[Marked]: https://github.com/chjj/marked/ +[Marked]: https://github.com/markedjs/marked/ [Markdown]: http://daringfireball.net/projects/markdown/
    From 57a5fb8212c36ae5dd96edd7fe5993e1bbaf8c09 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Mar 2018 19:47:12 -0400 Subject: [PATCH 327/459] Remove unused jquery --- docs/demo.html | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/demo.html b/docs/demo.html index 3183ae3b..1e44ae6e 100644 --- a/docs/demo.html +++ b/docs/demo.html @@ -2,7 +2,6 @@ Marked Demo - From c5171e6ceb5a71728400f5b8da09d7bfbfb05f85 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Mar 2018 19:48:29 -0400 Subject: [PATCH 328/459] Move - @@ -239,6 +237,8 @@ If markdown is too limiting, you can just insert your own crazy It is a pity, but markdown does **not** work in here for most markdown parsers. [Marked] handles it pretty well.
    -
    +
    + + From 8e035bb3bef48e8de1261223dcc7db51d6cea4a8 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Mar 2018 20:07:48 -0400 Subject: [PATCH 329/459] Change jquery usage to querySelector --- docs/demo.js | 62 +++++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/docs/demo.js b/docs/demo.js index 36668a4d..11899bb9 100644 --- a/docs/demo.js +++ b/docs/demo.js @@ -1,30 +1,39 @@ -$(function () { - var $inputElem = $('#input'); - var $outputTypeElem = $('#outputType'); - var $previewElem = $('#preview'); - var $htmlElem = $('#html'); - var $lexerElem = $('#lexer'); - var $syntaxElem = $('#syntax'); +(function () { + var $inputElem = document.querySelector('#input'); + var $outputTypeElem = document.querySelector('#outputType'); + var $previewElem = document.querySelector('#preview'); + var $htmlElem = document.querySelector('#html'); + var $lexerElem = document.querySelector('#lexer'); + var $syntaxElem = document.querySelector('#syntax'); + var $pane = document.querySelector('#rightContainer .pane'); var inputDirty = true; var $activeElem = null; if (top.document.location.href.match(/\?blank=1$/)) { - $inputElem.val(''); + $inputElem.value = ''; } - $outputTypeElem.change(function () { - $('#rightContainer .pane').hide(); - $activeElem = $('#' + $outputTypeElem.val()).show(); - }).change(); + var handleChange = function () { + var panes = document.querySelectorAll('#rightContainer .pane'); + for (var i = 0; i < panes.length; i++) { + panes[i].style.display = 'none'; + } + $activeElem = document.querySelector('#' + $outputTypeElem.value); + $activeElem.style.display = 'block'; + }; - var noticeChange = function () { + $outputTypeElem.addEventListener('change', handleChange, false); + handleChange(); + + + var handleInput = function () { inputDirty = true; }; - $inputElem. - change(noticeChange). - keyup(noticeChange). - keypress(noticeChange). - keydown(noticeChange); + + $inputElem.addEventListener('change', handleInput, false); + $inputElem.addEventListener('keyup', handleInput, false); + $inputElem.addEventListener('keypress', handleInput, false); + $inputElem.addEventListener('keydown', handleInput, false); var jsonString = function (input) { var output = (input + ''). @@ -38,7 +47,7 @@ $(function () { }; var getScrollSize = function () { - var e = $activeElem[0]; + var e = $activeElem; return e.scrollHeight - e.clientHeight; }; @@ -49,10 +58,10 @@ $(function () { return 1; } - return $activeElem.scrollTop() / size; + return $activeElem.scrollTop / size; }; var setScrollPercent = function (percent) { - $activeElem.scrollTop(percent * getScrollSize()); + $activeElem.scrollTop = percent * getScrollSize(); }; var delayTime = 1; @@ -65,8 +74,7 @@ $(function () { var scrollPercent = getScrollPercent(); // Convert - var markdown = $inputElem.val(); - var lexed = marked.lexer(markdown); + var lexed = marked.lexer($inputElem.value); // Grab lexed output and convert to a string before the parser // destroys the data @@ -83,9 +91,9 @@ $(function () { var parsed = marked.parser(lexed); // Assign - $previewElem.html(parsed); - $htmlElem.val(parsed); - $lexerElem.val(lexedList.join("\n")); + $previewElem.innerHTML = (parsed); + $htmlElem.value = (parsed); + $lexerElem.value = (lexedList.join("\n")); // Set the scroll percent setScrollPercent(scrollPercent); @@ -102,4 +110,4 @@ $(function () { }; checkForChanges(); setScrollPercent(0); -}); +})(); From 4dbb434628aff96835ccb26c5d2c7b7d707e34fd Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Mar 2018 20:09:31 -0400 Subject: [PATCH 330/459] Replace double with single quotes, remove comments --- docs/demo.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/docs/demo.js b/docs/demo.js index 11899bb9..568ffe98 100644 --- a/docs/demo.js +++ b/docs/demo.js @@ -70,32 +70,26 @@ inputDirty = false; var startTime = new Date(); - // Save scroll position var scrollPercent = getScrollPercent(); - // Convert var lexed = marked.lexer($inputElem.value); - - // Grab lexed output and convert to a string before the parser - // destroys the data + var lexedList = []; for (var i = 0; i < lexed.length; i ++) { var lexedLine = []; for (var j in lexed[i]) { - lexedLine.push(j + ":" + jsonString(lexed[i][j])); + lexedLine.push(j + ':' + jsonString(lexed[i][j])); } - lexedList.push("{" + lexedLine.join(", ") + "}"); + lexedList.push('{' + lexedLine.join(', ') + '}'); } var parsed = marked.parser(lexed); - // Assign $previewElem.innerHTML = (parsed); $htmlElem.value = (parsed); - $lexerElem.value = (lexedList.join("\n")); + $lexerElem.value = (lexedList.join('\n')); - // Set the scroll percent setScrollPercent(scrollPercent); var endTime = new Date(); From 5618acf9cd0cbe889517b1a97ef71359a779aadf Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Mar 2018 20:28:22 -0400 Subject: [PATCH 331/459] Enhance demo.css --- docs/demo.css | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/docs/demo.css b/docs/demo.css index fed6e03f..0111185c 100644 --- a/docs/demo.css +++ b/docs/demo.css @@ -1,13 +1,15 @@ html, body { margin: 0; padding: 0; - font-family: Helvetica, Arial, Verdana, sans-serif; - background-color: #DDF; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #333; + background-color: #fbfbfb; height: 100%; } textarea { - font-family: monospace; + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 12px; } #header { @@ -17,21 +19,8 @@ textarea { color: #002; } -#header h1 { - font-size: 2em; -} - -#header * { - margin: 0; - padding: 0; - line-height: 1em; - font-weight: 100; -} - -#header a { - color: #005; - position: relative; - z-index: 20; +#header > h1 { + margin-top: 0; } #bothContainers { @@ -85,19 +74,14 @@ textarea { #outputType { display: block; margin-left: auto; - font-weight: 900; - font-family: Arial, Verdana, sans-serif; - background-color: #dacccc; - color: #444; - border: 1px solid #999; } .pane { margin: 1.6em 0em 0.2em; padding: 0.6em; - background-color: #eee; display: block; - border: 1px solid #000; + border: 1px solid #ccc; + border-radius: 2px; top: 0; bottom: 0; left: 0; From 473c1556158d2ba73639587160ea595fd7793c17 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Mar 2018 20:35:07 -0400 Subject: [PATCH 332/459] Add "Fork me on GitHub" ribbon --- docs/demo.css | 33 ++++++++++----------------------- docs/demo.html | 6 +++++- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/docs/demo.css b/docs/demo.css index 0111185c..2a1267a4 100644 --- a/docs/demo.css +++ b/docs/demo.css @@ -13,10 +13,8 @@ textarea { } #header { - margin: 0; - padding: 0.4em 0 0 0; + margin-top: 1em; text-align: center; - color: #002; } #header > h1 { @@ -27,7 +25,7 @@ textarea { position: absolute; top: 0; bottom: 0; - margin-top: 2.4em; + margin-top: 5em; width: 100%; } @@ -55,25 +53,7 @@ textarea { } .label { - margin: 0; - padding: 0; - position: relative; - width: 100%; - display: block; -} - -.label * { - position: relative; - font-weight: 900; -} - -.label span { - color: #444; -} - -#outputType { - display: block; - margin-left: auto; + float: none !important; } .pane { @@ -135,3 +115,10 @@ textarea { font-size: 1.3em; } +.github-ribbon { + position: absolute; + top: 0; + right: 0; + border: 0; + z-index: 1000; +} diff --git a/docs/demo.html b/docs/demo.html index c46fbd0c..887c32df 100644 --- a/docs/demo.html +++ b/docs/demo.html @@ -5,8 +5,12 @@ + + Fork me on GitHub + +
    From bd4da952e7ce36a3ca2e87243799fd75938e11cb Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 25 Mar 2018 20:36:41 -0400 Subject: [PATCH 333/459] Move script to the bottom --- README.md | 2 +- docs/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 57f72074..08684d3b 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,10 @@ $ cat hello.html Marked in the browser -
    +
    + - - - diff --git a/docs/demo.js b/docs/demo.js deleted file mode 100644 index 568ffe98..00000000 --- a/docs/demo.js +++ /dev/null @@ -1,107 +0,0 @@ -(function () { - var $inputElem = document.querySelector('#input'); - var $outputTypeElem = document.querySelector('#outputType'); - var $previewElem = document.querySelector('#preview'); - var $htmlElem = document.querySelector('#html'); - var $lexerElem = document.querySelector('#lexer'); - var $syntaxElem = document.querySelector('#syntax'); - var $pane = document.querySelector('#rightContainer .pane'); - var inputDirty = true; - var $activeElem = null; - - if (top.document.location.href.match(/\?blank=1$/)) { - $inputElem.value = ''; - } - - var handleChange = function () { - var panes = document.querySelectorAll('#rightContainer .pane'); - for (var i = 0; i < panes.length; i++) { - panes[i].style.display = 'none'; - } - $activeElem = document.querySelector('#' + $outputTypeElem.value); - $activeElem.style.display = 'block'; - }; - - $outputTypeElem.addEventListener('change', handleChange, false); - handleChange(); - - - var handleInput = function () { - inputDirty = true; - }; - - $inputElem.addEventListener('change', handleInput, false); - $inputElem.addEventListener('keyup', handleInput, false); - $inputElem.addEventListener('keypress', handleInput, false); - $inputElem.addEventListener('keydown', handleInput, false); - - var jsonString = function (input) { - var output = (input + ''). - replace(/\n/g, '\\n'). - replace(/\r/g, '\\r'). - replace(/\t/g, '\\t'). - replace(/\f/g, '\\f'). - replace(/[\\"']/g, '\\$&'). - replace(/\u0000/g, '\\0'); - return '"' + output + '"'; - }; - - var getScrollSize = function () { - var e = $activeElem; - - return e.scrollHeight - e.clientHeight; - }; - var getScrollPercent = function () { - var size = getScrollSize(); - - if (size <= 0) { - return 1; - } - - return $activeElem.scrollTop / size; - }; - var setScrollPercent = function (percent) { - $activeElem.scrollTop = percent * getScrollSize(); - }; - - var delayTime = 1; - var checkForChanges = function () { - if (inputDirty) { - inputDirty = false; - var startTime = new Date(); - - var scrollPercent = getScrollPercent(); - - var lexed = marked.lexer($inputElem.value); - - var lexedList = []; - - for (var i = 0; i < lexed.length; i ++) { - var lexedLine = []; - for (var j in lexed[i]) { - lexedLine.push(j + ':' + jsonString(lexed[i][j])); - } - lexedList.push('{' + lexedLine.join(', ') + '}'); - } - - var parsed = marked.parser(lexed); - - $previewElem.innerHTML = (parsed); - $htmlElem.value = (parsed); - $lexerElem.value = (lexedList.join('\n')); - - setScrollPercent(scrollPercent); - - var endTime = new Date(); - delayTime = endTime - startTime; - if (delayTime < 50) { - delayTime = 50; - } else if (delayTime > 500) { - delayTime = 1000; - } - } - window.setTimeout(checkForChanges, delayTime); - }; - checkForChanges(); - setScrollPercent(0); -})(); diff --git a/docs/demo/demo.css b/docs/demo/demo.css new file mode 100644 index 00000000..8e3e8fc5 --- /dev/null +++ b/docs/demo/demo.css @@ -0,0 +1,55 @@ +html, body { + margin: 0; + padding: 0; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + color: #333; + background-color: #fbfbfb; + height: 100%; +} + +textarea { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 12px; + resize: none; +} + +header { + padding-top: 10px; + display: flex; + height: 58px; +} + +header h1 { + margin: 0; +} + +.github-ribbon { + position: absolute; + top: 0; + right: 0; + border: 0; + z-index: 1000; +} + +.containers { + display: flex; + height: calc(100vh - 68px); +} + +.container { + flex-basis: 50%; + padding: 5px; + display: flex; + flex-direction: column; + height: 100%; + box-sizing: border-box; +} + +.pane, #input { + margin-top: 5px; + padding: 0.6em; + border: 1px solid #ccc; + overflow: auto; + flex-grow: 1; + flex-shrink: 1; +} diff --git a/docs/demo/demo.js b/docs/demo/demo.js new file mode 100644 index 00000000..f7f624f2 --- /dev/null +++ b/docs/demo/demo.js @@ -0,0 +1,128 @@ +/* globals marked, unfetch, ES6Promise */ + +if (!window.Promise) { + window.Promise = ES6Promise; +} +if (!window.fetch) { + window.fetch = unfetch; +} + +var $inputElem = document.querySelector('#input'); +var $outputTypeElem = document.querySelector('#outputType'); +var $previewElem = document.querySelector('#preview'); +var $htmlElem = document.querySelector('#html'); +var $lexerElem = document.querySelector('#lexer'); +var $panes = document.querySelectorAll('.pane'); +var inputDirty = true; +var $activeElem = null; +var changeTimeout = null; + +if (!top.document.location.href.match(/[?&]blank=1$/)) { + unfetch('./initial.md') + .then(function (res) { return res.text(); }) + .then(function (text) { + if ($inputElem.value === '') { + $inputElem.value = text; + inputDirty = true; + clearTimeout(changeTimeout); + checkForChanges(); + setScrollPercent(0); + } + }); +} + +fetch('./quickref.md') + .then(function (res) { return res.text(); }) + .then(function (text) { + document.querySelector('#quickref').value = text; + }); + +function handleChange() { + for (var i = 0; i < $panes.length; i++) { + $panes[i].style.display = 'none'; + } + $activeElem = document.querySelector('#' + $outputTypeElem.value); + $activeElem.style.display = 'block'; +}; + +$outputTypeElem.addEventListener('change', handleChange, false); +handleChange(); + +function handleInput() { + inputDirty = true; +}; + +$inputElem.addEventListener('change', handleInput, false); +$inputElem.addEventListener('keyup', handleInput, false); +$inputElem.addEventListener('keypress', handleInput, false); +$inputElem.addEventListener('keydown', handleInput, false); + +function jsonString(input) { + var output = (input + '') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/\t/g, '\\t') + .replace(/\f/g, '\\f') + .replace(/[\\"']/g, '\\$&') + .replace(/\u0000/g, '\\0'); + return '"' + output + '"'; +}; + +function getScrollSize() { + var e = $activeElem; + + return e.scrollHeight - e.clientHeight; +}; +function getScrollPercent() { + var size = getScrollSize(); + + if (size <= 0) { + return 1; + } + + return $activeElem.scrollTop / size; +}; +function setScrollPercent(percent) { + $activeElem.scrollTop = percent * getScrollSize(); +}; + +var delayTime = 1; +function checkForChanges() { + if (inputDirty) { + inputDirty = false; + var startTime = new Date(); + + var scrollPercent = getScrollPercent(); + + var lexed = marked.lexer($inputElem.value); + + var lexedList = []; + + for (var i = 0; i < lexed.length; i++) { + var lexedLine = []; + for (var j in lexed[i]) { + lexedLine.push(j + ':' + jsonString(lexed[i][j])); + } + lexedList.push('{' + lexedLine.join(', ') + '}'); + } + + var parsed = marked.parser(lexed); + + $previewElem.innerHTML = (parsed); + $htmlElem.value = (parsed); + $lexerElem.value = (lexedList.join('\n')); + + setScrollPercent(scrollPercent); + + var endTime = new Date(); + delayTime = endTime - startTime; + if (delayTime < 50) { + delayTime = 50; + } else if (delayTime > 500) { + delayTime = 1000; + } + } + changeTimeout = window.setTimeout(checkForChanges, delayTime); +}; +checkForChanges(); +setScrollPercent(0); diff --git a/docs/demo/index.html b/docs/demo/index.html new file mode 100644 index 00000000..99eb7fc1 --- /dev/null +++ b/docs/demo/index.html @@ -0,0 +1,58 @@ + + + + + Marked Demo + + + + + + Fork me on GitHub + + +
    + + + +

    Marked Demo

    +
    + +
    +
    +
    + Input +
    + +
    + +
    +
    + +
    + +
    + +
    + + + + + + +
    +
    + + + + + + + diff --git a/docs/demo/initial.md b/docs/demo/initial.md new file mode 100644 index 00000000..84a267bd --- /dev/null +++ b/docs/demo/initial.md @@ -0,0 +1,36 @@ +Marked - Markdown Parser +======================== + +[Marked] lets you convert [Markdown] into HTML. Markdown is a simple text format whose goal is to be very easy to read and write, even when not converted to HTML. This demo page will let you type anything you like and see how it gets converted. Live. No more waiting around. + +How To Use The Demo +------------------- + +1. Type in stuff on the left. +2. See the live updates on the right. + +That's it. Pretty simple. There's also a drop-down option in the upper right to switch between various views: + +- **Preview:** A live display of the generated HTML as it would render in a browser. +- **HTML Source:** The generated HTML before your browser makes it pretty. +- **Lexer Data:** What [marked] uses internally, in case you like gory stuff like this. +- **Quick Reference:** A brief run-down of how to format things using markdown. + +Why Markdown? +------------- + +It's easy. It's not overly bloated, unlike HTML. Also, as the creator of [markdown] says, + +> The overriding design goal for Markdown's +> formatting syntax is to make it as readable +> as possible. The idea is that a +> Markdown-formatted document should be +> publishable as-is, as plain text, without +> looking like it's been marked up with tags +> or formatting instructions. + +Ready to start writing? Either start changing stuff on the left or +[clear everything](?blank=1) with a simple click. + +[Marked]: https://github.com/markedjs/marked/ +[Markdown]: http://daringfireball.net/projects/markdown/ diff --git a/docs/demo/quickref.md b/docs/demo/quickref.md new file mode 100644 index 00000000..10f09bda --- /dev/null +++ b/docs/demo/quickref.md @@ -0,0 +1,167 @@ +Markdown Quick Reference +======================== + +This guide is a very brief overview, with examples, of the syntax that [Markdown] supports. It is itself written in Markdown and you can copy the samples over to the left-hand pane for experimentation. It's shown as *text* and not *rendered HTML*. + +[Markdown]: http://daringfireball.net/projects/markdown/ + + +Simple Text Formatting +====================== + +First thing is first. You can use *stars* or _underscores_ for italics. **Double stars** and __double underscores__ do bold. ***Three together*** do ___both___. + +Paragraphs are pretty easy too. Just have a blank line between chunks of text. + +> This chunk of text is in a block quote. Its multiple lines will all be +> indended a bit from the rest of the text. +> +> > Multiple levels of block quotes also work. + +Sometimes you want to include some code, such as when you are explaining how `

    ` HTML tags work, or maybe you are a programmer and you are discussing `someMethod()`. + +If you want to include some code and have +newlines preserved, indent the line with a tab +or at least four spaces. + Extra spaces work here too. +This is also called preformatted text and it is useful for showing examples. +The text will stay as text, so any *markdown* or HTML you add will +not show up formatted. This way you can show markdown examples in a +markdown document. + +> You can also use preformatted text with your blockquotes +> as long as you add at least five spaces. + + +Headings +======== + +There are a couple of ways to make headings. Using three or more equals signs on a line under a heading makes it into an "h1" style. Three or more hyphens under a line makes it "h2" (slightly smaller). You can also use multiple pound symbols before and after a heading. Pounds after the title are ignored. Here's some examples: + +This is H1 +========== + +This is H2 +---------- + +# This is H1 +## This is H2 +### This is H3 with some extra pounds ### +#### You get the idea #### +##### I don't need extra pounds at the end +###### H6 is the max + + +Links +===== + +Let's link to a few sites. First, let's use the bare URL, like . Great for text, but ugly for HTML. +Next is an inline link to [Google](http://www.google.com). A little nicer. +This is a reference-style link to [Wikipedia] [1]. +Lastly, here's a pretty link to [Yahoo]. The reference-style and pretty links both automatically use the links defined below, but they could be defined *anywhere* in the markdown and are removed from the HTML. The names are also case insensitive, so you can use [YaHoO] and have it link properly. + +[1]: http://www.wikipedia.org/ +[Yahoo]: http://www.yahoo.com/ + +Title attributes may be added to links by adding text after a link. +This is the [inline link](http://www.bing.com "Bing") with a "Bing" title. +You can also go to [W3C] [2] and maybe visit a [friend]. + +[2]: http://w3c.org (The W3C puts out specs for web-based things) +[Friend]: http://facebook.com/ "Facebook!" + +Email addresses in plain text are not linked: test@example.com. +Email addresses wrapped in angle brackets are linked: . +They are also obfuscated so that email harvesting spam robots hopefully won't get them. + + +Lists +===== + +* This is a bulleted list +* Great for shopping lists +- You can also use hyphens ++ Or plus symbols + +The above is an "unordered" list. Now, on for a bit of order. + +1. Numbered lists are also easy +2. Just start with a number +3738762. However, the actual number doesn't matter when converted to HTML. +1. This will still show up as 4. + +You might want a few advanced lists: + +- This top-level list is wrapped in paragraph tags +- This generates an extra space between each top-level item. + +- You do it by adding a blank line + +- This nested list also has blank lines between the list items. + +- How to create nested lists +1. Start your regular list +2. Indent nested lists with four spaces +3. Further nesting means you should indent with four more spaces + * This line is indented with eight spaces. + +- List items can be quite lengthy. You can keep typing and either continue +them on the next line with no indentation. + +- Alternately, if that looks ugly, you can also +indent the next line a bit for a prettier look. + +- You can put large blocks of text in your list by just indenting with four spaces. + +This is formatted the same as code, but you can inspect the HTML +and find that it's just wrapped in a `

    ` tag and *won't* be shown +as preformatted text. + +You can keep adding more and more paragraphs to a single +list item by adding the traditional blank line and then keep +on indenting the paragraphs with four spaces. You really need +to only indent the first line, but that looks ugly. + +- Lists support blockquotes + +> Just like this example here. By the way, you can +> nest lists inside blockquotes! +> - Fantastic! + +- Lists support preformatted text + + You just need to indent eight spaces. + + +Even More +========= + +Horizontal Rule +--------------- + +If you need a horizontal rule you just need to put at least three hyphens, asterisks, or underscores on a line by themselves. You can also even put spaces between the characters. + +--- +**************************** +_ _ _ _ _ _ _ + +Those three all produced horizontal lines. Keep in mind that three hyphens under any text turns that text into a heading, so add a blank like if you use hyphens. + +Images +------ + +Images work exactly like links, but they have exclamation points in front. They work with references and titles too. + +![Google Logo](http://www.google.com/images/errors/logo_sm.gif) and ![Happy]. + +[Happy]: http://www.wpclipart.com/smiley/simple_smiley/smiley_face_simple_green_small.png ("Smiley face") + + +Inline HTML +----------- + +If markdown is too limiting, you can just insert your own crazy HTML. Span-level HTML can *still* use markdown. Block level elements must be separated from text by a blank line and must not have any spaces before the opening and closing HTML. + +

    +It is a pity, but markdown does **not** work in here for most markdown parsers. [Marked] handles it pretty well. +
    From 133059006eddcc18778c65c5faff9628d75ffac3 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Mon, 26 Mar 2018 10:43:37 -0500 Subject: [PATCH 337/459] fix for ie --- docs/index.html | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/docs/index.html b/docs/index.html index c9b0fda4..09d75dce 100644 --- a/docs/index.html +++ b/docs/index.html @@ -89,6 +89,29 @@ From 4c71689dfa7505f15ae249c6c13a6f0721dcc8d1 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 27 Mar 2018 10:19:41 -0500 Subject: [PATCH 341/459] update links --- docs/CODE_OF_CONDUCT.md | 2 +- docs/CONTRIBUTING.md | 8 ++++---- docs/PUBLISHING.md | 8 ++++---- docs/README.md | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md index 077c0fc7..d766ea0a 100644 --- a/docs/CODE_OF_CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team by submitting a PR with changes to the [AUTHORS](AUTHORS.md) page (or emailing josh@8fold.com). All +reported by contacting the project team by submitting a PR with changes to the [AUTHORS](#AUTHORS.md) page (or emailing josh@8fold.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 1b624126..028f42a7 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -25,15 +25,15 @@ The following table lists the ticket type labels we use when there is work to be |Ticket type label |Description | |:----------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |L0 - security |A security vulnerability within the Marked library is discovered. | -|L1 - broken |Valid usage results in incorrect output compared to [supported specifications](README.md#specifications) OR causes marked to crash AND there is no known workaround for the issue. | +|L1 - broken |Valid usage results in incorrect output compared to [supported specifications](#README.md#specifications) OR causes marked to crash AND there is no known workaround for the issue. | |L2 - annoying |Similar to L1 - broken only there is a known workaround avaialable for the issue. | |RR - refactor and re-engineer |Results in an improvement to developers using Marked (improved readability) or end-users (faster performance) or both. | -|NFS - new feature (spec related) |A capability Marked does not currently provide but is in one of the [supported specifications](README.md#specifications) | +|NFS - new feature (spec related) |A capability Marked does not currently provide but is in one of the [supported specifications](#README.md#specifications) | |NFU - new feature (user requested) |A capability Marked does not currently provide but has been requested by users of Marked. | ## Test early, often, and everything -We try to write test cases to validate output (writing tests based on the [supported specifications](README.md#specifications)) and minimize regression (writing tests for issues fixed). Therefore, if you would like to contribute, some things you should know regarding the test harness. +We try to write test cases to validate output (writing tests based on the [supported specifications](#README.md#specifications)) and minimize regression (writing tests for issues fixed). Therefore, if you would like to contribute, some things you should know regarding the test harness. |Location |Description | |:-------------|:---------------------------------------------------| @@ -92,4 +92,4 @@ npm run build ## Publishing -Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [publishing documentation](PUBLISHING.md). +Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [publishing documentation](#PUBLISHING.md). diff --git a/docs/PUBLISHING.md b/docs/PUBLISHING.md index 4732fdf7..90bad8ef 100644 --- a/docs/PUBLISHING.md +++ b/docs/PUBLISHING.md @@ -1,6 +1,6 @@ # Releasing Marked -- [ ] See [contributing](CONTRIBUTING.md) +- [ ] See [contributing](#CONTRIBUTING.md) - [ ] Create release branch from `master` (`release-x.y.z`) - [ ] Submit PR with minimal name: Release x.y.z - [ ] Complete PR checklists @@ -13,12 +13,12 @@ We follow [semantic versioning](https://semver.org) where the following sequence is true `[major].[minor].[patch]`; therefore, consider the following implications of the release you are preparing: -1. **Major:** There is at least one change not deemed backward compatible. -2. **Minor:** There is at least one new feature added to the release. +1. **Major:** There is at least one change not deemed backward compatible. +2. **Minor:** There is at least one new feature added to the release. 3. **Patch:** No breaking changes, no new features. What to expect while Marked is a zero-major (0.x.y): 1. The major will remain at zero; thereby, alerting consumers to the potentially volatile nature of the package. 2. The minor will tend to be more analagous to a `major` release. For example, we plan to release `0.4.0` once we have fixed most, if not all, known issues related to the CommonMark and GFM specifications because the architecture changes planned during `0.4.0` will most likely introduce breaking changes. -3. The patch will tend to be more analagous to a `minor` release. \ No newline at end of file +3. The patch will tend to be more analagous to a `minor` release. diff --git a/docs/README.md b/docs/README.md index 42440ce5..794716bc 100644 --- a/docs/README.md +++ b/docs/README.md @@ -70,7 +70,7 @@ $ cat hello.html ``` -Marked offers [advanced configurations](USING_ADVANCED.md) and [extensibility](USING_PRO.md) as well. +Marked offers [advanced configurations](#USING_ADVANCED.md) and [extensibility](#USING_PRO.md) as well.

    Supported Markdown specifications

    @@ -88,17 +88,17 @@ By supporting the above Markdown flavors, it's possible that Marked can help you The only completely secure system is the one that doesn't exist in the first place. Having said that, we take the security of Marked very seriously. -Therefore, please disclose potential security issues by email to the project [committers](AUTHORS.md) as well as the [listed owners within NPM](https://docs.npmjs.com/cli/owner). We will provide an initial assessment of security reports within 48 hours and should apply patches within 2 weeks (also, feel free to contribute a fix for the issue). +Therefore, please disclose potential security issues by email to the project [committers](#AUTHORS.md) as well as the [listed owners within NPM](https://docs.npmjs.com/cli/owner). We will provide an initial assessment of security reports within 48 hours and should apply patches within 2 weeks (also, feel free to contribute a fix for the issue).

    Contributing

    -The marked community enjoys a spirit of collaboration and contribution from all comers. Whether you're just getting started with Markdown, JavaScript, and Marked or you're a veteran with it all figured out, we're here to help each other improve as professionals while helping Marked improve technically. Please see our [contributing documentation](CONTRIBUTING.md) for more details. +The marked community enjoys a spirit of collaboration and contribution from all comers. Whether you're just getting started with Markdown, JavaScript, and Marked or you're a veteran with it all figured out, we're here to help each other improve as professionals while helping Marked improve technically. Please see our [contributing documentation](#CONTRIBUTING.md) for more details. For our Contribution License Agreement, see our [license](https://github.com/markedjs/marked/blob/master/LICENSE.md).

    Authors

    -For list of credited authors and contributors, please see our [authors page](AUTHORS.md). +For list of credited authors and contributors, please see our [authors page](#AUTHORS.md).

    License

    From 5340381d2835d79ccf6f13783a51408bdbdcdc6b Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 27 Mar 2018 10:34:52 -0500 Subject: [PATCH 342/459] fix initial hash not .md --- docs/index.html | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/docs/index.html b/docs/index.html index ebb3ccab..23c81d76 100644 --- a/docs/index.html +++ b/docs/index.html @@ -98,10 +98,11 @@ var content = document.querySelector('#content'); var body = document.querySelector('html'); - var currentPage = ''; + var currentPage = 'README.md'; var currentHash = ''; + var renderedPage = ''; - function hashChange(e) { + function hashChange() { var hash = location.hash.slice(1); if (!hash) { hash = 'README.md'; @@ -116,29 +117,36 @@ } else { currentHash = ''; } - e && e.preventDefault(); - fetchPage(uri[0]) - .then(function () { - if(currentHash) { - var hashElement = document.getElementById(currentHash); - if (hashElement) { - hashElement.scrollIntoView(); - } - } - }); } else { currentHash = uri[0]; } + fetchPage(currentPage) + .then(function () { + if(currentHash) { + var hashElement = document.getElementById(currentHash); + if (hashElement) { + hashElement.scrollIntoView(); + } + } + }); + history.replaceState('', document.title, '#' + currentPage + (currentHash ? '#' + currentHash : '')); } - window.addEventListener('hashchange', hashChange); + window.addEventListener('hashchange', function (e) { + e.preventDefault(); + hashChange(); + }); function fetchPage(page) { + if (page === renderedPage) { + return Promise.resolve(); + } return fetch(page) .then(function (res) { return res.text(); }) .then(function (text) { + renderedPage = page; content.innerHTML = marked(text); body.scrollTop = 0; }).catch(function (e) { From c6176efc133c6576c06a3d324f701bcc6880804c Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Tue, 27 Mar 2018 18:38:29 +0300 Subject: [PATCH 343/459] Fix unrendered links in docs/CODE_OF_CONDUCT.md I've also tried to shorten the text part of the second link to not be a bit tautological. --- docs/CODE_OF_CONDUCT.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md index 077c0fc7..4ea4b10d 100644 --- a/docs/CODE_OF_CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -68,4 +68,7 @@ members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 1.4, available at [http://contributor-covenant.org/version/1/4][version] +version [1.4][version]. + +[homepage]: https://www.contributor-covenant.org/ +[version]: https://www.contributor-covenant.org/version/1/4/code-of-conduct.html From 3d357e9c18e48ca1cf34412b48324666bfefbc0d Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 27 Mar 2018 10:52:41 -0500 Subject: [PATCH 344/459] throw error on error --- docs/index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/index.html b/docs/index.html index 23c81d76..f932c378 100644 --- a/docs/index.html +++ b/docs/index.html @@ -144,7 +144,12 @@ return Promise.resolve(); } return fetch(page) - .then(function (res) { return res.text(); }) + .then(function (res) { + if (!res.ok) { + throw new Error('Error ' + res.status + ': ' + res.statusText); + } + return res.text(); + }) .then(function (text) { renderedPage = page; content.innerHTML = marked(text); From dd722012597b49d14cf4eb13c7e7337d40dfdfd7 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Tue, 27 Mar 2018 19:01:10 +0300 Subject: [PATCH 345/459] Fix nits in code example in USING_ADVANCED.md 1. Tab indent -> 2 spaces indent. 2. Rename undefined variable. --- docs/USING_ADVANCED.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/USING_ADVANCED.md b/docs/USING_ADVANCED.md index c3660ac5..056d473b 100644 --- a/docs/USING_ADVANCED.md +++ b/docs/USING_ADVANCED.md @@ -19,9 +19,9 @@ var myMarked = require('marked'); // Set options // `highlight` example uses `highlight.js` myMarked.setOptions({ - renderer: new marked.Renderer(), + renderer: new myMarked.Renderer(), highlight: function(code) { - return require('highlight.js').highlightAuto(code).value; + return require('highlight.js').highlightAuto(code).value; }, pedantic: false, gfm: true, @@ -68,4 +68,4 @@ myMarked.setOptions({ console.log(myMarked(markdownString)); ``` -In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming lnaguage to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete. \ No newline at end of file +In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming lnaguage to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete. From ef1f8a42f3b23c864b348ed3236f227fd3eea517 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Tue, 27 Mar 2018 19:30:52 +0300 Subject: [PATCH 346/459] Complement options table in USING_ADVANCED.md * Add some missing defaults. * Add periods. * Simplify spaces. --- docs/USING_ADVANCED.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/USING_ADVANCED.md b/docs/USING_ADVANCED.md index c3660ac5..e1f43daf 100644 --- a/docs/USING_ADVANCED.md +++ b/docs/USING_ADVANCED.md @@ -41,16 +41,16 @@ console.log(myMarked('I am using __markdown__.')); |Member |Type |Notes | |:----------|:---------|:----------------------------------------------------------------------------------------------------------------------------| -|highlight |`function`|A function to highlight code blocks. See also: Asynchronous highlighting. | -|renderer |`object` |An object containing functions to render tokens to HTML. See [extensibility](https://github.com/markedjs/marked/blob/master/docs/USING_PRO.md) for more details. Default: `new Renderer()`| -|pedantic |`boolean` |Conform to obscure parts of `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Default: `false`| -|gfm |`boolean` |Use approved [GitHub Flavored Markdown (GFM) specification](https://github.github.com/gfm/). | -|tables |`boolean` |Use [GFM Tables extension](https://github.github.com/gfm/#tables-extension-). Requires `gfm` be `true`. | -|breaks |`boolean` |Use GFM [hard](https://github.github.com/gfm/#hard-line-breaks) and [soft](https://github.github.com/gfm/#soft-line-breaks) line breaks. Requires `gfm` be `true`. Default: `false`| -|sanitize |`boolean` |Ignore HTML passed into `markdownString` (sanitize the input). Default: `false` | -|smartlists |`boolean` |Use smarter list behavior than those found in `markdown.pl`. Default: `true` | -|smartypants|`boolean` |Use "smart" typographic punctuation for things like quotes and dashes. | -|xhtml |`boolean` |Self-close the tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML. Default: `false` | +|highlight |`function`|A function to highlight code blocks. See also: Asynchronous highlighting.| +|renderer |`object` |An object containing functions to render tokens to HTML. See [extensibility](https://github.com/markedjs/marked/blob/master/docs/USING_PRO.md) for more details. Default: `new Renderer()`.| +|pedantic |`boolean` |Conform to obscure parts of `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Default: `false`.| +|gfm |`boolean` |Use approved [GitHub Flavored Markdown (GFM) specification](https://github.github.com/gfm/). Default: `true`.| +|tables |`boolean` |Use [GFM Tables extension](https://github.github.com/gfm/#tables-extension-). Requires `gfm` be `true`. Default: `true`.| +|breaks |`boolean` |Use GFM [hard](https://github.github.com/gfm/#hard-line-breaks) and [soft](https://github.github.com/gfm/#soft-line-breaks) line breaks. Requires `gfm` be `true`. Default: `false`.| +|sanitize |`boolean` |Ignore HTML passed into `markdownString` (sanitize the input). Default: `false`.| +|smartlists |`boolean` |Use smarter list behavior than those found in `markdown.pl`. Default: `true`.| +|smartypants|`boolean` |Use "smart" typographic punctuation for things like quotes and dashes. Default: `false`.| +|xhtml |`boolean` |Self-close the tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML. Default: `false`.|

    Asynchronous highlighting

    @@ -68,4 +68,4 @@ myMarked.setOptions({ console.log(myMarked(markdownString)); ``` -In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming lnaguage to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete. \ No newline at end of file +In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming lnaguage to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete. From 0535cb1785a943b51655095c36f27b87a8d9c8df Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Tue, 27 Mar 2018 19:50:46 +0300 Subject: [PATCH 347/459] Fix typo in USING_ADVANCED.md --- docs/USING_ADVANCED.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/USING_ADVANCED.md b/docs/USING_ADVANCED.md index c3660ac5..756ddef2 100644 --- a/docs/USING_ADVANCED.md +++ b/docs/USING_ADVANCED.md @@ -54,7 +54,7 @@ console.log(myMarked('I am using __markdown__.'));

    Asynchronous highlighting

    -Unlike `highlight.js` the `pygmatize.js` library uses asynchronous highlighting. This example demonstrates that marked is agnostic when it comes to the highlighter you use. +Unlike `highlight.js` the `pygmentize.js` library uses asynchronous highlighting. This example demonstrates that marked is agnostic when it comes to the highlighter you use. ```js myMarked.setOptions({ @@ -68,4 +68,4 @@ myMarked.setOptions({ console.log(myMarked(markdownString)); ``` -In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming lnaguage to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete. \ No newline at end of file +In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming lnaguage to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete. From a17feb12d661d58f7fa7f45caa847e22c5e79b9c Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 27 Mar 2018 14:06:54 -0500 Subject: [PATCH 348/459] add slash at beginning --- docs/CODE_OF_CONDUCT.md | 2 +- docs/CONTRIBUTING.md | 8 ++++---- docs/PUBLISHING.md | 2 +- docs/README.md | 8 ++++---- docs/index.html | 39 ++++++++++++++++++++++----------------- 5 files changed, 32 insertions(+), 27 deletions(-) diff --git a/docs/CODE_OF_CONDUCT.md b/docs/CODE_OF_CONDUCT.md index d766ea0a..62d2d6ab 100644 --- a/docs/CODE_OF_CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team by submitting a PR with changes to the [AUTHORS](#AUTHORS.md) page (or emailing josh@8fold.com). All +reported by contacting the project team by submitting a PR with changes to the [AUTHORS](#/AUTHORS.md) page (or emailing josh@8fold.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 028f42a7..ce5f0c38 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -25,15 +25,15 @@ The following table lists the ticket type labels we use when there is work to be |Ticket type label |Description | |:----------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |L0 - security |A security vulnerability within the Marked library is discovered. | -|L1 - broken |Valid usage results in incorrect output compared to [supported specifications](#README.md#specifications) OR causes marked to crash AND there is no known workaround for the issue. | +|L1 - broken |Valid usage results in incorrect output compared to [supported specifications](#/README.md#specifications) OR causes marked to crash AND there is no known workaround for the issue. | |L2 - annoying |Similar to L1 - broken only there is a known workaround avaialable for the issue. | |RR - refactor and re-engineer |Results in an improvement to developers using Marked (improved readability) or end-users (faster performance) or both. | -|NFS - new feature (spec related) |A capability Marked does not currently provide but is in one of the [supported specifications](#README.md#specifications) | +|NFS - new feature (spec related) |A capability Marked does not currently provide but is in one of the [supported specifications](#/README.md#specifications) | |NFU - new feature (user requested) |A capability Marked does not currently provide but has been requested by users of Marked. | ## Test early, often, and everything -We try to write test cases to validate output (writing tests based on the [supported specifications](#README.md#specifications)) and minimize regression (writing tests for issues fixed). Therefore, if you would like to contribute, some things you should know regarding the test harness. +We try to write test cases to validate output (writing tests based on the [supported specifications](#/README.md#specifications)) and minimize regression (writing tests for issues fixed). Therefore, if you would like to contribute, some things you should know regarding the test harness. |Location |Description | |:-------------|:---------------------------------------------------| @@ -92,4 +92,4 @@ npm run build ## Publishing -Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [publishing documentation](#PUBLISHING.md). +Creating GitHub releases and publishing to NPM is limited to conributors and owners. If you would like more information, please see our [publishing documentation](#/PUBLISHING.md). diff --git a/docs/PUBLISHING.md b/docs/PUBLISHING.md index 90bad8ef..99dcbfec 100644 --- a/docs/PUBLISHING.md +++ b/docs/PUBLISHING.md @@ -1,6 +1,6 @@ # Releasing Marked -- [ ] See [contributing](#CONTRIBUTING.md) +- [ ] See [contributing](#/CONTRIBUTING.md) - [ ] Create release branch from `master` (`release-x.y.z`) - [ ] Submit PR with minimal name: Release x.y.z - [ ] Complete PR checklists diff --git a/docs/README.md b/docs/README.md index 794716bc..f5b15427 100644 --- a/docs/README.md +++ b/docs/README.md @@ -70,7 +70,7 @@ $ cat hello.html ``` -Marked offers [advanced configurations](#USING_ADVANCED.md) and [extensibility](#USING_PRO.md) as well. +Marked offers [advanced configurations](#/USING_ADVANCED.md) and [extensibility](#/USING_PRO.md) as well.

    Supported Markdown specifications

    @@ -88,17 +88,17 @@ By supporting the above Markdown flavors, it's possible that Marked can help you The only completely secure system is the one that doesn't exist in the first place. Having said that, we take the security of Marked very seriously. -Therefore, please disclose potential security issues by email to the project [committers](#AUTHORS.md) as well as the [listed owners within NPM](https://docs.npmjs.com/cli/owner). We will provide an initial assessment of security reports within 48 hours and should apply patches within 2 weeks (also, feel free to contribute a fix for the issue). +Therefore, please disclose potential security issues by email to the project [committers](#/AUTHORS.md) as well as the [listed owners within NPM](https://docs.npmjs.com/cli/owner). We will provide an initial assessment of security reports within 48 hours and should apply patches within 2 weeks (also, feel free to contribute a fix for the issue).

    Contributing

    -The marked community enjoys a spirit of collaboration and contribution from all comers. Whether you're just getting started with Markdown, JavaScript, and Marked or you're a veteran with it all figured out, we're here to help each other improve as professionals while helping Marked improve technically. Please see our [contributing documentation](#CONTRIBUTING.md) for more details. +The marked community enjoys a spirit of collaboration and contribution from all comers. Whether you're just getting started with Markdown, JavaScript, and Marked or you're a veteran with it all figured out, we're here to help each other improve as professionals while helping Marked improve technically. Please see our [contributing documentation](#/CONTRIBUTING.md) for more details. For our Contribution License Agreement, see our [license](https://github.com/markedjs/marked/blob/master/LICENSE.md).

    Authors

    -For list of credited authors and contributors, please see our [authors page](#AUTHORS.md). +For list of credited authors and contributors, please see our [authors page](#/AUTHORS.md).

    License

    diff --git a/docs/index.html b/docs/index.html index f932c378..a985d16f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -73,7 +73,7 @@
    - +

    Marked.js Documentation

    @@ -110,8 +110,8 @@ var uri = hash.split('#'); - if (uri[0].match('.md$')) { - currentPage = uri[0]; + if (uri[0].match(/^\//)) { + currentPage = uri[0].slice(1); if (uri.length > 1) { currentHash = uri[1]; } else { @@ -121,23 +121,23 @@ currentHash = uri[0]; } - fetchPage(currentPage) - .then(function () { - if(currentHash) { - var hashElement = document.getElementById(currentHash); - if (hashElement) { - hashElement.scrollIntoView(); - } - } - }); + fetchPage(currentPage).then(function () { + fetchAnchor(currentHash) + }); - history.replaceState('', document.title, '#' + currentPage + (currentHash ? '#' + currentHash : '')); + history.replaceState('', document.title, '#/' + currentPage + (currentHash ? '#' + currentHash : '')); } - window.addEventListener('hashchange', function (e) { - e.preventDefault(); - hashChange(); - }); + function fetchAnchor(anchor) { + if (!anchor) { + return; + } + + var hashElement = document.getElementById(anchor); + if (hashElement) { + hashElement.scrollIntoView(); + } + } function fetchPage(page) { if (page === renderedPage) { @@ -160,6 +160,11 @@ }); } + window.addEventListener('hashchange', function (e) { + e.preventDefault(); + hashChange(); + }); + hashChange(); From e93bfb3fc2133979fd54c6d5aca0274718815d9b Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Tue, 27 Mar 2018 23:38:03 +0300 Subject: [PATCH 349/459] Fix nits in code example in USING_PRO.md * Rename undefined variable. * Delete unneeded quotes. * Fix alignment in the actual output from the code example and make it more close to the "Output:" example (otherwise, the indentation of the "

    " line will be out of order). --- docs/USING_PRO.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/USING_PRO.md b/docs/USING_PRO.md index 6981500f..44ba82a8 100644 --- a/docs/USING_PRO.md +++ b/docs/USING_PRO.md @@ -25,8 +25,9 @@ var renderer = new myMarked.Renderer(); renderer.heading = function (text, level) { var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-'); - return ` - + return ` + + ${text} @@ -34,7 +35,7 @@ renderer.heading = function (text, level) { }; // Run marked -console.log(marked('# heading+', { renderer: renderer })); +console.log(myMarked('# heading+', { renderer: renderer })); ``` **Output:** From 61b99b98bde355a3f8d876a19fc604f1be9f65ec Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Tue, 27 Mar 2018 23:49:41 +0300 Subject: [PATCH 350/459] Fix typos in .github/PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8072ccc6..8274e607 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,7 +6,7 @@ If badging PR, add ?template=badges.md to the PR url to use the badges PR template. Otherwise, you are stating this PR fixes an issue that has been submitted; or, - describes the issue or proposal under considersation and contains the project-related code to implement. + describes the issue or proposal under consideration and contains the project-related code to implement. --> @@ -40,7 +40,7 @@ Describe what code combination got you there ## Contributor -- [ ] Test(s) exist to ensure functionality and minimize regresstion (if no tests added, list tests covering this PR); or, +- [ ] Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or, - [ ] no tests required for this PR. - [ ] If submitting new feature, it has been documented in the appropriate places. From 0b6a240ebb40d935bcf6271d43690ff7bfbc66f7 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Wed, 28 Mar 2018 00:54:11 +0300 Subject: [PATCH 351/459] Remove duplicate part in docs/USING_PRO.md --- docs/USING_PRO.md | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/docs/USING_PRO.md b/docs/USING_PRO.md index 6981500f..e97870aa 100644 --- a/docs/USING_PRO.md +++ b/docs/USING_PRO.md @@ -109,22 +109,6 @@ console.log(tokens); console.log(lexer.rules); ``` -### Pro level - -You also have direct access to the lexer and parser if you so desire. - -``` js -var tokens = marked.lexer(text, options); -console.log(marked.parser(tokens)); -``` - -``` js -var lexer = new marked.Lexer(options); -var tokens = lexer.lex(text); -console.log(tokens); -console.log(lexer.rules); -``` - ``` bash $ node > require('marked').lexer('> i am using marked.') @@ -133,4 +117,4 @@ $ node text: 'i am using marked.' }, { type: 'blockquote_end' }, links: {} ] -``` \ No newline at end of file +``` From bf5b83c847c501882822d075b3cd01a9aee024f8 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Wed, 28 Mar 2018 01:10:10 +0300 Subject: [PATCH 352/459] Document mutability of tokens argument in parser --- docs/USING_PRO.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/docs/USING_PRO.md b/docs/USING_PRO.md index e8a70a1f..e14658ad 100644 --- a/docs/USING_PRO.md +++ b/docs/USING_PRO.md @@ -119,3 +119,39 @@ $ node { type: 'blockquote_end' }, links: {} ] ``` + +The Lexers build an array of tokens, which will be passed to their respective +Parsers. The Parsers process each token in the token arrays, +which are removed from the array of tokens: + +``` js +const marked = require('marked'); + +const md = ` + # heading + + [link][1] + + [1]: #heading "heading" +`; + +const tokens = marked.lexer(md); +console.log(tokens); + +const html = marked.parser(tokens); +console.log(html); + +console.log(tokens); +``` + +``` bash +[ { type: 'heading', depth: 1, text: 'heading' }, + { type: 'paragraph', text: ' [link][1]' }, + { type: 'space' }, + links: { '1': { href: '#heading', title: 'heading' } } ] + +

    heading

    +

    link

    + +[ links: { '1': { href: '#heading', title: 'heading' } } ] +``` From f3cab3f75bc1d024fe6dac847e7528b20a78c2b2 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 28 Mar 2018 11:24:14 -0500 Subject: [PATCH 353/459] add permalink and clear button --- docs/demo/demo.js | 16 +++++++++++++++- docs/demo/index.html | 4 +++- docs/demo/initial.md | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/demo/demo.js b/docs/demo/demo.js index f7f624f2..ba78d38a 100644 --- a/docs/demo/demo.js +++ b/docs/demo/demo.js @@ -10,6 +10,8 @@ if (!window.fetch) { var $inputElem = document.querySelector('#input'); var $outputTypeElem = document.querySelector('#outputType'); var $previewElem = document.querySelector('#preview'); +var $permalinkElem = document.querySelector('#permalink'); +var $clearElem = document.querySelector('#clear'); var $htmlElem = document.querySelector('#html'); var $lexerElem = document.querySelector('#lexer'); var $panes = document.querySelectorAll('.pane'); @@ -17,7 +19,10 @@ var inputDirty = true; var $activeElem = null; var changeTimeout = null; -if (!top.document.location.href.match(/[?&]blank=1$/)) { +var match = location.search.match(/[?&]text=([^&]*)$/); +if (match) { + $inputElem.value = decodeURIComponent(match[1]); +} else { unfetch('./initial.md') .then(function (res) { return res.text(); }) .then(function (text) { @@ -57,6 +62,11 @@ $inputElem.addEventListener('keyup', handleInput, false); $inputElem.addEventListener('keypress', handleInput, false); $inputElem.addEventListener('keydown', handleInput, false); +$clearElem.addEventListener('click', function () { + $inputElem.value = ''; + handleInput(); +}, false); + function jsonString(input) { var output = (input + '') .replace(/\n/g, '\\n') @@ -90,6 +100,10 @@ var delayTime = 1; function checkForChanges() { if (inputDirty) { inputDirty = false; + + $permalinkElem.href = '?text=' + encodeURIComponent($inputElem.value); + history.replaceState('', document.title, $permalinkElem.href); + var startTime = new Date(); var scrollPercent = getScrollPercent(); diff --git a/docs/demo/index.html b/docs/demo/index.html index 99eb7fc1..0f20731b 100644 --- a/docs/demo/index.html +++ b/docs/demo/index.html @@ -21,7 +21,9 @@
    - Input + Input · + · +
    diff --git a/docs/demo/initial.md b/docs/demo/initial.md index 84a267bd..2465aef0 100644 --- a/docs/demo/initial.md +++ b/docs/demo/initial.md @@ -30,7 +30,7 @@ It's easy. It's not overly bloated, unlike HTML. Also, as the creator of [mark > or formatting instructions. Ready to start writing? Either start changing stuff on the left or -[clear everything](?blank=1) with a simple click. +[clear everything](?text=) with a simple click. [Marked]: https://github.com/markedjs/marked/ [Markdown]: http://daringfireball.net/projects/markdown/ From 9b040ef323937c58998bb9f0fac19a3ee93fd5ac Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 29 Mar 2018 11:41:33 -0500 Subject: [PATCH 354/459] update eslint call to include all js files --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cc7c85dd..425a71ce 100644 --- a/package.json +++ b/package.json @@ -43,9 +43,9 @@ "test:specs": "npm test -- test/specs/**/*-spec.js", "test:integration": "npm test -- test/integration/**/*-spec.js", "test:old": "node test", - "test:lint": "eslint lib/marked.js test/index.js", + "test:lint": "eslint bin/marked .", "bench": "node test --bench", - "lint": "eslint --fix lib/marked.js test/index.js", + "lint": "eslint --fix bin/marked .", "build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js", "preversion": "npm run build && (git diff --quiet || git commit -am 'minify')" }, From ec463419c39b6602928a127bc16310423278f5ca Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 29 Mar 2018 13:00:33 -0500 Subject: [PATCH 355/459] ignore *.min.js files --- .eslintignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..121531af --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +*.min.js From ada4a1d8c0ffa281260e0c3863b60eafee5da0c5 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 29 Mar 2018 13:00:59 -0500 Subject: [PATCH 356/459] lint all js files --- bin/marked | 30 +++++----- test/browser/index.js | 2 +- test/browser/test.js | 100 ++++++++++++++++---------------- test/integration/marked-spec.js | 9 ++- 4 files changed, 71 insertions(+), 70 deletions(-) diff --git a/bin/marked b/bin/marked index df4dcc0f..32ca3e0f 100755 --- a/bin/marked +++ b/bin/marked @@ -5,9 +5,9 @@ * Copyright (c) 2011-2013, Christopher Jeffrey (MIT License) */ -var fs = require('fs') - , util = require('util') - , marked = require('../'); +var fs = require('fs'), + path = require('path'), + marked = require('../'); /** * Man Page @@ -23,9 +23,9 @@ function help() { customFds: [0, 1, 2] }; - spawn('man', [__dirname + '/../man/marked.1'], options) - .on('error', function(err) { - fs.readFile(__dirname + '/../man/marked.1.txt', 'utf8', function(err, data) { + spawn('man', [path.resolve(__dirname, '/../man/marked.1')], options) + .on('error', function(err) { // eslint-disable-line handle-callback-err + fs.readFile(path.resolve(__dirname, '/../man/marked.1.txt'), 'utf8', function(err, data) { if (err) throw err; console.log(data); }); @@ -37,13 +37,13 @@ function help() { */ function main(argv, callback) { - var files = [] - , options = {} - , input - , output - , arg - , tokens - , opt; + var files = [], + options = {}, + input, + output, + arg, + tokens, + opt; function getarg() { var arg = argv.shift(); @@ -146,8 +146,8 @@ function main(argv, callback) { */ function getStdin(callback) { - var stdin = process.stdin - , buff = ''; + var stdin = process.stdin, + buff = ''; stdin.setEncoding('utf8'); diff --git a/test/browser/index.js b/test/browser/index.js index 8820a522..8208fa3f 100644 --- a/test/browser/index.js +++ b/test/browser/index.js @@ -33,7 +33,7 @@ app.get('/test.js', function(req, res, next) { res.send(testScript); }); -app.use(express.static(path.join(__dirname, '/../../lib'))) ; +app.use(express.static(path.join(__dirname, '/../../lib'))); app.use(express.static(__dirname)); app.listen(8080); diff --git a/test/browser/test.js b/test/browser/test.js index 54a37bc0..59917dd4 100644 --- a/test/browser/test.js +++ b/test/browser/test.js @@ -1,64 +1,66 @@ + ;(function() { + var console = {}, + files = __TESTS__; // eslint-disable-line no-undef -var console = {} - , files = __TESTS__; + console.log = function(text) { + var args = Array.prototype.slice.call(arguments, 1), + i = 0; -console.log = function(text) { - var args = Array.prototype.slice.call(arguments, 1) - , i = 0; + text = text.replace(/%\w/g, function() { + return args[i++] || ''; + }); - text = text.replace(/%\w/g, function() { - return args[i++] || ''; - }); + if (window.console) window.console.log(text); + document.body.innerHTML += '
    ' + escape(text) + '
    '; + }; - if (window.console) window.console.log(text); - document.body.innerHTML += '
    ' + escape(text) + '
    '; -}; + if (!Object.keys) { + Object.keys = function(obj) { + var out = [], + key; -if (!Object.keys) { - Object.keys = function(obj) { - var out = [] - , key; - - for (key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - out.push(key); + for (key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + out.push(key); + } } - } - return out; - }; -} + return out; + }; + } -if (!Array.prototype.forEach) { - Array.prototype.forEach = function(callback, context) { - for (var i = 0; i < this.length; i++) { - callback.call(context || null, this[i], i, obj); - } - }; -} + if (!Array.prototype.forEach) { + // eslint-disable-next-line no-extend-native + Array.prototype.forEach = function(callback, context) { + for (var i = 0; i < this.length; i++) { + callback.call(context || null, this[i], i, this); + } + }; + } -if (!String.prototype.trim) { - String.prototype.trim = function() { - return this.replace(/^\s+|\s+$/g, ''); - }; -} + if (!String.prototype.trim) { + // eslint-disable-next-line no-extend-native + String.prototype.trim = function() { + return this.replace(/^\s+|\s+$/g, ''); + }; + } -function load() { - return files; -} + // eslint-disable-next-line no-unused-vars + function load() { + return files; + } -function escape(html, encode) { - return html - .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); -} + function escape(html, encode) { + return html + .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + } -__LIBS__; - -(__MAIN__)(); + __LIBS__; // eslint-disable-line no-undef, no-unused-expressions + (__MAIN__)(); // eslint-disable-line no-undef }).call(this); diff --git a/test/integration/marked-spec.js b/test/integration/marked-spec.js index b312f8ee..c2c8955f 100644 --- a/test/integration/marked-spec.js +++ b/test/integration/marked-spec.js @@ -6,13 +6,12 @@ it('should run the test', function () { // http://spec.commonmark.org/0.28/#example-230 it('should start an ordered list at 0 when requested', function () { - expect( - marked('0. ok')). - toBe("
      \n
    1. ok
    2. \n
    \n") + expect(marked('0. ok')) + .toBe('
      \n
    1. ok
    2. \n
    \n') }); // http://spec.commonmark.org/0.28/#example-234 it('indents code within an explicitly-started ordered list', function () { - expect(marked(" 10. foo\n\n bar")). - toBe("
      \n
    1. foo

      \n
      bar\n
    2. \n
    \n"); + expect(marked(' 10. foo\n\n bar')) + .toBe('
      \n
    1. foo

      \n
      bar\n
    2. \n
    \n'); }); From 3c3db6b0047685695eb285c30bffb099bffe2cac Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 29 Mar 2018 13:08:48 -0500 Subject: [PATCH 357/459] use fetch --- docs/demo/demo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/demo/demo.js b/docs/demo/demo.js index ba78d38a..6042f7b3 100644 --- a/docs/demo/demo.js +++ b/docs/demo/demo.js @@ -23,7 +23,7 @@ var match = location.search.match(/[?&]text=([^&]*)$/); if (match) { $inputElem.value = decodeURIComponent(match[1]); } else { - unfetch('./initial.md') + fetch('./initial.md') .then(function (res) { return res.text(); }) .then(function (text) { if ($inputElem.value === '') { From a5eb9c0c866d12437f60dfa91d7e36a63ffcc4c6 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sun, 1 Apr 2018 23:16:01 -0500 Subject: [PATCH 358/459] remove err --- bin/marked | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/marked b/bin/marked index 32ca3e0f..06781c78 100755 --- a/bin/marked +++ b/bin/marked @@ -24,7 +24,7 @@ function help() { }; spawn('man', [path.resolve(__dirname, '/../man/marked.1')], options) - .on('error', function(err) { // eslint-disable-line handle-callback-err + .on('error', function() { fs.readFile(path.resolve(__dirname, '/../man/marked.1.txt'), 'utf8', function(err, data) { if (err) throw err; console.log(data); From 68900ba8097a3ad797e883262b431cb7ab3fb188 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 3 Apr 2018 11:07:56 -0500 Subject: [PATCH 359/459] fix spaces --- docs/demo/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/demo/index.html b/docs/demo/index.html index 0f20731b..39166248 100644 --- a/docs/demo/index.html +++ b/docs/demo/index.html @@ -31,11 +31,11 @@
    + + + + +
    From f9cef1f0d76cd37602f18e1792e6e32ecda81848 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 3 Apr 2018 11:21:25 -0500 Subject: [PATCH 360/459] add outputType param --- docs/demo/demo.js | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/docs/demo/demo.js b/docs/demo/demo.js index 6042f7b3..ada958e8 100644 --- a/docs/demo/demo.js +++ b/docs/demo/demo.js @@ -18,10 +18,10 @@ var $panes = document.querySelectorAll('.pane'); var inputDirty = true; var $activeElem = null; var changeTimeout = null; +var search = searchToObject(); -var match = location.search.match(/[?&]text=([^&]*)$/); -if (match) { - $inputElem.value = decodeURIComponent(match[1]); +if (search.text) { + $inputElem.value = search.text; } else { fetch('./initial.md') .then(function (res) { return res.text(); }) @@ -36,6 +36,10 @@ if (match) { }); } +if (search.outputType) { + $outputTypeElem.value = search.outputType; +} + fetch('./quickref.md') .then(function (res) { return res.text(); }) .then(function (text) { @@ -48,6 +52,8 @@ function handleChange() { } $activeElem = document.querySelector('#' + $outputTypeElem.value); $activeElem.style.display = 'block'; + + updateLink(); }; $outputTypeElem.addEventListener('change', handleChange, false); @@ -67,6 +73,24 @@ $clearElem.addEventListener('click', function () { handleInput(); }, false); +function searchToObject() { + // modified from https://stackoverflow.com/a/7090123/806777 + var pairs = location.search.slice(1).split('&'); + var obj = {}; + + for (var i = 0; i < pairs.length; i++) { + if (pairs[i] === '') { + continue; + } + + var pair = pairs[i].split('='); + + obj[decodeURIComponent(pair.shift())] = decodeURIComponent(pair.join('=')); + } + + return obj; +} + function jsonString(input) { var output = (input + '') .replace(/\n/g, '\\n') @@ -96,13 +120,22 @@ function setScrollPercent(percent) { $activeElem.scrollTop = percent * getScrollSize(); }; +function updateLink() { + var outputType = ''; + if ($outputTypeElem.value !== 'preview') { + outputType = 'outputType=' + $outputTypeElem.value + '&'; + } + + $permalinkElem.href = '?' + outputType + 'text=' + encodeURIComponent($inputElem.value); + history.replaceState('', document.title, $permalinkElem.href); +} + var delayTime = 1; function checkForChanges() { if (inputDirty) { inputDirty = false; - $permalinkElem.href = '?text=' + encodeURIComponent($inputElem.value); - history.replaceState('', document.title, $permalinkElem.href); + updateLink(); var startTime = new Date(); From f66196ae5f3b60a45ed82f89a8d3368d251b328e Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 3 Apr 2018 11:39:08 -0500 Subject: [PATCH 361/459] fix when text is blank --- docs/demo/demo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/demo/demo.js b/docs/demo/demo.js index ada958e8..8db8e714 100644 --- a/docs/demo/demo.js +++ b/docs/demo/demo.js @@ -20,7 +20,7 @@ var $activeElem = null; var changeTimeout = null; var search = searchToObject(); -if (search.text) { +if ('text' in search) { $inputElem.value = search.text; } else { fetch('./initial.md') From 5b88fad19ae14c6ad3ecfd1f516b7e8a4f6bc751 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 3 Apr 2018 13:48:25 -0500 Subject: [PATCH 362/459] Update ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index e0465a78..9df84eaf 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -18,10 +18,16 @@ ## Expectation +**CommonMark Demo:** [demo](https://spec.commonmark.org/dingus/) + + ## Result +**Marked Demo:** [demo](https://marked.js.org/demo/) + + ## What was attempted From 8804676f985ec3caa6950b1c106e55c03e40ea2f Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Tue, 3 Apr 2018 15:10:26 -0400 Subject: [PATCH 363/459] Disable heading IDs (#1190) * Add option to disable heading ids * Alphabetize and add options to docs --- docs/USING_ADVANCED.md | 31 +++++++++++++++---------- lib/marked.js | 49 ++++++++++++++++++++++------------------ marked.min.js | 2 +- test/unit/marked-spec.js | 14 ++++++++++++ 4 files changed, 61 insertions(+), 35 deletions(-) diff --git a/docs/USING_ADVANCED.md b/docs/USING_ADVANCED.md index 8d35760f..159bee3c 100644 --- a/docs/USING_ADVANCED.md +++ b/docs/USING_ADVANCED.md @@ -39,18 +39,25 @@ console.log(myMarked('I am using __markdown__.'));

    Options

    -|Member |Type |Notes | -|:----------|:---------|:----------------------------------------------------------------------------------------------------------------------------| -|highlight |`function`|A function to highlight code blocks. See also: Asynchronous highlighting.| -|renderer |`object` |An object containing functions to render tokens to HTML. See [extensibility](https://github.com/markedjs/marked/blob/master/docs/USING_PRO.md) for more details. Default: `new Renderer()`.| -|pedantic |`boolean` |Conform to obscure parts of `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Default: `false`.| -|gfm |`boolean` |Use approved [GitHub Flavored Markdown (GFM) specification](https://github.github.com/gfm/). Default: `true`.| -|tables |`boolean` |Use [GFM Tables extension](https://github.github.com/gfm/#tables-extension-). Requires `gfm` be `true`. Default: `true`.| -|breaks |`boolean` |Use GFM [hard](https://github.github.com/gfm/#hard-line-breaks) and [soft](https://github.github.com/gfm/#soft-line-breaks) line breaks. Requires `gfm` be `true`. Default: `false`.| -|sanitize |`boolean` |Ignore HTML passed into `markdownString` (sanitize the input). Default: `false`.| -|smartlists |`boolean` |Use smarter list behavior than those found in `markdown.pl`. Default: `true`.| -|smartypants|`boolean` |Use "smart" typographic punctuation for things like quotes and dashes. Default: `false`.| -|xhtml |`boolean` |Self-close the tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML. Default: `false`.| +|Member |Type |Notes | +|:-----------|:---------|:----------------------------------------------------------------------------------------------------------------------------| +|baseUrl |`??` |Default is `null` | +|breaks |`boolean` |Use GFM [hard](https://github.github.com/gfm/#hard-line-breaks) and [soft](https://github.github.com/gfm/#soft-line-breaks) line breaks. Requires `gfm` be `true`. Default: `false`| +|gfm |`boolean` |Use approved [GitHub Flavored Markdown (GFM) specification](https://github.github.com/gfm/). | +|headerIds |`boolean` |Whether to add an `id` attribute to headers. Default: `true` | +|headerPrefix|`string` |A short string to add as a prefix to the `id` attributes added to headers by default. Default: `empty string` | +|highlight |`function`|A function to highlight code blocks. See also: Asynchronous highlighting. | +|langPrefix |`??` |Default is `lang-` +|mangle |`boolean` |Default is `true` +|pedantic |`boolean` |Conform to obscure parts of `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Default: `false`| +|renderer |`object` |An object containing functions to render tokens to HTML. See [extensibility](https://github.com/markedjs/marked/blob/master/docs/USING_PRO.md) for more details. Default: `new Renderer()`| +|sanitize |`boolean` |Ignore HTML passed into `markdownString` (sanitize the input). Default: `false` | +|sanitizer |`??` |Default is `null` | +|silent |`boolean` |Default is `false` | +|smartlists |`boolean` |Use smarter list behavior than those found in `markdown.pl`. Default: `true` | +|smartypants |`boolean` |Use "smart" typographic punctuation for things like quotes and dashes. | +|tables |`boolean` |Use [GFM Tables extension](https://github.github.com/gfm/#tables-extension-). Requires `gfm` be `true`. | +|xhtml |`boolean` |Self-close the tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML. Default: `false` |

    Asynchronous highlighting

    diff --git a/lib/marked.js b/lib/marked.js index 5552616e..16fdbb66 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -823,16 +823,20 @@ Renderer.prototype.html = function(html) { }; Renderer.prototype.heading = function(text, level, raw) { - return '' - + text - + '\n'; + if (this.options.headerIds) { + return '' + + text + + '\n'; + } + // ignore IDs + return '' + text + '\n'; }; Renderer.prototype.hr = function() { @@ -1342,22 +1346,23 @@ marked.setOptions = function(opt) { }; marked.defaults = { - gfm: true, - tables: true, + baseUrl: null, breaks: false, - pedantic: false, - sanitize: false, - sanitizer: null, - mangle: true, - smartLists: false, - silent: false, + gfm: true, + headerIds: true, + headerPrefix: '', highlight: null, langPrefix: 'lang-', - smartypants: false, - headerPrefix: '', + mangle: true, + pedantic: false, renderer: new Renderer(), - xhtml: false, - baseUrl: null + sanitize: false, + sanitizer: null, + silent: false, + smartLists: false, + smartypants: false, + tables: true, + xhtml: false }; /** diff --git a/marked.min.js b/marked.min.js index 129871ad..28a98262 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||k.defaults,this.rules=t.normal,this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",t.html=p(t.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,t._tag).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag","<"+t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._inside=/(?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,r._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=p(r.link).replace("inside",r._inside).replace("href",r._href).getRegex(),r.reflink=p(r.reflink).replace("inside",r._inside).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=a(this.mangle(s[1]))):n=a(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^/i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):a(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(a(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(a(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=a(s[0])):(n=a(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},s.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:a(e,!0))+"\n
    \n":"
    "+(n?e:a(e,!0))+"\n
    "},i.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"'+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var s='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;eAn error occurred:

    "+a(e.message+"",!0)+"
    ";throw e}}f.exec=f,k.options=k.setOptions=function(e){return d(k.defaults,e),k},k.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1,baseUrl:null},k.Parser=o,k.parser=o.parse,k.Renderer=i,k.TextRenderer=l,k.Lexer=n,k.lexer=n.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.parse=k,"undefined"!=typeof module&&"object"==typeof exports?module.exports=k:"function"==typeof define&&define.amd?define(function(){return k}):e.marked=k}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||k.defaults,this.rules=t.normal,this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",t.html=p(t.html).replace("comment",//).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/\s]*)*?\/?>/).replace(/tag/g,t._tag).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag","<"+t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:/^|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._inside=/(?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,r._href=/\s*?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=p(r.link).replace("inside",r._inside).replace("href",r._href).getRegex(),r.reflink=p(r.reflink).replace("inside",r._inside).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=a(this.mangle(s[1]))):n=a(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):a(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(a(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(a(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=a(s[0])):(n=a(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},s.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:a(e,!0))+"\n
    \n":"
    "+(n?e:a(e,!0))+"\n
    "},i.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"'+e+"\n"},i.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},i.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},i.prototype.paragraph=function(e){return"

    "+e+"

    \n"},i.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},i.prototype.tablerow=function(e){return"\n"+e+"\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+""},i.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var s='
    "},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r=''+n+'":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;eAn error occurred:

    "+a(e.message+"",!0)+"
    ";throw e}}f.exec=f,k.options=k.setOptions=function(e){return d(k.defaults,e),k},k.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1,baseUrl:null},k.Parser=o,k.parser=o.parse,k.Renderer=i,k.TextRenderer=l,k.Lexer=n,k.lexer=n.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.parse=k,"undefined"!=typeof module&&"object"==typeof exports?module.exports=k:"function"==typeof define&&define.amd?define(function(){return k}):e.marked=k}(this||("undefined"!=typeof window?window:global)); diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js index 83f4fb57..324dad12 100644 --- a/test/unit/marked-spec.js +++ b/test/unit/marked-spec.js @@ -5,3 +5,17 @@ it('should run the test', function () { marked.parse('Hello World!'); expect(marked.parse).toHaveBeenCalled(); }); + +describe('Test heading ID functionality', function() { + it('should add id attribute by default', function() { + var renderer = new marked.Renderer(marked.defaults); + var header = renderer.heading('test', 1, 'test'); + expect(header).toBe('

    test

    \n'); + }); + + it('should NOT add id attribute when options set false', function() { + var renderer = new marked.Renderer({ headerIds: false }); + var header = renderer.heading('test', 1, 'test'); + expect(header).toBe('

    test

    \n'); + }); +}); From 69f9fc3bc46df0b8b240031ebde0a3a7b2999f65 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 3 Apr 2018 14:34:31 -0500 Subject: [PATCH 364/459] use marked.js --- docs/demo/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/demo/index.html b/docs/demo/index.html index 0f20731b..83bf0f3c 100644 --- a/docs/demo/index.html +++ b/docs/demo/index.html @@ -51,7 +51,7 @@
    - + From a19e2b631a06466d45b6b80f20ed7f105ec84907 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 4 Apr 2018 14:30:42 -0500 Subject: [PATCH 365/459] use default options in Renderer by default --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 16fdbb66..9e8c5d7e 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -788,7 +788,7 @@ InlineLexer.prototype.mangle = function(text) { */ function Renderer(options) { - this.options = options || {}; + this.options = options || marked.defaults; } Renderer.prototype.code = function(code, lang, escaped) { From ede1957d93cec9805408e1b078d6ad9927b82d25 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 4 Apr 2018 22:43:24 -0400 Subject: [PATCH 366/459] Try to get low-level bullet to fit on one line --- README.md | 2 +- docs/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 149ba29c..70e325bf 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Marked is 1. built for speed. -2. a low-level markdown compiler that allows frequent parsing of large chunks of markdown without caching or blocking for long periods of time. +2. a low-level markdown compiler for parsing markdown without caching or blocking for long periods of time. 3. light-weight while implementing all markdown features from the supported flavors & specifications. 4. available as a command line interface (CLI) and running in client- or server-side JavaScript projects. diff --git a/docs/README.md b/docs/README.md index f5b15427..1fea8277 100644 --- a/docs/README.md +++ b/docs/README.md @@ -15,7 +15,7 @@ Marked is 1. built for speed.* -2. a low-level markdown compiler that allows frequent parsing of large chunks of markdown without caching or blocking for long periods of time.** +2. a low-level markdown compiler for parsing markdown without caching or blocking for long periods of time.** 3. light-weight while implementing all markdown features from the supported flavors & specifications.*** 4. available as a command line interface (CLI) and running in client- or server-side JavaScript projects. From eaf8e51e52964cd0633f97a5c6cb19c474ca9993 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Wed, 4 Apr 2018 22:50:11 -0400 Subject: [PATCH 367/459] Ran lint fixes --- test/unit/marked-spec.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js index 324dad12..0bb5b39f 100644 --- a/test/unit/marked-spec.js +++ b/test/unit/marked-spec.js @@ -7,15 +7,15 @@ it('should run the test', function () { }); describe('Test heading ID functionality', function() { - it('should add id attribute by default', function() { - var renderer = new marked.Renderer(marked.defaults); - var header = renderer.heading('test', 1, 'test'); - expect(header).toBe('

    test

    \n'); - }); + it('should add id attribute by default', function() { + var renderer = new marked.Renderer(marked.defaults); + var header = renderer.heading('test', 1, 'test'); + expect(header).toBe('

    test

    \n'); + }); - it('should NOT add id attribute when options set false', function() { - var renderer = new marked.Renderer({ headerIds: false }); - var header = renderer.heading('test', 1, 'test'); - expect(header).toBe('

    test

    \n'); - }); + it('should NOT add id attribute when options set false', function() { + var renderer = new marked.Renderer({ headerIds: false }); + var header = renderer.heading('test', 1, 'test'); + expect(header).toBe('

    test

    \n'); + }); }); From 0dcb02f643d9a6bb50822a88162e7d8d6d6ee9b1 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 28 Mar 2018 10:18:33 -0500 Subject: [PATCH 368/459] allow string arg --- bin/marked | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/marked b/bin/marked index 06781c78..f26b31bc 100755 --- a/bin/marked +++ b/bin/marked @@ -86,6 +86,10 @@ function main(argv, callback) { case '--input': input = argv.shift(); break; + case '-s': + case '--string': + string = argv.shift(); + break; case '-t': case '--tokens': tokens = true; @@ -116,6 +120,9 @@ function main(argv, callback) { } function getData(callback) { + if (string) { + return callback(null, string); + } if (!input) { if (files.length <= 2) { return getStdin(callback); From f03a576063d383993cf71c57f844444e2a85d6ae Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 28 Mar 2018 10:41:02 -0500 Subject: [PATCH 369/459] prefer input --- bin/marked | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/marked b/bin/marked index f26b31bc..57583809 100755 --- a/bin/marked +++ b/bin/marked @@ -120,11 +120,11 @@ function main(argv, callback) { } function getData(callback) { - if (string) { - return callback(null, string); - } if (!input) { if (files.length <= 2) { + if (string) { + return callback(null, string); + } return getStdin(callback); } input = files.pop(); From e0fd00bec4442ed130f902d2c34c25ced7e1bb52 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sun, 1 Apr 2018 23:25:53 -0500 Subject: [PATCH 370/459] add doc example --- docs/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/README.md b/docs/README.md index f5b15427..c46736c2 100644 --- a/docs/README.md +++ b/docs/README.md @@ -49,6 +49,11 @@ $ cat hello.html

    hello world

    ``` +``` bash +$ marked -s "*hello world*" +

    hello world

    +``` + **Browser** ```html From 25c456a5e7c3a953e2c7a302e33efce365597680 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 5 Apr 2018 00:00:08 -0500 Subject: [PATCH 371/459] lint --- bin/marked | 1 + test/unit/marked-spec.js | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/bin/marked b/bin/marked index 57583809..6a3c2f5e 100755 --- a/bin/marked +++ b/bin/marked @@ -41,6 +41,7 @@ function main(argv, callback) { options = {}, input, output, + string, arg, tokens, opt; diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js index 324dad12..0bb5b39f 100644 --- a/test/unit/marked-spec.js +++ b/test/unit/marked-spec.js @@ -7,15 +7,15 @@ it('should run the test', function () { }); describe('Test heading ID functionality', function() { - it('should add id attribute by default', function() { - var renderer = new marked.Renderer(marked.defaults); - var header = renderer.heading('test', 1, 'test'); - expect(header).toBe('

    test

    \n'); - }); + it('should add id attribute by default', function() { + var renderer = new marked.Renderer(marked.defaults); + var header = renderer.heading('test', 1, 'test'); + expect(header).toBe('

    test

    \n'); + }); - it('should NOT add id attribute when options set false', function() { - var renderer = new marked.Renderer({ headerIds: false }); - var header = renderer.heading('test', 1, 'test'); - expect(header).toBe('

    test

    \n'); - }); + it('should NOT add id attribute when options set false', function() { + var renderer = new marked.Renderer({ headerIds: false }); + var header = renderer.heading('test', 1, 'test'); + expect(header).toBe('

    test

    \n'); + }); }); From 60c2dc4f2cfdeb61abe96b65edc5baf3d015de67 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 28 Mar 2018 00:31:14 -0500 Subject: [PATCH 372/459] fix inline.em --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 9e8c5d7e..1a948ce9 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -469,7 +469,7 @@ var inline = { reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/, strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, - em: /^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/, + em: /^_([^\s_](?:[^_]|__)*?[^\s_]?)_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/, code: /^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, del: noop, From 6ce9c099e0866f6ec4dd3c1c8ef9caa24a04c079 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 28 Mar 2018 00:31:57 -0500 Subject: [PATCH 373/459] add tests --- test/new/em_2char.html | 15 +++++++++++++++ test/new/em_2char.md | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/new/em_2char.html create mode 100644 test/new/em_2char.md diff --git a/test/new/em_2char.html b/test/new/em_2char.html new file mode 100644 index 00000000..ea199f7e --- /dev/null +++ b/test/new/em_2char.html @@ -0,0 +1,15 @@ +

    123

    + +

    123

    + +

    12

    + +

    12

    + +

    1

    + +

    1

    + +

    __

    + +

    **

    diff --git a/test/new/em_2char.md b/test/new/em_2char.md new file mode 100644 index 00000000..b882af01 --- /dev/null +++ b/test/new/em_2char.md @@ -0,0 +1,15 @@ +_123_ + +*123* + +_12_ + +*12* + +_1_ + +*1* + +__ + +** From 81e01d4faf64049a0af1ca1c922f7f8b1f05034e Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Wed, 28 Mar 2018 09:55:27 -0500 Subject: [PATCH 374/459] add more edge cases --- lib/marked.js | 8 ++++---- test/new/em_2char.html | 10 ++++++++++ test/new/em_2char.md | 10 ++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 1a948ce9..b56ad176 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -468,8 +468,8 @@ var inline = { link: /^!?\[(inside)\]\(href\)/, reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/, - strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, - em: /^_([^\s_](?:[^_]|__)*?[^\s_]?)_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/, + strong: /^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/, + em: /^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/, code: /^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, del: noop, @@ -678,14 +678,14 @@ InlineLexer.prototype.output = function(src) { // strong if (cap = this.rules.strong.exec(src)) { src = src.substring(cap[0].length); - out += this.renderer.strong(this.output(cap[2] || cap[1])); + out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1])); continue; } // em if (cap = this.rules.em.exec(src)) { src = src.substring(cap[0].length); - out += this.renderer.em(this.output(cap[2] || cap[1])); + out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1])); continue; } diff --git a/test/new/em_2char.html b/test/new/em_2char.html index ea199f7e..81da0a00 100644 --- a/test/new/em_2char.html +++ b/test/new/em_2char.html @@ -13,3 +13,13 @@

    __

    **

    + +

    _123 _

    + +

    *123 *

    + +

    _ 123_

    + +

    1_

    + +

    1*

    diff --git a/test/new/em_2char.md b/test/new/em_2char.md index b882af01..ca8689aa 100644 --- a/test/new/em_2char.md +++ b/test/new/em_2char.md @@ -13,3 +13,13 @@ _1_ __ ** + +_123 _ + +*123 * + +_ 123_ + +_1__ + +*1** From 82b18bc710cae06c41fbb4555dc55ef4d0a2ec5b Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Thu, 5 Apr 2018 11:35:30 -0400 Subject: [PATCH 375/459] js was not honored --- .editorconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9f5e052b..ab92841b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,13 +1,13 @@ root = true -[*, *.json, *.js] +[*{json,js}] charset = utf-8 end_of_line = lf insert_final_newline = true indent_style = space indent_size = 2 -[*.md, !test/*md] +[*.md, !test/*.md] charset = utf-8 end_of_line = lf insert_final_newline = true From 92f0ae232f48440cc1fbdcf91b7e3d87226ae05d Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Thu, 5 Apr 2018 11:36:07 -0400 Subject: [PATCH 376/459] style --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index ab92841b..97ff4e8a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,6 @@ root = true -[*{json,js}] +[*.{json,js}] charset = utf-8 end_of_line = lf insert_final_newline = true From a4d9c17a8e4dbaf3d138b715a80a68bc1857b8d6 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 5 Apr 2018 14:36:01 -0500 Subject: [PATCH 377/459] fix man --- man/marked.1 | 2 +- man/marked.1.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/marked.1 b/man/marked.1 index 59239732..a8e41b50 100644 --- a/man/marked.1 +++ b/man/marked.1 @@ -23,7 +23,7 @@ cat in.md | marked > out.html .TP echo "hello *world*" | marked .TP -marked \-o out.html -i in.md \-\-gfm +marked \-o out.html \-i in.md \-\-gfm .TP marked \-\-output="hello world.html" \-i in.md \-\-no-breaks diff --git a/man/marked.1.txt b/man/marked.1.txt index 7f604192..fd9b37ef 100644 --- a/man/marked.1.txt +++ b/man/marked.1.txt @@ -22,7 +22,7 @@ EXAMPLES echo "hello *world*" | marked - marked -o out.html in.md --gfm + marked -o out.html -i in.md --gfm marked --output="hello world.html" -i in.md --no-breaks From 96f4488846e0adb1c09380039a54aff2b4755c18 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Thu, 5 Apr 2018 16:16:20 -0400 Subject: [PATCH 378/459] CommonMark Tests (#1160) Add tests from CommonMark spec --- package-lock.json | 169 + package.json | 2 + test/integration/commonmark.json | 4994 ++++++++++++++++++++++++++++++ test/integration/marked-spec.js | 456 ++- 4 files changed, 5610 insertions(+), 11 deletions(-) create mode 100644 test/integration/commonmark.json diff --git a/package-lock.json b/package-lock.json index f82920a9..d30c3bdb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -193,6 +193,15 @@ "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, + "coa": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/coa/-/coa-0.4.0.tgz", + "integrity": "sha1-JSvBvpdArxXYJuSQ6LE5PC/ioGI=", + "dev": true, + "requires": { + "q": "0.9.7" + } + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -348,6 +357,12 @@ } } }, + "diff": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.0.8.tgz", + "integrity": "sha1-NDJ2MI7Jkbe8giZ+1VvBQR+XFmY=", + "dev": true + }, "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -851,6 +866,12 @@ "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", "dev": true }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -958,6 +979,67 @@ "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", "dev": true }, + "html-differ": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/html-differ/-/html-differ-1.3.4.tgz", + "integrity": "sha1-n0e66XV9JRPR7a2Cc8xeQ/wAbMY=", + "dev": true, + "requires": { + "chalk": "1.0.0", + "coa": "0.4.0", + "diff": "1.0.8", + "lodash": "2.4.1", + "parse5": "1.1.3", + "vow": "0.4.3", + "vow-fs": "0.3.1" + }, + "dependencies": { + "ansi-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz", + "integrity": "sha1-QchHGUZGN15qGl0Qw8oFTvn8mA0=", + "dev": true + }, + "chalk": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz", + "integrity": "sha1-s89O0P9Tl8mcdbj2edsvUoMfltw=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "1.0.3", + "strip-ansi": "2.0.1", + "supports-color": "1.3.1" + } + }, + "has-ansi": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz", + "integrity": "sha1-wLWxYV2eOCsP9nFp2We0JeSMpTg=", + "dev": true, + "requires": { + "ansi-regex": "1.1.1", + "get-stdin": "4.0.1" + } + }, + "strip-ansi": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz", + "integrity": "sha1-32LBqpTtLxFOHQ8h/R1QSCt5pg4=", + "dev": true, + "requires": { + "ansi-regex": "1.1.1" + } + }, + "supports-color": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz", + "integrity": "sha1-FXWN8J2P87SswwdTn6vicJXhBC0=", + "dev": true + } + } + }, "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", @@ -1160,6 +1242,12 @@ "integrity": "sha1-pHheE11d9lAk38kiSVPfWFvSdmw=", "dev": true }, + "jasmine2-custom-message": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/jasmine2-custom-message/-/jasmine2-custom-message-0.9.0.tgz", + "integrity": "sha512-HQMYCNaieAwVkt3KLNNcZz7ONpqMEJCtdAJFebTjD46GS20GZMppE7fYZY0qCd6fr0TjIFWtZcPz7vMc2VOtRg==", + "dev": true + }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", @@ -1252,12 +1340,24 @@ "path-exists": "3.0.0" } }, + "lodash": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz", + "integrity": "sha1-W3cjA03aTSYuWkb7LFjXzCL3FCA=", + "dev": true + }, "lodash.cond": { "version": "4.5.2", "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", "dev": true }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, "markdown": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/markdown/-/markdown-0.5.0.tgz", @@ -1345,6 +1445,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "node-uuid": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.0.tgz", + "integrity": "sha1-B/myM3Vy/2J1x3Xh1IUT86RdemU=", + "dev": true + }, "nopt": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.1.2.tgz", @@ -1460,6 +1566,12 @@ "error-ex": "1.3.1" } }, + "parse5": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-1.1.3.tgz", + "integrity": "sha1-i6tY0GUl8A5ON9dVEW64LnJB8UI=", + "dev": true + }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -1580,6 +1692,12 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, + "q": { + "version": "0.9.7", + "resolved": "https://registry.npmjs.org/q/-/q-0.9.7.tgz", + "integrity": "sha1-TeLmyzspCIyeTLwDv51C+5bOL3U=", + "dev": true + }, "read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", @@ -1794,6 +1912,12 @@ } } }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", @@ -2029,6 +2153,51 @@ "spdx-expression-parse": "1.0.4" } }, + "vow": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/vow/-/vow-0.4.3.tgz", + "integrity": "sha1-1cOU1PHoRMmIEAtXtUCVbEoAW6Y=", + "dev": true + }, + "vow-fs": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/vow-fs/-/vow-fs-0.3.1.tgz", + "integrity": "sha1-G3/GTXJzp8EmkAIWdMGpBM6rjK8=", + "dev": true, + "requires": { + "glob": "3.2.8", + "node-uuid": "1.4.0", + "vow-queue": "0.1.0" + }, + "dependencies": { + "glob": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.8.tgz", + "integrity": "sha1-VQb0MRchvMYYx9jboUQYh1AwcHM=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimatch": "0.2.14" + } + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "vow-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/vow-queue/-/vow-queue-0.1.0.tgz", + "integrity": "sha1-qbVhR3x+pdVjsMqqUuQOZo3gwjg=", + "dev": true + }, "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", diff --git a/package.json b/package.json index 425a71ce..02677295 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,9 @@ "eslint-plugin-standard": "^3.0.1", "front-matter": "^2.3.0", "glob-to-regexp": "0.3.0", + "html-differ": "^1.3.4", "jasmine": "^3.1.0", + "jasmine2-custom-message": "^0.9.0", "markdown": "*", "markdown-it": "*", "showdown": "*", diff --git a/test/integration/commonmark.json b/test/integration/commonmark.json new file mode 100644 index 00000000..ec9a9fe1 --- /dev/null +++ b/test/integration/commonmark.json @@ -0,0 +1,4994 @@ +[ + { + "end_line": 355, + "section": "Tabs", + "html": "
    foo\tbaz\t\tbim\n
    \n", + "markdown": "\tfoo\tbaz\t\tbim\n", + "example": 1, + "start_line": 350 + }, + { + "end_line": 362, + "section": "Tabs", + "html": "
    foo\tbaz\t\tbim\n
    \n", + "markdown": " \tfoo\tbaz\t\tbim\n", + "example": 2, + "start_line": 357 + }, + { + "end_line": 371, + "section": "Tabs", + "html": "
    a\ta\nὐ\ta\n
    \n", + "markdown": " a\ta\n ὐ\ta\n", + "example": 3, + "start_line": 364 + }, + { + "end_line": 388, + "section": "Tabs", + "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", + "markdown": " - foo\n\n\tbar\n", + "example": 4, + "start_line": 377 + }, + { + "end_line": 402, + "section": "Tabs", + "html": "
      \n
    • \n

      foo

      \n
        bar\n
      \n
    • \n
    \n", + "markdown": "- foo\n\n\t\tbar\n", + "example": 5, + "start_line": 390 + }, + { + "end_line": 420, + "section": "Tabs", + "html": "
    \n
      foo\n
    \n
    \n", + "markdown": ">\t\tfoo\n", + "example": 6, + "start_line": 413 + }, + { + "end_line": 431, + "section": "Tabs", + "html": "
      \n
    • \n
        foo\n
      \n
    • \n
    \n", + "markdown": "-\t\tfoo\n", + "example": 7, + "start_line": 422 + }, + { + "end_line": 441, + "section": "Tabs", + "html": "
    foo\nbar\n
    \n", + "markdown": " foo\n\tbar\n", + "example": 8, + "start_line": 434 + }, + { + "end_line": 459, + "section": "Tabs", + "html": "
      \n
    • foo\n
        \n
      • bar\n
          \n
        • baz
        • \n
        \n
      • \n
      \n
    • \n
    \n", + "markdown": " - foo\n - bar\n\t - baz\n", + "example": 9, + "start_line": 443 + }, + { + "end_line": 465, + "section": "Tabs", + "html": "

    Foo

    \n", + "markdown": "#\tFoo\n", + "example": 10, + "start_line": 461 + }, + { + "end_line": 471, + "section": "Tabs", + "html": "
    \n", + "markdown": "*\t*\t*\t\n", + "example": 11, + "start_line": 467 + }, + { + "end_line": 502, + "section": "Precedence", + "html": "
      \n
    • `one
    • \n
    • two`
    • \n
    \n", + "markdown": "- `one\n- two`\n", + "example": 12, + "start_line": 494 + }, + { + "end_line": 541, + "section": "Thematic breaks", + "html": "
    \n
    \n
    \n", + "markdown": "***\n---\n___\n", + "example": 13, + "start_line": 533 + }, + { + "end_line": 550, + "section": "Thematic breaks", + "html": "

    +++

    \n", + "markdown": "+++\n", + "example": 14, + "start_line": 546 + }, + { + "end_line": 557, + "section": "Thematic breaks", + "html": "

    ===

    \n", + "markdown": "===\n", + "example": 15, + "start_line": 553 + }, + { + "end_line": 570, + "section": "Thematic breaks", + "html": "

    --\n**\n__

    \n", + "markdown": "--\n**\n__\n", + "example": 16, + "start_line": 562 + }, + { + "end_line": 583, + "section": "Thematic breaks", + "html": "
    \n
    \n
    \n", + "markdown": " ***\n ***\n ***\n", + "example": 17, + "start_line": 575 + }, + { + "end_line": 593, + "section": "Thematic breaks", + "html": "
    ***\n
    \n", + "markdown": " ***\n", + "example": 18, + "start_line": 588 + }, + { + "end_line": 602, + "section": "Thematic breaks", + "html": "

    Foo\n***

    \n", + "markdown": "Foo\n ***\n", + "example": 19, + "start_line": 596 + }, + { + "end_line": 611, + "section": "Thematic breaks", + "html": "
    \n", + "markdown": "_____________________________________\n", + "example": 20, + "start_line": 607 + }, + { + "end_line": 620, + "section": "Thematic breaks", + "html": "
    \n", + "markdown": " - - -\n", + "example": 21, + "start_line": 616 + }, + { + "end_line": 627, + "section": "Thematic breaks", + "html": "
    \n", + "markdown": " ** * ** * ** * **\n", + "example": 22, + "start_line": 623 + }, + { + "end_line": 634, + "section": "Thematic breaks", + "html": "
    \n", + "markdown": "- - - -\n", + "example": 23, + "start_line": 630 + }, + { + "end_line": 643, + "section": "Thematic breaks", + "html": "
    \n", + "markdown": "- - - - \n", + "example": 24, + "start_line": 639 + }, + { + "end_line": 658, + "section": "Thematic breaks", + "html": "

    _ _ _ _ a

    \n

    a------

    \n

    ---a---

    \n", + "markdown": "_ _ _ _ a\n\na------\n\n---a---\n", + "example": 25, + "start_line": 648 + }, + { + "end_line": 668, + "section": "Thematic breaks", + "html": "

    -

    \n", + "markdown": " *-*\n", + "example": 26, + "start_line": 664 + }, + { + "end_line": 685, + "section": "Thematic breaks", + "html": "
      \n
    • foo
    • \n
    \n
    \n
      \n
    • bar
    • \n
    \n", + "markdown": "- foo\n***\n- bar\n", + "example": 27, + "start_line": 673 + }, + { + "end_line": 698, + "section": "Thematic breaks", + "html": "

    Foo

    \n
    \n

    bar

    \n", + "markdown": "Foo\n***\nbar\n", + "example": 28, + "start_line": 690 + }, + { + "end_line": 714, + "section": "Thematic breaks", + "html": "

    Foo

    \n

    bar

    \n", + "markdown": "Foo\n---\nbar\n", + "example": 29, + "start_line": 707 + }, + { + "end_line": 732, + "section": "Thematic breaks", + "html": "
      \n
    • Foo
    • \n
    \n
    \n
      \n
    • Bar
    • \n
    \n", + "markdown": "* Foo\n* * *\n* Bar\n", + "example": 30, + "start_line": 720 + }, + { + "end_line": 747, + "section": "Thematic breaks", + "html": "
      \n
    • Foo
    • \n
    • \n
      \n
    • \n
    \n", + "markdown": "- Foo\n- * * *\n", + "example": 31, + "start_line": 737 + }, + { + "end_line": 780, + "section": "ATX headings", + "html": "

    foo

    \n

    foo

    \n

    foo

    \n

    foo

    \n
    foo
    \n
    foo
    \n", + "markdown": "# foo\n## foo\n### foo\n#### foo\n##### foo\n###### foo\n", + "example": 32, + "start_line": 766 + }, + { + "end_line": 789, + "section": "ATX headings", + "html": "

    ####### foo

    \n", + "markdown": "####### foo\n", + "example": 33, + "start_line": 785 + }, + { + "end_line": 807, + "section": "ATX headings", + "html": "

    #5 bolt

    \n

    #hashtag

    \n", + "markdown": "#5 bolt\n\n#hashtag\n", + "example": 34, + "start_line": 800 + }, + { + "end_line": 816, + "section": "ATX headings", + "html": "

    ## foo

    \n", + "markdown": "\\## foo\n", + "example": 35, + "start_line": 812 + }, + { + "end_line": 825, + "section": "ATX headings", + "html": "

    foo bar *baz*

    \n", + "markdown": "# foo *bar* \\*baz\\*\n", + "example": 36, + "start_line": 821 + }, + { + "end_line": 834, + "section": "ATX headings", + "html": "

    foo

    \n", + "markdown": "# foo \n", + "example": 37, + "start_line": 830 + }, + { + "end_line": 847, + "section": "ATX headings", + "html": "

    foo

    \n

    foo

    \n

    foo

    \n", + "markdown": " ### foo\n ## foo\n # foo\n", + "example": 38, + "start_line": 839 + }, + { + "end_line": 857, + "section": "ATX headings", + "html": "
    # foo\n
    \n", + "markdown": " # foo\n", + "example": 39, + "start_line": 852 + }, + { + "end_line": 866, + "section": "ATX headings", + "html": "

    foo\n# bar

    \n", + "markdown": "foo\n # bar\n", + "example": 40, + "start_line": 860 + }, + { + "end_line": 877, + "section": "ATX headings", + "html": "

    foo

    \n

    bar

    \n", + "markdown": "## foo ##\n ### bar ###\n", + "example": 41, + "start_line": 871 + }, + { + "end_line": 888, + "section": "ATX headings", + "html": "

    foo

    \n
    foo
    \n", + "markdown": "# foo ##################################\n##### foo ##\n", + "example": 42, + "start_line": 882 + }, + { + "end_line": 897, + "section": "ATX headings", + "html": "

    foo

    \n", + "markdown": "### foo ### \n", + "example": 43, + "start_line": 893 + }, + { + "end_line": 908, + "section": "ATX headings", + "html": "

    foo ### b

    \n", + "markdown": "### foo ### b\n", + "example": 44, + "start_line": 904 + }, + { + "end_line": 917, + "section": "ATX headings", + "html": "

    foo#

    \n", + "markdown": "# foo#\n", + "example": 45, + "start_line": 913 + }, + { + "end_line": 931, + "section": "ATX headings", + "html": "

    foo ###

    \n

    foo ###

    \n

    foo #

    \n", + "markdown": "### foo \\###\n## foo #\\##\n# foo \\#\n", + "example": 46, + "start_line": 923 + }, + { + "end_line": 945, + "section": "ATX headings", + "html": "
    \n

    foo

    \n
    \n", + "markdown": "****\n## foo\n****\n", + "example": 47, + "start_line": 937 + }, + { + "end_line": 956, + "section": "ATX headings", + "html": "

    Foo bar

    \n

    baz

    \n

    Bar foo

    \n", + "markdown": "Foo bar\n# baz\nBar foo\n", + "example": 48, + "start_line": 948 + }, + { + "end_line": 969, + "section": "ATX headings", + "html": "

    \n

    \n

    \n", + "markdown": "## \n#\n### ###\n", + "example": 49, + "start_line": 961 + }, + { + "end_line": 1013, + "section": "Setext headings", + "html": "

    Foo bar

    \n

    Foo bar

    \n", + "markdown": "Foo *bar*\n=========\n\nFoo *bar*\n---------\n", + "example": 50, + "start_line": 1004 + }, + { + "end_line": 1025, + "section": "Setext headings", + "html": "

    Foo bar\nbaz

    \n", + "markdown": "Foo *bar\nbaz*\n====\n", + "example": 51, + "start_line": 1018 + }, + { + "end_line": 1039, + "section": "Setext headings", + "html": "

    Foo

    \n

    Foo

    \n", + "markdown": "Foo\n-------------------------\n\nFoo\n=\n", + "example": 52, + "start_line": 1030 + }, + { + "end_line": 1058, + "section": "Setext headings", + "html": "

    Foo

    \n

    Foo

    \n

    Foo

    \n", + "markdown": " Foo\n---\n\n Foo\n-----\n\n Foo\n ===\n", + "example": 53, + "start_line": 1045 + }, + { + "end_line": 1076, + "section": "Setext headings", + "html": "
    Foo\n---\n\nFoo\n
    \n
    \n", + "markdown": " Foo\n ---\n\n Foo\n---\n", + "example": 54, + "start_line": 1063 + }, + { + "end_line": 1087, + "section": "Setext headings", + "html": "

    Foo

    \n", + "markdown": "Foo\n ---- \n", + "example": 55, + "start_line": 1082 + }, + { + "end_line": 1098, + "section": "Setext headings", + "html": "

    Foo\n---

    \n", + "markdown": "Foo\n ---\n", + "example": 56, + "start_line": 1092 + }, + { + "end_line": 1114, + "section": "Setext headings", + "html": "

    Foo\n= =

    \n

    Foo

    \n
    \n", + "markdown": "Foo\n= =\n\nFoo\n--- -\n", + "example": 57, + "start_line": 1103 + }, + { + "end_line": 1124, + "section": "Setext headings", + "html": "

    Foo

    \n", + "markdown": "Foo \n-----\n", + "example": 58, + "start_line": 1119 + }, + { + "end_line": 1134, + "section": "Setext headings", + "html": "

    Foo\\

    \n", + "markdown": "Foo\\\n----\n", + "example": 59, + "start_line": 1129 + }, + { + "end_line": 1153, + "section": "Setext headings", + "html": "

    `Foo

    \n

    `

    \n

    <a title="a lot

    \n

    of dashes"/>

    \n", + "markdown": "`Foo\n----\n`\n\n
    \n", + "example": 60, + "start_line": 1140 + }, + { + "end_line": 1167, + "section": "Setext headings", + "html": "
    \n

    Foo

    \n
    \n
    \n", + "markdown": "> Foo\n---\n", + "example": 61, + "start_line": 1159 + }, + { + "end_line": 1180, + "section": "Setext headings", + "html": "
    \n

    foo\nbar\n===

    \n
    \n", + "markdown": "> foo\nbar\n===\n", + "example": 62, + "start_line": 1170 + }, + { + "end_line": 1191, + "section": "Setext headings", + "html": "
      \n
    • Foo
    • \n
    \n
    \n", + "markdown": "- Foo\n---\n", + "example": 63, + "start_line": 1183 + }, + { + "end_line": 1205, + "section": "Setext headings", + "html": "

    Foo\nBar

    \n", + "markdown": "Foo\nBar\n---\n", + "example": 64, + "start_line": 1198 + }, + { + "end_line": 1223, + "section": "Setext headings", + "html": "
    \n

    Foo

    \n

    Bar

    \n

    Baz

    \n", + "markdown": "---\nFoo\n---\nBar\n---\nBaz\n", + "example": 65, + "start_line": 1211 + }, + { + "end_line": 1233, + "section": "Setext headings", + "html": "

    ====

    \n", + "markdown": "\n====\n", + "example": 66, + "start_line": 1228 + }, + { + "end_line": 1246, + "section": "Setext headings", + "html": "
    \n
    \n", + "markdown": "---\n---\n", + "example": 67, + "start_line": 1240 + }, + { + "end_line": 1257, + "section": "Setext headings", + "html": "
      \n
    • foo
    • \n
    \n
    \n", + "markdown": "- foo\n-----\n", + "example": 68, + "start_line": 1249 + }, + { + "end_line": 1267, + "section": "Setext headings", + "html": "
    foo\n
    \n
    \n", + "markdown": " foo\n---\n", + "example": 69, + "start_line": 1260 + }, + { + "end_line": 1278, + "section": "Setext headings", + "html": "
    \n

    foo

    \n
    \n
    \n", + "markdown": "> foo\n-----\n", + "example": 70, + "start_line": 1270 + }, + { + "end_line": 1289, + "section": "Setext headings", + "html": "

    > foo

    \n", + "markdown": "\\> foo\n------\n", + "example": 71, + "start_line": 1284 + }, + { + "end_line": 1325, + "section": "Setext headings", + "html": "

    Foo

    \n

    bar

    \n

    baz

    \n", + "markdown": "Foo\n\nbar\n---\nbaz\n", + "example": 72, + "start_line": 1315 + }, + { + "end_line": 1343, + "section": "Setext headings", + "html": "

    Foo\nbar

    \n
    \n

    baz

    \n", + "markdown": "Foo\nbar\n\n---\n\nbaz\n", + "example": 73, + "start_line": 1331 + }, + { + "end_line": 1359, + "section": "Setext headings", + "html": "

    Foo\nbar

    \n
    \n

    baz

    \n", + "markdown": "Foo\nbar\n* * *\nbaz\n", + "example": 74, + "start_line": 1349 + }, + { + "end_line": 1374, + "section": "Setext headings", + "html": "

    Foo\nbar\n---\nbaz

    \n", + "markdown": "Foo\nbar\n\\---\nbaz\n", + "example": 75, + "start_line": 1364 + }, + { + "end_line": 1399, + "section": "Indented code blocks", + "html": "
    a simple\n  indented code block\n
    \n", + "markdown": " a simple\n indented code block\n", + "example": 76, + "start_line": 1392 + }, + { + "end_line": 1417, + "section": "Indented code blocks", + "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", + "markdown": " - foo\n\n bar\n", + "example": 77, + "start_line": 1406 + }, + { + "end_line": 1433, + "section": "Indented code blocks", + "html": "
      \n
    1. \n

      foo

      \n
        \n
      • bar
      • \n
      \n
    2. \n
    \n", + "markdown": "1. foo\n\n - bar\n", + "example": 78, + "start_line": 1420 + }, + { + "end_line": 1451, + "section": "Indented code blocks", + "html": "
    <a/>\n*hi*\n\n- one\n
    \n", + "markdown": "
    \n *hi*\n\n - one\n", + "example": 79, + "start_line": 1440 + }, + { + "end_line": 1473, + "section": "Indented code blocks", + "html": "
    chunk1\n\nchunk2\n\n\n\nchunk3\n
    \n", + "markdown": " chunk1\n\n chunk2\n \n \n \n chunk3\n", + "example": 80, + "start_line": 1456 + }, + { + "end_line": 1488, + "section": "Indented code blocks", + "html": "
    chunk1\n  \n  chunk2\n
    \n", + "markdown": " chunk1\n \n chunk2\n", + "example": 81, + "start_line": 1479 + }, + { + "end_line": 1501, + "section": "Indented code blocks", + "html": "

    Foo\nbar

    \n", + "markdown": "Foo\n bar\n\n", + "example": 82, + "start_line": 1494 + }, + { + "end_line": 1515, + "section": "Indented code blocks", + "html": "
    foo\n
    \n

    bar

    \n", + "markdown": " foo\nbar\n", + "example": 83, + "start_line": 1508 + }, + { + "end_line": 1536, + "section": "Indented code blocks", + "html": "

    Heading

    \n
    foo\n
    \n

    Heading

    \n
    foo\n
    \n
    \n", + "markdown": "# Heading\n foo\nHeading\n------\n foo\n----\n", + "example": 84, + "start_line": 1521 + }, + { + "end_line": 1548, + "section": "Indented code blocks", + "html": "
        foo\nbar\n
    \n", + "markdown": " foo\n bar\n", + "example": 85, + "start_line": 1541 + }, + { + "end_line": 1563, + "section": "Indented code blocks", + "html": "
    foo\n
    \n", + "markdown": "\n \n foo\n \n\n", + "example": 86, + "start_line": 1554 + }, + { + "end_line": 1573, + "section": "Indented code blocks", + "html": "
    foo  \n
    \n", + "markdown": " foo \n", + "example": 87, + "start_line": 1568 + }, + { + "end_line": 1632, + "section": "Fenced code blocks", + "html": "
    <\n >\n
    \n", + "markdown": "```\n<\n >\n```\n", + "example": 88, + "start_line": 1623 + }, + { + "end_line": 1646, + "section": "Fenced code blocks", + "html": "
    <\n >\n
    \n", + "markdown": "~~~\n<\n >\n~~~\n", + "example": 89, + "start_line": 1637 + }, + { + "end_line": 1656, + "section": "Fenced code blocks", + "html": "

    foo

    \n", + "markdown": "``\nfoo\n``\n", + "example": 90, + "start_line": 1650 + }, + { + "end_line": 1670, + "section": "Fenced code blocks", + "html": "
    aaa\n~~~\n
    \n", + "markdown": "```\naaa\n~~~\n```\n", + "example": 91, + "start_line": 1661 + }, + { + "end_line": 1682, + "section": "Fenced code blocks", + "html": "
    aaa\n```\n
    \n", + "markdown": "~~~\naaa\n```\n~~~\n", + "example": 92, + "start_line": 1673 + }, + { + "end_line": 1696, + "section": "Fenced code blocks", + "html": "
    aaa\n```\n
    \n", + "markdown": "````\naaa\n```\n``````\n", + "example": 93, + "start_line": 1687 + }, + { + "end_line": 1708, + "section": "Fenced code blocks", + "html": "
    aaa\n~~~\n
    \n", + "markdown": "~~~~\naaa\n~~~\n~~~~\n", + "example": 94, + "start_line": 1699 + }, + { + "end_line": 1718, + "section": "Fenced code blocks", + "html": "
    \n", + "markdown": "```\n", + "example": 95, + "start_line": 1714 + }, + { + "end_line": 1731, + "section": "Fenced code blocks", + "html": "
    \n```\naaa\n
    \n", + "markdown": "`````\n\n```\naaa\n", + "example": 96, + "start_line": 1721 + }, + { + "end_line": 1745, + "section": "Fenced code blocks", + "html": "
    \n
    aaa\n
    \n
    \n

    bbb

    \n", + "markdown": "> ```\n> aaa\n\nbbb\n", + "example": 97, + "start_line": 1734 + }, + { + "end_line": 1759, + "section": "Fenced code blocks", + "html": "
    \n  \n
    \n", + "markdown": "```\n\n \n```\n", + "example": 98, + "start_line": 1750 + }, + { + "end_line": 1769, + "section": "Fenced code blocks", + "html": "
    \n", + "markdown": "```\n```\n", + "example": 99, + "start_line": 1764 + }, + { + "end_line": 1785, + "section": "Fenced code blocks", + "html": "
    aaa\naaa\n
    \n", + "markdown": " ```\n aaa\naaa\n```\n", + "example": 100, + "start_line": 1776 + }, + { + "end_line": 1799, + "section": "Fenced code blocks", + "html": "
    aaa\naaa\naaa\n
    \n", + "markdown": " ```\naaa\n aaa\naaa\n ```\n", + "example": 101, + "start_line": 1788 + }, + { + "end_line": 1813, + "section": "Fenced code blocks", + "html": "
    aaa\n aaa\naaa\n
    \n", + "markdown": " ```\n aaa\n aaa\n aaa\n ```\n", + "example": 102, + "start_line": 1802 + }, + { + "end_line": 1827, + "section": "Fenced code blocks", + "html": "
    ```\naaa\n```\n
    \n", + "markdown": " ```\n aaa\n ```\n", + "example": 103, + "start_line": 1818 + }, + { + "end_line": 1840, + "section": "Fenced code blocks", + "html": "
    aaa\n
    \n", + "markdown": "```\naaa\n ```\n", + "example": 104, + "start_line": 1833 + }, + { + "end_line": 1850, + "section": "Fenced code blocks", + "html": "
    aaa\n
    \n", + "markdown": " ```\naaa\n ```\n", + "example": 105, + "start_line": 1843 + }, + { + "end_line": 1863, + "section": "Fenced code blocks", + "html": "
    aaa\n    ```\n
    \n", + "markdown": "```\naaa\n ```\n", + "example": 106, + "start_line": 1855 + }, + { + "end_line": 1875, + "section": "Fenced code blocks", + "html": "

    \naaa

    \n", + "markdown": "``` ```\naaa\n", + "example": 107, + "start_line": 1869 + }, + { + "end_line": 1886, + "section": "Fenced code blocks", + "html": "
    aaa\n~~~ ~~\n
    \n", + "markdown": "~~~~~~\naaa\n~~~ ~~\n", + "example": 108, + "start_line": 1878 + }, + { + "end_line": 1903, + "section": "Fenced code blocks", + "html": "

    foo

    \n
    bar\n
    \n

    baz

    \n", + "markdown": "foo\n```\nbar\n```\nbaz\n", + "example": 109, + "start_line": 1892 + }, + { + "end_line": 1921, + "section": "Fenced code blocks", + "html": "

    foo

    \n
    bar\n
    \n

    baz

    \n", + "markdown": "foo\n---\n~~~\nbar\n~~~\n# baz\n", + "example": 110, + "start_line": 1909 + }, + { + "end_line": 1940, + "section": "Fenced code blocks", + "html": "
    def foo(x)\n  return 3\nend\n
    \n", + "markdown": "```ruby\ndef foo(x)\n return 3\nend\n```\n", + "example": 111, + "start_line": 1929 + }, + { + "end_line": 1954, + "section": "Fenced code blocks", + "html": "
    def foo(x)\n  return 3\nend\n
    \n", + "markdown": "~~~~ ruby startline=3 $%@#$\ndef foo(x)\n return 3\nend\n~~~~~~~\n", + "example": 112, + "start_line": 1943 + }, + { + "end_line": 1962, + "section": "Fenced code blocks", + "html": "
    \n", + "markdown": "````;\n````\n", + "example": 113, + "start_line": 1957 + }, + { + "end_line": 1973, + "section": "Fenced code blocks", + "html": "

    aa\nfoo

    \n", + "markdown": "``` aa ```\nfoo\n", + "example": 114, + "start_line": 1967 + }, + { + "end_line": 1985, + "section": "Fenced code blocks", + "html": "
    ``` aaa\n
    \n", + "markdown": "```\n``` aaa\n```\n", + "example": 115, + "start_line": 1978 + }, + { + "end_line": 2070, + "section": "HTML blocks", + "html": "
    \n
    \n**Hello**,\n

    world.\n

    \n
    \n", + "markdown": "
    \n
    \n**Hello**,\n\n_world_.\n
    \n
    \n", + "example": 116, + "start_line": 2055 + }, + { + "end_line": 2103, + "section": "HTML blocks", + "html": "\n \n \n \n
    \n hi\n
    \n

    okay.

    \n", + "markdown": "\n \n \n \n
    \n hi\n
    \n\nokay.\n", + "example": 117, + "start_line": 2084 + }, + { + "end_line": 2114, + "section": "HTML blocks", + "html": "
    \n*foo*\n", + "example": 119, + "start_line": 2119 + }, + { + "end_line": 2140, + "section": "HTML blocks", + "html": "
    \n

    Markdown

    \n
    \n", + "markdown": "
    \n\n*Markdown*\n\n
    \n", + "example": 120, + "start_line": 2130 + }, + { + "end_line": 2154, + "section": "HTML blocks", + "html": "
    \n
    \n", + "markdown": "
    \n
    \n", + "example": 121, + "start_line": 2146 + }, + { + "end_line": 2165, + "section": "HTML blocks", + "html": "
    \n
    \n", + "markdown": "
    \n
    \n", + "example": 122, + "start_line": 2157 + }, + { + "end_line": 2178, + "section": "HTML blocks", + "html": "
    \n*foo*\n

    bar

    \n", + "markdown": "
    \n*foo*\n\n*bar*\n", + "example": 123, + "start_line": 2169 + }, + { + "end_line": 2191, + "section": "HTML blocks", + "html": "\n", + "markdown": "\n", + "example": 127, + "start_line": 2218 + }, + { + "end_line": 2233, + "section": "HTML blocks", + "html": "
    \nfoo\n
    \n", + "markdown": "
    \nfoo\n
    \n", + "example": 128, + "start_line": 2225 + }, + { + "end_line": 2252, + "section": "HTML blocks", + "html": "
    \n``` c\nint x = 33;\n```\n", + "markdown": "
    \n``` c\nint x = 33;\n```\n", + "example": 129, + "start_line": 2242 + }, + { + "end_line": 2267, + "section": "HTML blocks", + "html": "\n*bar*\n\n", + "markdown": "\n*bar*\n\n", + "example": 130, + "start_line": 2259 + }, + { + "end_line": 2280, + "section": "HTML blocks", + "html": "\n*bar*\n\n", + "markdown": "\n*bar*\n\n", + "example": 131, + "start_line": 2272 + }, + { + "end_line": 2291, + "section": "HTML blocks", + "html": "\n*bar*\n\n", + "markdown": "\n*bar*\n\n", + "example": 132, + "start_line": 2283 + }, + { + "end_line": 2300, + "section": "HTML blocks", + "html": "\n*bar*\n", + "markdown": "\n*bar*\n", + "example": 133, + "start_line": 2294 + }, + { + "end_line": 2317, + "section": "HTML blocks", + "html": "\n*foo*\n\n", + "markdown": "\n*foo*\n\n", + "example": 134, + "start_line": 2309 + }, + { + "end_line": 2334, + "section": "HTML blocks", + "html": "\n

    foo

    \n
    \n", + "markdown": "\n\n*foo*\n\n\n", + "example": 135, + "start_line": 2324 + }, + { + "end_line": 2346, + "section": "HTML blocks", + "html": "

    foo

    \n", + "markdown": "*foo*\n", + "example": 136, + "start_line": 2342 + }, + { + "end_line": 2374, + "section": "HTML blocks", + "html": "
    \nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
    \n

    okay

    \n", + "markdown": "
    \nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
    \nokay\n", + "example": 137, + "start_line": 2358 + }, + { + "end_line": 2393, + "section": "HTML blocks", + "html": "\n

    okay

    \n", + "markdown": "\nokay\n", + "example": 138, + "start_line": 2379 + }, + { + "end_line": 2414, + "section": "HTML blocks", + "html": "\nh1 {color:red;}\n\np {color:blue;}\n\n

    okay

    \n", + "markdown": "\nh1 {color:red;}\n\np {color:blue;}\n\nokay\n", + "example": 139, + "start_line": 2398 + }, + { + "end_line": 2431, + "section": "HTML blocks", + "html": "\n\nfoo\n", + "markdown": "\n\nfoo\n", + "example": 140, + "start_line": 2421 + }, + { + "end_line": 2445, + "section": "HTML blocks", + "html": "
    \n
    \nfoo\n
    \n

    bar

    \n", + "markdown": ">
    \n> foo\n\nbar\n", + "example": 141, + "start_line": 2434 + }, + { + "end_line": 2458, + "section": "HTML blocks", + "html": "
      \n
    • \n
      \n
    • \n
    • foo
    • \n
    \n", + "markdown": "-
    \n- foo\n", + "example": 142, + "start_line": 2448 + }, + { + "end_line": 2469, + "section": "HTML blocks", + "html": "\n

    foo

    \n", + "markdown": "\n*foo*\n", + "example": 143, + "start_line": 2463 + }, + { + "end_line": 2478, + "section": "HTML blocks", + "html": "*bar*\n

    baz

    \n", + "markdown": "*bar*\n*baz*\n", + "example": 144, + "start_line": 2472 + }, + { + "end_line": 2492, + "section": "HTML blocks", + "html": "1. *bar*\n", + "markdown": "1. *bar*\n", + "example": 145, + "start_line": 2484 + }, + { + "end_line": 2509, + "section": "HTML blocks", + "html": "\n

    okay

    \n", + "markdown": "\nokay\n", + "example": 146, + "start_line": 2497 + }, + { + "end_line": 2529, + "section": "HTML blocks", + "html": "';\n\n?>\n

    okay

    \n", + "markdown": "';\n\n?>\nokay\n", + "example": 147, + "start_line": 2515 + }, + { + "end_line": 2538, + "section": "HTML blocks", + "html": "\n", + "markdown": "\n", + "example": 148, + "start_line": 2534 + }, + { + "end_line": 2571, + "section": "HTML blocks", + "html": "\n

    okay

    \n", + "markdown": "\nokay\n", + "example": 149, + "start_line": 2543 + }, + { + "end_line": 2584, + "section": "HTML blocks", + "html": " \n
    <!-- foo -->\n
    \n", + "markdown": " \n\n \n", + "example": 150, + "start_line": 2576 + }, + { + "end_line": 2595, + "section": "HTML blocks", + "html": "
    \n
    <div>\n
    \n", + "markdown": "
    \n\n
    \n", + "example": 151, + "start_line": 2587 + }, + { + "end_line": 2611, + "section": "HTML blocks", + "html": "

    Foo

    \n
    \nbar\n
    \n", + "markdown": "Foo\n
    \nbar\n
    \n", + "example": 152, + "start_line": 2601 + }, + { + "end_line": 2627, + "section": "HTML blocks", + "html": "
    \nbar\n
    \n*foo*\n", + "markdown": "
    \nbar\n
    \n*foo*\n", + "example": 153, + "start_line": 2617 + }, + { + "end_line": 2640, + "section": "HTML blocks", + "html": "

    Foo\n\nbaz

    \n", + "markdown": "Foo\n\nbaz\n", + "example": 154, + "start_line": 2632 + }, + { + "end_line": 2683, + "section": "HTML blocks", + "html": "
    \n

    Emphasized text.

    \n
    \n", + "markdown": "
    \n\n*Emphasized* text.\n\n
    \n", + "example": 155, + "start_line": 2673 + }, + { + "end_line": 2694, + "section": "HTML blocks", + "html": "
    \n*Emphasized* text.\n
    \n", + "markdown": "
    \n*Emphasized* text.\n
    \n", + "example": 156, + "start_line": 2686 + }, + { + "end_line": 2728, + "section": "HTML blocks", + "html": "\n\n\n\n
    \nHi\n
    \n", + "markdown": "\n\n\n\n\n\n\n\n
    \nHi\n
    \n", + "example": 157, + "start_line": 2708 + }, + { + "end_line": 2756, + "section": "HTML blocks", + "html": "\n \n
    <td>\n  Hi\n</td>\n
    \n \n
    \n", + "markdown": "\n\n \n\n \n\n \n\n
    \n Hi\n
    \n", + "example": 158, + "start_line": 2735 + }, + { + "end_line": 2789, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": "[foo]: /url \"title\"\n\n[foo]\n", + "example": 159, + "start_line": 2783 + }, + { + "end_line": 2800, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": " [foo]: \n /url \n 'the title' \n\n[foo]\n", + "example": 160, + "start_line": 2792 + }, + { + "end_line": 2809, + "section": "Link reference definitions", + "html": "

    Foo*bar]

    \n", + "markdown": "[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]\n", + "example": 161, + "start_line": 2803 + }, + { + "end_line": 2820, + "section": "Link reference definitions", + "html": "

    Foo bar

    \n", + "markdown": "[Foo bar]:\n\n'title'\n\n[Foo bar]\n", + "example": 162, + "start_line": 2812 + }, + { + "end_line": 2839, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": "[foo]: /url '\ntitle\nline1\nline2\n'\n\n[foo]\n", + "example": 163, + "start_line": 2825 + }, + { + "end_line": 2854, + "section": "Link reference definitions", + "html": "

    [foo]: /url 'title

    \n

    with blank line'

    \n

    [foo]

    \n", + "markdown": "[foo]: /url 'title\n\nwith blank line'\n\n[foo]\n", + "example": 164, + "start_line": 2844 + }, + { + "end_line": 2866, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": "[foo]:\n/url\n\n[foo]\n", + "example": 165, + "start_line": 2859 + }, + { + "end_line": 2878, + "section": "Link reference definitions", + "html": "

    [foo]:

    \n

    [foo]

    \n", + "markdown": "[foo]:\n\n[foo]\n", + "example": 166, + "start_line": 2871 + }, + { + "end_line": 2890, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": "[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]\n", + "example": 167, + "start_line": 2884 + }, + { + "end_line": 2901, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": "[foo]\n\n[foo]: url\n", + "example": 168, + "start_line": 2895 + }, + { + "end_line": 2914, + "section": "Link reference definitions", + "html": "

    foo

    \n", + "markdown": "[foo]\n\n[foo]: first\n[foo]: second\n", + "example": 169, + "start_line": 2907 + }, + { + "end_line": 2926, + "section": "Link reference definitions", + "html": "

    Foo

    \n", + "markdown": "[FOO]: /url\n\n[Foo]\n", + "example": 170, + "start_line": 2920 + }, + { + "end_line": 2935, + "section": "Link reference definitions", + "html": "

    αγω

    \n", + "markdown": "[ΑΓΩ]: /φου\n\n[αγω]\n", + "example": 171, + "start_line": 2929 + }, + { + "end_line": 2944, + "section": "Link reference definitions", + "html": "", + "markdown": "[foo]: /url\n", + "example": 172, + "start_line": 2941 + }, + { + "end_line": 2956, + "section": "Link reference definitions", + "html": "

    bar

    \n", + "markdown": "[\nfoo\n]: /url\nbar\n", + "example": 173, + "start_line": 2949 + }, + { + "end_line": 2966, + "section": "Link reference definitions", + "html": "

    [foo]: /url "title" ok

    \n", + "markdown": "[foo]: /url \"title\" ok\n", + "example": 174, + "start_line": 2962 + }, + { + "end_line": 2976, + "section": "Link reference definitions", + "html": "

    "title" ok

    \n", + "markdown": "[foo]: /url\n\"title\" ok\n", + "example": 175, + "start_line": 2971 + }, + { + "end_line": 2990, + "section": "Link reference definitions", + "html": "
    [foo]: /url "title"\n
    \n

    [foo]

    \n", + "markdown": " [foo]: /url \"title\"\n\n[foo]\n", + "example": 176, + "start_line": 2982 + }, + { + "end_line": 3006, + "section": "Link reference definitions", + "html": "
    [foo]: /url\n
    \n

    [foo]

    \n", + "markdown": "```\n[foo]: /url\n```\n\n[foo]\n", + "example": 177, + "start_line": 2996 + }, + { + "end_line": 3020, + "section": "Link reference definitions", + "html": "

    Foo\n[bar]: /baz

    \n

    [bar]

    \n", + "markdown": "Foo\n[bar]: /baz\n\n[bar]\n", + "example": 178, + "start_line": 3011 + }, + { + "end_line": 3035, + "section": "Link reference definitions", + "html": "

    Foo

    \n
    \n

    bar

    \n
    \n", + "markdown": "# [Foo]\n[foo]: /url\n> bar\n", + "example": 179, + "start_line": 3026 + }, + { + "end_line": 3054, + "section": "Link reference definitions", + "html": "

    foo,\nbar,\nbaz

    \n", + "markdown": "[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]\n", + "example": 180, + "start_line": 3041 + }, + { + "end_line": 3070, + "section": "Link reference definitions", + "html": "

    foo

    \n
    \n
    \n", + "markdown": "[foo]\n\n> [foo]: /url\n", + "example": 181, + "start_line": 3062 + }, + { + "end_line": 3092, + "section": "Paragraphs", + "html": "

    aaa

    \n

    bbb

    \n", + "markdown": "aaa\n\nbbb\n", + "example": 182, + "start_line": 3085 + }, + { + "end_line": 3108, + "section": "Paragraphs", + "html": "

    aaa\nbbb

    \n

    ccc\nddd

    \n", + "markdown": "aaa\nbbb\n\nccc\nddd\n", + "example": 183, + "start_line": 3097 + }, + { + "end_line": 3121, + "section": "Paragraphs", + "html": "

    aaa

    \n

    bbb

    \n", + "markdown": "aaa\n\n\nbbb\n", + "example": 184, + "start_line": 3113 + }, + { + "end_line": 3132, + "section": "Paragraphs", + "html": "

    aaa\nbbb

    \n", + "markdown": " aaa\n bbb\n", + "example": 185, + "start_line": 3126 + }, + { + "end_line": 3146, + "section": "Paragraphs", + "html": "

    aaa\nbbb\nccc

    \n", + "markdown": "aaa\n bbb\n ccc\n", + "example": 186, + "start_line": 3138 + }, + { + "end_line": 3158, + "section": "Paragraphs", + "html": "

    aaa\nbbb

    \n", + "markdown": " aaa\nbbb\n", + "example": 187, + "start_line": 3152 + }, + { + "end_line": 3168, + "section": "Paragraphs", + "html": "
    aaa\n
    \n

    bbb

    \n", + "markdown": " aaa\nbbb\n", + "example": 188, + "start_line": 3161 + }, + { + "end_line": 3181, + "section": "Paragraphs", + "html": "

    aaa
    \nbbb

    \n", + "markdown": "aaa \nbbb \n", + "example": 189, + "start_line": 3175 + }, + { + "end_line": 3204, + "section": "Blank lines", + "html": "

    aaa

    \n

    aaa

    \n", + "markdown": " \n\naaa\n \n\n# aaa\n\n \n", + "example": 190, + "start_line": 3192 + }, + { + "end_line": 3268, + "section": "Block quotes", + "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", + "markdown": "> # Foo\n> bar\n> baz\n", + "example": 191, + "start_line": 3258 + }, + { + "end_line": 3283, + "section": "Block quotes", + "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", + "markdown": "># Foo\n>bar\n> baz\n", + "example": 192, + "start_line": 3273 + }, + { + "end_line": 3298, + "section": "Block quotes", + "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", + "markdown": " > # Foo\n > bar\n > baz\n", + "example": 193, + "start_line": 3288 + }, + { + "end_line": 3312, + "section": "Block quotes", + "html": "
    > # Foo\n> bar\n> baz\n
    \n", + "markdown": " > # Foo\n > bar\n > baz\n", + "example": 194, + "start_line": 3303 + }, + { + "end_line": 3328, + "section": "Block quotes", + "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", + "markdown": "> # Foo\n> bar\nbaz\n", + "example": 195, + "start_line": 3318 + }, + { + "end_line": 3344, + "section": "Block quotes", + "html": "
    \n

    bar\nbaz\nfoo

    \n
    \n", + "markdown": "> bar\nbaz\n> foo\n", + "example": 196, + "start_line": 3334 + }, + { + "end_line": 3366, + "section": "Block quotes", + "html": "
    \n

    foo

    \n
    \n
    \n", + "markdown": "> foo\n---\n", + "example": 197, + "start_line": 3358 + }, + { + "end_line": 3390, + "section": "Block quotes", + "html": "
    \n
      \n
    • foo
    • \n
    \n
    \n
      \n
    • bar
    • \n
    \n", + "markdown": "> - foo\n- bar\n", + "example": 198, + "start_line": 3378 + }, + { + "end_line": 3406, + "section": "Block quotes", + "html": "
    \n
    foo\n
    \n
    \n
    bar\n
    \n", + "markdown": "> foo\n bar\n", + "example": 199, + "start_line": 3396 + }, + { + "end_line": 3419, + "section": "Block quotes", + "html": "
    \n
    \n
    \n

    foo

    \n
    \n", + "markdown": "> ```\nfoo\n```\n", + "example": 200, + "start_line": 3409 + }, + { + "end_line": 3433, + "section": "Block quotes", + "html": "
    \n

    foo\n- bar

    \n
    \n", + "markdown": "> foo\n - bar\n", + "example": 201, + "start_line": 3425 + }, + { + "end_line": 3454, + "section": "Block quotes", + "html": "
    \n
    \n", + "markdown": ">\n", + "example": 202, + "start_line": 3449 + }, + { + "end_line": 3464, + "section": "Block quotes", + "html": "
    \n
    \n", + "markdown": ">\n> \n> \n", + "example": 203, + "start_line": 3457 + }, + { + "end_line": 3477, + "section": "Block quotes", + "html": "
    \n

    foo

    \n
    \n", + "markdown": ">\n> foo\n> \n", + "example": 204, + "start_line": 3469 + }, + { + "end_line": 3493, + "section": "Block quotes", + "html": "
    \n

    foo

    \n
    \n
    \n

    bar

    \n
    \n", + "markdown": "> foo\n\n> bar\n", + "example": 205, + "start_line": 3482 + }, + { + "end_line": 3512, + "section": "Block quotes", + "html": "
    \n

    foo\nbar

    \n
    \n", + "markdown": "> foo\n> bar\n", + "example": 206, + "start_line": 3504 + }, + { + "end_line": 3526, + "section": "Block quotes", + "html": "
    \n

    foo

    \n

    bar

    \n
    \n", + "markdown": "> foo\n>\n> bar\n", + "example": 207, + "start_line": 3517 + }, + { + "end_line": 3539, + "section": "Block quotes", + "html": "

    foo

    \n
    \n

    bar

    \n
    \n", + "markdown": "foo\n> bar\n", + "example": 208, + "start_line": 3531 + }, + { + "end_line": 3557, + "section": "Block quotes", + "html": "
    \n

    aaa

    \n
    \n
    \n
    \n

    bbb

    \n
    \n", + "markdown": "> aaa\n***\n> bbb\n", + "example": 209, + "start_line": 3545 + }, + { + "end_line": 3571, + "section": "Block quotes", + "html": "
    \n

    bar\nbaz

    \n
    \n", + "markdown": "> bar\nbaz\n", + "example": 210, + "start_line": 3563 + }, + { + "end_line": 3583, + "section": "Block quotes", + "html": "
    \n

    bar

    \n
    \n

    baz

    \n", + "markdown": "> bar\n\nbaz\n", + "example": 211, + "start_line": 3574 + }, + { + "end_line": 3595, + "section": "Block quotes", + "html": "
    \n

    bar

    \n
    \n

    baz

    \n", + "markdown": "> bar\n>\nbaz\n", + "example": 212, + "start_line": 3586 + }, + { + "end_line": 3614, + "section": "Block quotes", + "html": "
    \n
    \n
    \n

    foo\nbar

    \n
    \n
    \n
    \n", + "markdown": "> > > foo\nbar\n", + "example": 213, + "start_line": 3602 + }, + { + "end_line": 3631, + "section": "Block quotes", + "html": "
    \n
    \n
    \n

    foo\nbar\nbaz

    \n
    \n
    \n
    \n", + "markdown": ">>> foo\n> bar\n>>baz\n", + "example": 214, + "start_line": 3617 + }, + { + "end_line": 3651, + "section": "Block quotes", + "html": "
    \n
    code\n
    \n
    \n
    \n

    not code

    \n
    \n", + "markdown": "> code\n\n> not code\n", + "example": 215, + "start_line": 3639 + }, + { + "end_line": 3709, + "section": "List items", + "html": "

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n", + "markdown": "A paragraph\nwith two lines.\n\n indented code\n\n> A block quote.\n", + "example": 216, + "start_line": 3694 + }, + { + "end_line": 3735, + "section": "List items", + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "markdown": "1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "example": 217, + "start_line": 3716 + }, + { + "end_line": 3758, + "section": "List items", + "html": "
      \n
    • one
    • \n
    \n

    two

    \n", + "markdown": "- one\n\n two\n", + "example": 218, + "start_line": 3749 + }, + { + "end_line": 3772, + "section": "List items", + "html": "
      \n
    • \n

      one

      \n

      two

      \n
    • \n
    \n", + "markdown": "- one\n\n two\n", + "example": 219, + "start_line": 3761 + }, + { + "end_line": 3785, + "section": "List items", + "html": "
      \n
    • one
    • \n
    \n
     two\n
    \n", + "markdown": " - one\n\n two\n", + "example": 220, + "start_line": 3775 + }, + { + "end_line": 3799, + "section": "List items", + "html": "
      \n
    • \n

      one

      \n

      two

      \n
    • \n
    \n", + "markdown": " - one\n\n two\n", + "example": 221, + "start_line": 3788 + }, + { + "end_line": 3825, + "section": "List items", + "html": "
    \n
    \n
      \n
    1. \n

      one

      \n

      two

      \n
    2. \n
    \n
    \n
    \n", + "markdown": " > > 1. one\n>>\n>> two\n", + "example": 222, + "start_line": 3810 + }, + { + "end_line": 3850, + "section": "List items", + "html": "
    \n
    \n
      \n
    • one
    • \n
    \n

    two

    \n
    \n
    \n", + "markdown": ">>- one\n>>\n > > two\n", + "example": 223, + "start_line": 3837 + }, + { + "end_line": 3863, + "section": "List items", + "html": "

    -one

    \n

    2.two

    \n", + "markdown": "-one\n\n2.two\n", + "example": 224, + "start_line": 3856 + }, + { + "end_line": 3881, + "section": "List items", + "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", + "markdown": "- foo\n\n\n bar\n", + "example": 225, + "start_line": 3869 + }, + { + "end_line": 3908, + "section": "List items", + "html": "
      \n
    1. \n

      foo

      \n
      bar\n
      \n

      baz

      \n
      \n

      bam

      \n
      \n
    2. \n
    \n", + "markdown": "1. foo\n\n ```\n bar\n ```\n\n baz\n\n > bam\n", + "example": 226, + "start_line": 3886 + }, + { + "end_line": 3932, + "section": "List items", + "html": "
      \n
    • \n

      Foo

      \n
      bar\n\n\nbaz\n
      \n
    • \n
    \n", + "markdown": "- Foo\n\n bar\n\n\n baz\n", + "example": 227, + "start_line": 3914 + }, + { + "end_line": 3942, + "section": "List items", + "html": "
      \n
    1. ok
    2. \n
    \n", + "markdown": "123456789. ok\n", + "example": 228, + "start_line": 3936 + }, + { + "end_line": 3949, + "section": "List items", + "html": "

    1234567890. not ok

    \n", + "markdown": "1234567890. not ok\n", + "example": 229, + "start_line": 3945 + }, + { + "end_line": 3960, + "section": "List items", + "html": "
      \n
    1. ok
    2. \n
    \n", + "markdown": "0. ok\n", + "example": 230, + "start_line": 3954 + }, + { + "end_line": 3969, + "section": "List items", + "html": "
      \n
    1. ok
    2. \n
    \n", + "markdown": "003. ok\n", + "example": 231, + "start_line": 3963 + }, + { + "end_line": 3978, + "section": "List items", + "html": "

    -1. not ok

    \n", + "markdown": "-1. not ok\n", + "example": 232, + "start_line": 3974 + }, + { + "end_line": 4010, + "section": "List items", + "html": "
      \n
    • \n

      foo

      \n
      bar\n
      \n
    • \n
    \n", + "markdown": "- foo\n\n bar\n", + "example": 233, + "start_line": 3998 + }, + { + "end_line": 4027, + "section": "List items", + "html": "
      \n
    1. \n

      foo

      \n
      bar\n
      \n
    2. \n
    \n", + "markdown": " 10. foo\n\n bar\n", + "example": 234, + "start_line": 4015 + }, + { + "end_line": 4046, + "section": "List items", + "html": "
    indented code\n
    \n

    paragraph

    \n
    more code\n
    \n", + "markdown": " indented code\n\nparagraph\n\n more code\n", + "example": 235, + "start_line": 4034 + }, + { + "end_line": 4065, + "section": "List items", + "html": "
      \n
    1. \n
      indented code\n
      \n

      paragraph

      \n
      more code\n
      \n
    2. \n
    \n", + "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "example": 236, + "start_line": 4049 + }, + { + "end_line": 4087, + "section": "List items", + "html": "
      \n
    1. \n
       indented code\n
      \n

      paragraph

      \n
      more code\n
      \n
    2. \n
    \n", + "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "example": 237, + "start_line": 4071 + }, + { + "end_line": 4105, + "section": "List items", + "html": "

    foo

    \n

    bar

    \n", + "markdown": " foo\n\nbar\n", + "example": 238, + "start_line": 4098 + }, + { + "end_line": 4117, + "section": "List items", + "html": "
      \n
    • foo
    • \n
    \n

    bar

    \n", + "markdown": "- foo\n\n bar\n", + "example": 239, + "start_line": 4108 + }, + { + "end_line": 4136, + "section": "List items", + "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", + "markdown": "- foo\n\n bar\n", + "example": 240, + "start_line": 4125 + }, + { + "end_line": 4174, + "section": "List items", + "html": "
      \n
    • foo
    • \n
    • \n
      bar\n
      \n
    • \n
    • \n
      baz\n
      \n
    • \n
    \n", + "markdown": "-\n foo\n-\n ```\n bar\n ```\n-\n baz\n", + "example": 241, + "start_line": 4153 + }, + { + "end_line": 4186, + "section": "List items", + "html": "
      \n
    • foo
    • \n
    \n", + "markdown": "- \n foo\n", + "example": 242, + "start_line": 4179 + }, + { + "end_line": 4202, + "section": "List items", + "html": "
      \n
    • \n
    \n

    foo

    \n", + "markdown": "-\n\n foo\n", + "example": 243, + "start_line": 4193 + }, + { + "end_line": 4217, + "section": "List items", + "html": "
      \n
    • foo
    • \n
    • \n
    • bar
    • \n
    \n", + "markdown": "- foo\n-\n- bar\n", + "example": 244, + "start_line": 4207 + }, + { + "end_line": 4232, + "section": "List items", + "html": "
      \n
    • foo
    • \n
    • \n
    • bar
    • \n
    \n", + "markdown": "- foo\n- \n- bar\n", + "example": 245, + "start_line": 4222 + }, + { + "end_line": 4247, + "section": "List items", + "html": "
      \n
    1. foo
    2. \n
    3. \n
    4. bar
    5. \n
    \n", + "markdown": "1. foo\n2.\n3. bar\n", + "example": 246, + "start_line": 4237 + }, + { + "end_line": 4258, + "section": "List items", + "html": "
      \n
    • \n
    \n", + "markdown": "*\n", + "example": 247, + "start_line": 4252 + }, + { + "end_line": 4273, + "section": "List items", + "html": "

    foo\n*

    \n

    foo\n1.

    \n", + "markdown": "foo\n*\n\nfoo\n1.\n", + "example": 248, + "start_line": 4262 + }, + { + "end_line": 4303, + "section": "List items", + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "example": 249, + "start_line": 4284 + }, + { + "end_line": 4327, + "section": "List items", + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "example": 250, + "start_line": 4308 + }, + { + "end_line": 4351, + "section": "List items", + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "example": 251, + "start_line": 4332 + }, + { + "end_line": 4371, + "section": "List items", + "html": "
    1.  A paragraph\n    with two lines.\n\n        indented code\n\n    > A block quote.\n
    \n", + "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "example": 252, + "start_line": 4356 + }, + { + "end_line": 4405, + "section": "List items", + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "markdown": " 1. A paragraph\nwith two lines.\n\n indented code\n\n > A block quote.\n", + "example": 253, + "start_line": 4386 + }, + { + "end_line": 4418, + "section": "List items", + "html": "
      \n
    1. A paragraph\nwith two lines.
    2. \n
    \n", + "markdown": " 1. A paragraph\n with two lines.\n", + "example": 254, + "start_line": 4410 + }, + { + "end_line": 4437, + "section": "List items", + "html": "
    \n
      \n
    1. \n
      \n

      Blockquote\ncontinued here.

      \n
      \n
    2. \n
    \n
    \n", + "markdown": "> 1. > Blockquote\ncontinued here.\n", + "example": 255, + "start_line": 4423 + }, + { + "end_line": 4454, + "section": "List items", + "html": "
    \n
      \n
    1. \n
      \n

      Blockquote\ncontinued here.

      \n
      \n
    2. \n
    \n
    \n", + "markdown": "> 1. > Blockquote\n> continued here.\n", + "example": 256, + "start_line": 4440 + }, + { + "end_line": 4488, + "section": "List items", + "html": "
      \n
    • foo\n
        \n
      • bar\n
          \n
        • baz\n
            \n
          • boo
          • \n
          \n
        • \n
        \n
      • \n
      \n
    • \n
    \n", + "markdown": "- foo\n - bar\n - baz\n - boo\n", + "example": 257, + "start_line": 4467 + }, + { + "end_line": 4505, + "section": "List items", + "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    • baz
    • \n
    • boo
    • \n
    \n", + "markdown": "- foo\n - bar\n - baz\n - boo\n", + "example": 258, + "start_line": 4493 + }, + { + "end_line": 4521, + "section": "List items", + "html": "
      \n
    1. foo\n
        \n
      • bar
      • \n
      \n
    2. \n
    \n", + "markdown": "10) foo\n - bar\n", + "example": 259, + "start_line": 4510 + }, + { + "end_line": 4536, + "section": "List items", + "html": "
      \n
    1. foo
    2. \n
    \n
      \n
    • bar
    • \n
    \n", + "markdown": "10) foo\n - bar\n", + "example": 260, + "start_line": 4526 + }, + { + "end_line": 4551, + "section": "List items", + "html": "
      \n
    • \n
        \n
      • foo
      • \n
      \n
    • \n
    \n", + "markdown": "- - foo\n", + "example": 261, + "start_line": 4541 + }, + { + "end_line": 4568, + "section": "List items", + "html": "
      \n
    1. \n
        \n
      • \n
          \n
        1. foo
        2. \n
        \n
      • \n
      \n
    2. \n
    \n", + "markdown": "1. - 2. foo\n", + "example": 262, + "start_line": 4554 + }, + { + "end_line": 4587, + "section": "List items", + "html": "
      \n
    • \n

      Foo

      \n
    • \n
    • \n

      Bar

      \nbaz
    • \n
    \n", + "markdown": "- # Foo\n- Bar\n ---\n baz\n", + "example": 263, + "start_line": 4573 + }, + { + "end_line": 4821, + "section": "Lists", + "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    \n
      \n
    • baz
    • \n
    \n", + "markdown": "- foo\n- bar\n+ baz\n", + "example": 264, + "start_line": 4809 + }, + { + "end_line": 4836, + "section": "Lists", + "html": "
      \n
    1. foo
    2. \n
    3. bar
    4. \n
    \n
      \n
    1. baz
    2. \n
    \n", + "markdown": "1. foo\n2. bar\n3) baz\n", + "example": 265, + "start_line": 4824 + }, + { + "end_line": 4853, + "section": "Lists", + "html": "

    Foo

    \n
      \n
    • bar
    • \n
    • baz
    • \n
    \n", + "markdown": "Foo\n- bar\n- baz\n", + "example": 266, + "start_line": 4843 + }, + { + "end_line": 4926, + "section": "Lists", + "html": "

    The number of windows in my house is\n14. The number of doors is 6.

    \n", + "markdown": "The number of windows in my house is\n14. The number of doors is 6.\n", + "example": 267, + "start_line": 4920 + }, + { + "end_line": 4938, + "section": "Lists", + "html": "

    The number of windows in my house is

    \n
      \n
    1. The number of doors is 6.
    2. \n
    \n", + "markdown": "The number of windows in my house is\n1. The number of doors is 6.\n", + "example": 268, + "start_line": 4930 + }, + { + "end_line": 4963, + "section": "Lists", + "html": "
      \n
    • \n

      foo

      \n
    • \n
    • \n

      bar

      \n
    • \n
    • \n

      baz

      \n
    • \n
    \n", + "markdown": "- foo\n\n- bar\n\n\n- baz\n", + "example": 269, + "start_line": 4944 + }, + { + "end_line": 4987, + "section": "Lists", + "html": "
      \n
    • foo\n
        \n
      • bar\n
          \n
        • \n

          baz

          \n

          bim

          \n
        • \n
        \n
      • \n
      \n
    • \n
    \n", + "markdown": "- foo\n - bar\n - baz\n\n\n bim\n", + "example": 270, + "start_line": 4965 + }, + { + "end_line": 5013, + "section": "Lists", + "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    \n\n
      \n
    • baz
    • \n
    • bim
    • \n
    \n", + "markdown": "- foo\n- bar\n\n\n\n- baz\n- bim\n", + "example": 271, + "start_line": 4995 + }, + { + "end_line": 5039, + "section": "Lists", + "html": "
      \n
    • \n

      foo

      \n

      notcode

      \n
    • \n
    • \n

      foo

      \n
    • \n
    \n\n
    code\n
    \n", + "markdown": "- foo\n\n notcode\n\n- foo\n\n\n\n code\n", + "example": 272, + "start_line": 5016 + }, + { + "end_line": 5069, + "section": "Lists", + "html": "
      \n
    • a
    • \n
    • b
    • \n
    • c
    • \n
    • d
    • \n
    • e
    • \n
    • f
    • \n
    • g
    • \n
    • h
    • \n
    • i
    • \n
    \n", + "markdown": "- a\n - b\n - c\n - d\n - e\n - f\n - g\n - h\n- i\n", + "example": 273, + "start_line": 5047 + }, + { + "end_line": 5090, + "section": "Lists", + "html": "
      \n
    1. \n

      a

      \n
    2. \n
    3. \n

      b

      \n
    4. \n
    5. \n

      c

      \n
    6. \n
    \n", + "markdown": "1. a\n\n 2. b\n\n 3. c\n", + "example": 274, + "start_line": 5072 + }, + { + "end_line": 5113, + "section": "Lists", + "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n

      b

      \n
    • \n
    • \n

      c

      \n
    • \n
    \n", + "markdown": "- a\n- b\n\n- c\n", + "example": 275, + "start_line": 5096 + }, + { + "end_line": 5133, + "section": "Lists", + "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n
    • \n

      c

      \n
    • \n
    \n", + "markdown": "* a\n*\n\n* c\n", + "example": 276, + "start_line": 5118 + }, + { + "end_line": 5159, + "section": "Lists", + "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n

      b

      \n

      c

      \n
    • \n
    • \n

      d

      \n
    • \n
    \n", + "markdown": "- a\n- b\n\n c\n- d\n", + "example": 277, + "start_line": 5140 + }, + { + "end_line": 5180, + "section": "Lists", + "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n

      b

      \n
    • \n
    • \n

      d

      \n
    • \n
    \n", + "markdown": "- a\n- b\n\n [ref]: /url\n- d\n", + "example": 278, + "start_line": 5162 + }, + { + "end_line": 5204, + "section": "Lists", + "html": "
      \n
    • a
    • \n
    • \n
      b\n\n\n
      \n
    • \n
    • c
    • \n
    \n", + "markdown": "- a\n- ```\n b\n\n\n ```\n- c\n", + "example": 279, + "start_line": 5185 + }, + { + "end_line": 5229, + "section": "Lists", + "html": "
      \n
    • a\n
        \n
      • \n

        b

        \n

        c

        \n
      • \n
      \n
    • \n
    • d
    • \n
    \n", + "markdown": "- a\n - b\n\n c\n- d\n", + "example": 280, + "start_line": 5211 + }, + { + "end_line": 5249, + "section": "Lists", + "html": "
      \n
    • a\n
      \n

      b

      \n
      \n
    • \n
    • c
    • \n
    \n", + "markdown": "* a\n > b\n >\n* c\n", + "example": 281, + "start_line": 5235 + }, + { + "end_line": 5273, + "section": "Lists", + "html": "
      \n
    • a\n
      \n

      b

      \n
      \n
      c\n
      \n
    • \n
    • d
    • \n
    \n", + "markdown": "- a\n > b\n ```\n c\n ```\n- d\n", + "example": 282, + "start_line": 5255 + }, + { + "end_line": 5284, + "section": "Lists", + "html": "
      \n
    • a
    • \n
    \n", + "markdown": "- a\n", + "example": 283, + "start_line": 5278 + }, + { + "end_line": 5298, + "section": "Lists", + "html": "
      \n
    • a\n
        \n
      • b
      • \n
      \n
    • \n
    \n", + "markdown": "- a\n - b\n", + "example": 284, + "start_line": 5287 + }, + { + "end_line": 5318, + "section": "Lists", + "html": "
      \n
    1. \n
      foo\n
      \n

      bar

      \n
    2. \n
    \n", + "markdown": "1. ```\n foo\n ```\n\n bar\n", + "example": 285, + "start_line": 5304 + }, + { + "end_line": 5338, + "section": "Lists", + "html": "
      \n
    • \n

      foo

      \n
        \n
      • bar
      • \n
      \n

      baz

      \n
    • \n
    \n", + "markdown": "* foo\n * bar\n\n baz\n", + "example": 286, + "start_line": 5323 + }, + { + "end_line": 5366, + "section": "Lists", + "html": "
      \n
    • \n

      a

      \n
        \n
      • b
      • \n
      • c
      • \n
      \n
    • \n
    • \n

      d

      \n
        \n
      • e
      • \n
      • f
      • \n
      \n
    • \n
    \n", + "markdown": "- a\n - b\n - c\n\n- d\n - e\n - f\n", + "example": 287, + "start_line": 5341 + }, + { + "end_line": 5379, + "section": "Inlines", + "html": "

    hilo`

    \n", + "markdown": "`hi`lo`\n", + "example": 288, + "start_line": 5375 + }, + { + "end_line": 5393, + "section": "Backslash escapes", + "html": "

    !"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~

    \n", + "markdown": "\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\\\\\]\\^\\_\\`\\{\\|\\}\\~\n", + "example": 289, + "start_line": 5389 + }, + { + "end_line": 5403, + "section": "Backslash escapes", + "html": "

    \\\t\\A\\a\\ \\3\\φ\\«

    \n", + "markdown": "\\\t\\A\\a\\ \\3\\φ\\«\n", + "example": 290, + "start_line": 5399 + }, + { + "end_line": 5427, + "section": "Backslash escapes", + "html": "

    *not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference"

    \n", + "markdown": "\\*not emphasized*\n\\
    not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n", + "example": 291, + "start_line": 5409 + }, + { + "end_line": 5436, + "section": "Backslash escapes", + "html": "

    \\emphasis

    \n", + "markdown": "\\\\*emphasis*\n", + "example": 292, + "start_line": 5432 + }, + { + "end_line": 5447, + "section": "Backslash escapes", + "html": "

    foo
    \nbar

    \n", + "markdown": "foo\\\nbar\n", + "example": 293, + "start_line": 5441 + }, + { + "end_line": 5457, + "section": "Backslash escapes", + "html": "

    \\[\\`

    \n", + "markdown": "`` \\[\\` ``\n", + "example": 294, + "start_line": 5453 + }, + { + "end_line": 5465, + "section": "Backslash escapes", + "html": "
    \\[\\]\n
    \n", + "markdown": " \\[\\]\n", + "example": 295, + "start_line": 5460 + }, + { + "end_line": 5475, + "section": "Backslash escapes", + "html": "
    \\[\\]\n
    \n", + "markdown": "~~~\n\\[\\]\n~~~\n", + "example": 296, + "start_line": 5468 + }, + { + "end_line": 5482, + "section": "Backslash escapes", + "html": "

    http://example.com?find=\\*

    \n", + "markdown": "\n", + "example": 297, + "start_line": 5478 + }, + { + "end_line": 5489, + "section": "Backslash escapes", + "html": "\n", + "markdown": "\n", + "example": 298, + "start_line": 5485 + }, + { + "end_line": 5499, + "section": "Backslash escapes", + "html": "

    foo

    \n", + "markdown": "[foo](/bar\\* \"ti\\*tle\")\n", + "example": 299, + "start_line": 5495 + }, + { + "end_line": 5508, + "section": "Backslash escapes", + "html": "

    foo

    \n", + "markdown": "[foo]\n\n[foo]: /bar\\* \"ti\\*tle\"\n", + "example": 300, + "start_line": 5502 + }, + { + "end_line": 5518, + "section": "Backslash escapes", + "html": "
    foo\n
    \n", + "markdown": "``` foo\\+bar\nfoo\n```\n", + "example": 301, + "start_line": 5511 + }, + { + "end_line": 5546, + "section": "Entity and numeric character references", + "html": "

    & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸

    \n", + "markdown": "  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸\n", + "example": 302, + "start_line": 5538 + }, + { + "end_line": 5561, + "section": "Entity and numeric character references", + "html": "

    # Ӓ Ϡ � �

    \n", + "markdown": "# Ӓ Ϡ � �\n", + "example": 303, + "start_line": 5557 + }, + { + "end_line": 5574, + "section": "Entity and numeric character references", + "html": "

    " ആ ಫ

    \n", + "markdown": "" ആ ಫ\n", + "example": 304, + "start_line": 5570 + }, + { + "end_line": 5585, + "section": "Entity and numeric character references", + "html": "

    &nbsp &x; &#; &#x;\n&ThisIsNotDefined; &hi?;

    \n", + "markdown": "  &x; &#; &#x;\n&ThisIsNotDefined; &hi?;\n", + "example": 305, + "start_line": 5579 + }, + { + "end_line": 5596, + "section": "Entity and numeric character references", + "html": "

    &copy

    \n", + "markdown": "©\n", + "example": 306, + "start_line": 5592 + }, + { + "end_line": 5606, + "section": "Entity and numeric character references", + "html": "

    &MadeUpEntity;

    \n", + "markdown": "&MadeUpEntity;\n", + "example": 307, + "start_line": 5602 + }, + { + "end_line": 5617, + "section": "Entity and numeric character references", + "html": "\n", + "markdown": "\n", + "example": 308, + "start_line": 5613 + }, + { + "end_line": 5624, + "section": "Entity and numeric character references", + "html": "

    foo

    \n", + "markdown": "[foo](/föö \"föö\")\n", + "example": 309, + "start_line": 5620 + }, + { + "end_line": 5633, + "section": "Entity and numeric character references", + "html": "

    foo

    \n", + "markdown": "[foo]\n\n[foo]: /föö \"föö\"\n", + "example": 310, + "start_line": 5627 + }, + { + "end_line": 5643, + "section": "Entity and numeric character references", + "html": "
    foo\n
    \n", + "markdown": "``` föö\nfoo\n```\n", + "example": 311, + "start_line": 5636 + }, + { + "end_line": 5653, + "section": "Entity and numeric character references", + "html": "

    f&ouml;&ouml;

    \n", + "markdown": "`föö`\n", + "example": 312, + "start_line": 5649 + }, + { + "end_line": 5661, + "section": "Entity and numeric character references", + "html": "
    f&ouml;f&ouml;\n
    \n", + "markdown": " föfö\n", + "example": 313, + "start_line": 5656 + }, + { + "end_line": 5682, + "section": "Code spans", + "html": "

    foo

    \n", + "markdown": "`foo`\n", + "example": 314, + "start_line": 5678 + }, + { + "end_line": 5692, + "section": "Code spans", + "html": "

    foo ` bar

    \n", + "markdown": "`` foo ` bar ``\n", + "example": 315, + "start_line": 5688 + }, + { + "end_line": 5702, + "section": "Code spans", + "html": "

    ``

    \n", + "markdown": "` `` `\n", + "example": 316, + "start_line": 5698 + }, + { + "end_line": 5713, + "section": "Code spans", + "html": "

    foo

    \n", + "markdown": "``\nfoo\n``\n", + "example": 317, + "start_line": 5707 + }, + { + "end_line": 5724, + "section": "Code spans", + "html": "

    foo bar baz

    \n", + "markdown": "`foo bar\n baz`\n", + "example": 318, + "start_line": 5719 + }, + { + "end_line": 5734, + "section": "Code spans", + "html": "

    a b

    \n", + "markdown": "`a b`\n", + "example": 319, + "start_line": 5730 + }, + { + "end_line": 5754, + "section": "Code spans", + "html": "

    foo `` bar

    \n", + "markdown": "`foo `` bar`\n", + "example": 320, + "start_line": 5750 + }, + { + "end_line": 5764, + "section": "Code spans", + "html": "

    foo\\bar`

    \n", + "markdown": "`foo\\`bar`\n", + "example": 321, + "start_line": 5760 + }, + { + "end_line": 5780, + "section": "Code spans", + "html": "

    *foo*

    \n", + "markdown": "*foo`*`\n", + "example": 322, + "start_line": 5776 + }, + { + "end_line": 5789, + "section": "Code spans", + "html": "

    [not a link](/foo)

    \n", + "markdown": "[not a `link](/foo`)\n", + "example": 323, + "start_line": 5785 + }, + { + "end_line": 5799, + "section": "Code spans", + "html": "

    <a href="">`

    \n", + "markdown": "``\n", + "example": 324, + "start_line": 5795 + }, + { + "end_line": 5808, + "section": "Code spans", + "html": "

    `

    \n", + "markdown": "`\n", + "example": 325, + "start_line": 5804 + }, + { + "end_line": 5817, + "section": "Code spans", + "html": "

    <http://foo.bar.baz>`

    \n", + "markdown": "``\n", + "example": 326, + "start_line": 5813 + }, + { + "end_line": 5826, + "section": "Code spans", + "html": "

    http://foo.bar.`baz`

    \n", + "markdown": "`\n", + "example": 327, + "start_line": 5822 + }, + { + "end_line": 5836, + "section": "Code spans", + "html": "

    ```foo``

    \n", + "markdown": "```foo``\n", + "example": 328, + "start_line": 5832 + }, + { + "end_line": 5843, + "section": "Code spans", + "html": "

    `foo

    \n", + "markdown": "`foo\n", + "example": 329, + "start_line": 5839 + }, + { + "end_line": 5852, + "section": "Code spans", + "html": "

    `foobar

    \n", + "markdown": "`foo``bar``\n", + "example": 330, + "start_line": 5848 + }, + { + "end_line": 6065, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "*foo bar*\n", + "example": 331, + "start_line": 6061 + }, + { + "end_line": 6075, + "section": "Emphasis and strong emphasis", + "html": "

    a * foo bar*

    \n", + "markdown": "a * foo bar*\n", + "example": 332, + "start_line": 6071 + }, + { + "end_line": 6086, + "section": "Emphasis and strong emphasis", + "html": "

    a*"foo"*

    \n", + "markdown": "a*\"foo\"*\n", + "example": 333, + "start_line": 6082 + }, + { + "end_line": 6095, + "section": "Emphasis and strong emphasis", + "html": "

    * a *

    \n", + "markdown": "* a *\n", + "example": 334, + "start_line": 6091 + }, + { + "end_line": 6104, + "section": "Emphasis and strong emphasis", + "html": "

    foobar

    \n", + "markdown": "foo*bar*\n", + "example": 335, + "start_line": 6100 + }, + { + "end_line": 6111, + "section": "Emphasis and strong emphasis", + "html": "

    5678

    \n", + "markdown": "5*6*78\n", + "example": 336, + "start_line": 6107 + }, + { + "end_line": 6120, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "_foo bar_\n", + "example": 337, + "start_line": 6116 + }, + { + "end_line": 6130, + "section": "Emphasis and strong emphasis", + "html": "

    _ foo bar_

    \n", + "markdown": "_ foo bar_\n", + "example": 338, + "start_line": 6126 + }, + { + "end_line": 6140, + "section": "Emphasis and strong emphasis", + "html": "

    a_"foo"_

    \n", + "markdown": "a_\"foo\"_\n", + "example": 339, + "start_line": 6136 + }, + { + "end_line": 6149, + "section": "Emphasis and strong emphasis", + "html": "

    foo_bar_

    \n", + "markdown": "foo_bar_\n", + "example": 340, + "start_line": 6145 + }, + { + "end_line": 6156, + "section": "Emphasis and strong emphasis", + "html": "

    5_6_78

    \n", + "markdown": "5_6_78\n", + "example": 341, + "start_line": 6152 + }, + { + "end_line": 6163, + "section": "Emphasis and strong emphasis", + "html": "

    пристаням_стремятся_

    \n", + "markdown": "пристаням_стремятся_\n", + "example": 342, + "start_line": 6159 + }, + { + "end_line": 6173, + "section": "Emphasis and strong emphasis", + "html": "

    aa_"bb"_cc

    \n", + "markdown": "aa_\"bb\"_cc\n", + "example": 343, + "start_line": 6169 + }, + { + "end_line": 6184, + "section": "Emphasis and strong emphasis", + "html": "

    foo-(bar)

    \n", + "markdown": "foo-_(bar)_\n", + "example": 344, + "start_line": 6180 + }, + { + "end_line": 6196, + "section": "Emphasis and strong emphasis", + "html": "

    _foo*

    \n", + "markdown": "_foo*\n", + "example": 345, + "start_line": 6192 + }, + { + "end_line": 6206, + "section": "Emphasis and strong emphasis", + "html": "

    *foo bar *

    \n", + "markdown": "*foo bar *\n", + "example": 346, + "start_line": 6202 + }, + { + "end_line": 6217, + "section": "Emphasis and strong emphasis", + "html": "

    *foo bar\n*

    \n", + "markdown": "*foo bar\n*\n", + "example": 347, + "start_line": 6211 + }, + { + "end_line": 6228, + "section": "Emphasis and strong emphasis", + "html": "

    *(*foo)

    \n", + "markdown": "*(*foo)\n", + "example": 348, + "start_line": 6224 + }, + { + "end_line": 6238, + "section": "Emphasis and strong emphasis", + "html": "

    (foo)

    \n", + "markdown": "*(*foo*)*\n", + "example": 349, + "start_line": 6234 + }, + { + "end_line": 6247, + "section": "Emphasis and strong emphasis", + "html": "

    foobar

    \n", + "markdown": "*foo*bar\n", + "example": 350, + "start_line": 6243 + }, + { + "end_line": 6260, + "section": "Emphasis and strong emphasis", + "html": "

    _foo bar _

    \n", + "markdown": "_foo bar _\n", + "example": 351, + "start_line": 6256 + }, + { + "end_line": 6270, + "section": "Emphasis and strong emphasis", + "html": "

    _(_foo)

    \n", + "markdown": "_(_foo)\n", + "example": 352, + "start_line": 6266 + }, + { + "end_line": 6279, + "section": "Emphasis and strong emphasis", + "html": "

    (foo)

    \n", + "markdown": "_(_foo_)_\n", + "example": 353, + "start_line": 6275 + }, + { + "end_line": 6288, + "section": "Emphasis and strong emphasis", + "html": "

    _foo_bar

    \n", + "markdown": "_foo_bar\n", + "example": 354, + "start_line": 6284 + }, + { + "end_line": 6295, + "section": "Emphasis and strong emphasis", + "html": "

    _пристаням_стремятся

    \n", + "markdown": "_пристаням_стремятся\n", + "example": 355, + "start_line": 6291 + }, + { + "end_line": 6302, + "section": "Emphasis and strong emphasis", + "html": "

    foo_bar_baz

    \n", + "markdown": "_foo_bar_baz_\n", + "example": 356, + "start_line": 6298 + }, + { + "end_line": 6313, + "section": "Emphasis and strong emphasis", + "html": "

    (bar).

    \n", + "markdown": "_(bar)_.\n", + "example": 357, + "start_line": 6309 + }, + { + "end_line": 6322, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "**foo bar**\n", + "example": 358, + "start_line": 6318 + }, + { + "end_line": 6332, + "section": "Emphasis and strong emphasis", + "html": "

    ** foo bar**

    \n", + "markdown": "** foo bar**\n", + "example": 359, + "start_line": 6328 + }, + { + "end_line": 6343, + "section": "Emphasis and strong emphasis", + "html": "

    a**"foo"**

    \n", + "markdown": "a**\"foo\"**\n", + "example": 360, + "start_line": 6339 + }, + { + "end_line": 6352, + "section": "Emphasis and strong emphasis", + "html": "

    foobar

    \n", + "markdown": "foo**bar**\n", + "example": 361, + "start_line": 6348 + }, + { + "end_line": 6361, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "__foo bar__\n", + "example": 362, + "start_line": 6357 + }, + { + "end_line": 6371, + "section": "Emphasis and strong emphasis", + "html": "

    __ foo bar__

    \n", + "markdown": "__ foo bar__\n", + "example": 363, + "start_line": 6367 + }, + { + "end_line": 6381, + "section": "Emphasis and strong emphasis", + "html": "

    __\nfoo bar__

    \n", + "markdown": "__\nfoo bar__\n", + "example": 364, + "start_line": 6375 + }, + { + "end_line": 6391, + "section": "Emphasis and strong emphasis", + "html": "

    a__"foo"__

    \n", + "markdown": "a__\"foo\"__\n", + "example": 365, + "start_line": 6387 + }, + { + "end_line": 6400, + "section": "Emphasis and strong emphasis", + "html": "

    foo__bar__

    \n", + "markdown": "foo__bar__\n", + "example": 366, + "start_line": 6396 + }, + { + "end_line": 6407, + "section": "Emphasis and strong emphasis", + "html": "

    5__6__78

    \n", + "markdown": "5__6__78\n", + "example": 367, + "start_line": 6403 + }, + { + "end_line": 6414, + "section": "Emphasis and strong emphasis", + "html": "

    пристаням__стремятся__

    \n", + "markdown": "пристаням__стремятся__\n", + "example": 368, + "start_line": 6410 + }, + { + "end_line": 6421, + "section": "Emphasis and strong emphasis", + "html": "

    foo, bar, baz

    \n", + "markdown": "__foo, __bar__, baz__\n", + "example": 369, + "start_line": 6417 + }, + { + "end_line": 6432, + "section": "Emphasis and strong emphasis", + "html": "

    foo-(bar)

    \n", + "markdown": "foo-__(bar)__\n", + "example": 370, + "start_line": 6428 + }, + { + "end_line": 6445, + "section": "Emphasis and strong emphasis", + "html": "

    **foo bar **

    \n", + "markdown": "**foo bar **\n", + "example": 371, + "start_line": 6441 + }, + { + "end_line": 6458, + "section": "Emphasis and strong emphasis", + "html": "

    **(**foo)

    \n", + "markdown": "**(**foo)\n", + "example": 372, + "start_line": 6454 + }, + { + "end_line": 6468, + "section": "Emphasis and strong emphasis", + "html": "

    (foo)

    \n", + "markdown": "*(**foo**)*\n", + "example": 373, + "start_line": 6464 + }, + { + "end_line": 6477, + "section": "Emphasis and strong emphasis", + "html": "

    Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)

    \n", + "markdown": "**Gomphocarpus (*Gomphocarpus physocarpus*, syn.\n*Asclepias physocarpa*)**\n", + "example": 374, + "start_line": 6471 + }, + { + "end_line": 6484, + "section": "Emphasis and strong emphasis", + "html": "

    foo "bar" foo

    \n", + "markdown": "**foo \"*bar*\" foo**\n", + "example": 375, + "start_line": 6480 + }, + { + "end_line": 6493, + "section": "Emphasis and strong emphasis", + "html": "

    foobar

    \n", + "markdown": "**foo**bar\n", + "example": 376, + "start_line": 6489 + }, + { + "end_line": 6505, + "section": "Emphasis and strong emphasis", + "html": "

    __foo bar __

    \n", + "markdown": "__foo bar __\n", + "example": 377, + "start_line": 6501 + }, + { + "end_line": 6515, + "section": "Emphasis and strong emphasis", + "html": "

    __(__foo)

    \n", + "markdown": "__(__foo)\n", + "example": 378, + "start_line": 6511 + }, + { + "end_line": 6525, + "section": "Emphasis and strong emphasis", + "html": "

    (foo)

    \n", + "markdown": "_(__foo__)_\n", + "example": 379, + "start_line": 6521 + }, + { + "end_line": 6534, + "section": "Emphasis and strong emphasis", + "html": "

    __foo__bar

    \n", + "markdown": "__foo__bar\n", + "example": 380, + "start_line": 6530 + }, + { + "end_line": 6541, + "section": "Emphasis and strong emphasis", + "html": "

    __пристаням__стремятся

    \n", + "markdown": "__пристаням__стремятся\n", + "example": 381, + "start_line": 6537 + }, + { + "end_line": 6548, + "section": "Emphasis and strong emphasis", + "html": "

    foo__bar__baz

    \n", + "markdown": "__foo__bar__baz__\n", + "example": 382, + "start_line": 6544 + }, + { + "end_line": 6559, + "section": "Emphasis and strong emphasis", + "html": "

    (bar).

    \n", + "markdown": "__(bar)__.\n", + "example": 383, + "start_line": 6555 + }, + { + "end_line": 6571, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "*foo [bar](/url)*\n", + "example": 384, + "start_line": 6567 + }, + { + "end_line": 6580, + "section": "Emphasis and strong emphasis", + "html": "

    foo\nbar

    \n", + "markdown": "*foo\nbar*\n", + "example": 385, + "start_line": 6574 + }, + { + "end_line": 6590, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz

    \n", + "markdown": "_foo __bar__ baz_\n", + "example": 386, + "start_line": 6586 + }, + { + "end_line": 6597, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz

    \n", + "markdown": "_foo _bar_ baz_\n", + "example": 387, + "start_line": 6593 + }, + { + "end_line": 6604, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "__foo_ bar_\n", + "example": 388, + "start_line": 6600 + }, + { + "end_line": 6611, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "*foo *bar**\n", + "example": 389, + "start_line": 6607 + }, + { + "end_line": 6618, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz

    \n", + "markdown": "*foo **bar** baz*\n", + "example": 390, + "start_line": 6614 + }, + { + "end_line": 6624, + "section": "Emphasis and strong emphasis", + "html": "

    foobarbaz

    \n", + "markdown": "*foo**bar**baz*\n", + "example": 391, + "start_line": 6620 + }, + { + "end_line": 6649, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "***foo** bar*\n", + "example": 392, + "start_line": 6645 + }, + { + "end_line": 6656, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "*foo **bar***\n", + "example": 393, + "start_line": 6652 + }, + { + "end_line": 6663, + "section": "Emphasis and strong emphasis", + "html": "

    foobar

    \n", + "markdown": "*foo**bar***\n", + "example": 394, + "start_line": 6659 + }, + { + "end_line": 6672, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz bim bop

    \n", + "markdown": "*foo **bar *baz* bim** bop*\n", + "example": 395, + "start_line": 6668 + }, + { + "end_line": 6679, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "*foo [*bar*](/url)*\n", + "example": 396, + "start_line": 6675 + }, + { + "end_line": 6688, + "section": "Emphasis and strong emphasis", + "html": "

    ** is not an empty emphasis

    \n", + "markdown": "** is not an empty emphasis\n", + "example": 397, + "start_line": 6684 + }, + { + "end_line": 6695, + "section": "Emphasis and strong emphasis", + "html": "

    **** is not an empty strong emphasis

    \n", + "markdown": "**** is not an empty strong emphasis\n", + "example": 398, + "start_line": 6691 + }, + { + "end_line": 6708, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "**foo [bar](/url)**\n", + "example": 399, + "start_line": 6704 + }, + { + "end_line": 6717, + "section": "Emphasis and strong emphasis", + "html": "

    foo\nbar

    \n", + "markdown": "**foo\nbar**\n", + "example": 400, + "start_line": 6711 + }, + { + "end_line": 6727, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz

    \n", + "markdown": "__foo _bar_ baz__\n", + "example": 401, + "start_line": 6723 + }, + { + "end_line": 6734, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz

    \n", + "markdown": "__foo __bar__ baz__\n", + "example": 402, + "start_line": 6730 + }, + { + "end_line": 6741, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "____foo__ bar__\n", + "example": 403, + "start_line": 6737 + }, + { + "end_line": 6748, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "**foo **bar****\n", + "example": 404, + "start_line": 6744 + }, + { + "end_line": 6755, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz

    \n", + "markdown": "**foo *bar* baz**\n", + "example": 405, + "start_line": 6751 + }, + { + "end_line": 6762, + "section": "Emphasis and strong emphasis", + "html": "

    foobarbaz

    \n", + "markdown": "**foo*bar*baz**\n", + "example": 406, + "start_line": 6758 + }, + { + "end_line": 6769, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "***foo* bar**\n", + "example": 407, + "start_line": 6765 + }, + { + "end_line": 6776, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "**foo *bar***\n", + "example": 408, + "start_line": 6772 + }, + { + "end_line": 6787, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar baz\nbim bop

    \n", + "markdown": "**foo *bar **baz**\nbim* bop**\n", + "example": 409, + "start_line": 6781 + }, + { + "end_line": 6794, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar

    \n", + "markdown": "**foo [*bar*](/url)**\n", + "example": 410, + "start_line": 6790 + }, + { + "end_line": 6803, + "section": "Emphasis and strong emphasis", + "html": "

    __ is not an empty emphasis

    \n", + "markdown": "__ is not an empty emphasis\n", + "example": 411, + "start_line": 6799 + }, + { + "end_line": 6810, + "section": "Emphasis and strong emphasis", + "html": "

    ____ is not an empty strong emphasis

    \n", + "markdown": "____ is not an empty strong emphasis\n", + "example": 412, + "start_line": 6806 + }, + { + "end_line": 6820, + "section": "Emphasis and strong emphasis", + "html": "

    foo ***

    \n", + "markdown": "foo ***\n", + "example": 413, + "start_line": 6816 + }, + { + "end_line": 6827, + "section": "Emphasis and strong emphasis", + "html": "

    foo *

    \n", + "markdown": "foo *\\**\n", + "example": 414, + "start_line": 6823 + }, + { + "end_line": 6834, + "section": "Emphasis and strong emphasis", + "html": "

    foo _

    \n", + "markdown": "foo *_*\n", + "example": 415, + "start_line": 6830 + }, + { + "end_line": 6841, + "section": "Emphasis and strong emphasis", + "html": "

    foo *****

    \n", + "markdown": "foo *****\n", + "example": 416, + "start_line": 6837 + }, + { + "end_line": 6848, + "section": "Emphasis and strong emphasis", + "html": "

    foo *

    \n", + "markdown": "foo **\\***\n", + "example": 417, + "start_line": 6844 + }, + { + "end_line": 6855, + "section": "Emphasis and strong emphasis", + "html": "

    foo _

    \n", + "markdown": "foo **_**\n", + "example": 418, + "start_line": 6851 + }, + { + "end_line": 6866, + "section": "Emphasis and strong emphasis", + "html": "

    *foo

    \n", + "markdown": "**foo*\n", + "example": 419, + "start_line": 6862 + }, + { + "end_line": 6873, + "section": "Emphasis and strong emphasis", + "html": "

    foo*

    \n", + "markdown": "*foo**\n", + "example": 420, + "start_line": 6869 + }, + { + "end_line": 6880, + "section": "Emphasis and strong emphasis", + "html": "

    *foo

    \n", + "markdown": "***foo**\n", + "example": 421, + "start_line": 6876 + }, + { + "end_line": 6887, + "section": "Emphasis and strong emphasis", + "html": "

    ***foo

    \n", + "markdown": "****foo*\n", + "example": 422, + "start_line": 6883 + }, + { + "end_line": 6894, + "section": "Emphasis and strong emphasis", + "html": "

    foo*

    \n", + "markdown": "**foo***\n", + "example": 423, + "start_line": 6890 + }, + { + "end_line": 6901, + "section": "Emphasis and strong emphasis", + "html": "

    foo***

    \n", + "markdown": "*foo****\n", + "example": 424, + "start_line": 6897 + }, + { + "end_line": 6911, + "section": "Emphasis and strong emphasis", + "html": "

    foo ___

    \n", + "markdown": "foo ___\n", + "example": 425, + "start_line": 6907 + }, + { + "end_line": 6918, + "section": "Emphasis and strong emphasis", + "html": "

    foo _

    \n", + "markdown": "foo _\\__\n", + "example": 426, + "start_line": 6914 + }, + { + "end_line": 6925, + "section": "Emphasis and strong emphasis", + "html": "

    foo *

    \n", + "markdown": "foo _*_\n", + "example": 427, + "start_line": 6921 + }, + { + "end_line": 6932, + "section": "Emphasis and strong emphasis", + "html": "

    foo _____

    \n", + "markdown": "foo _____\n", + "example": 428, + "start_line": 6928 + }, + { + "end_line": 6939, + "section": "Emphasis and strong emphasis", + "html": "

    foo _

    \n", + "markdown": "foo __\\___\n", + "example": 429, + "start_line": 6935 + }, + { + "end_line": 6946, + "section": "Emphasis and strong emphasis", + "html": "

    foo *

    \n", + "markdown": "foo __*__\n", + "example": 430, + "start_line": 6942 + }, + { + "end_line": 6953, + "section": "Emphasis and strong emphasis", + "html": "

    _foo

    \n", + "markdown": "__foo_\n", + "example": 431, + "start_line": 6949 + }, + { + "end_line": 6964, + "section": "Emphasis and strong emphasis", + "html": "

    foo_

    \n", + "markdown": "_foo__\n", + "example": 432, + "start_line": 6960 + }, + { + "end_line": 6971, + "section": "Emphasis and strong emphasis", + "html": "

    _foo

    \n", + "markdown": "___foo__\n", + "example": 433, + "start_line": 6967 + }, + { + "end_line": 6978, + "section": "Emphasis and strong emphasis", + "html": "

    ___foo

    \n", + "markdown": "____foo_\n", + "example": 434, + "start_line": 6974 + }, + { + "end_line": 6985, + "section": "Emphasis and strong emphasis", + "html": "

    foo_

    \n", + "markdown": "__foo___\n", + "example": 435, + "start_line": 6981 + }, + { + "end_line": 6992, + "section": "Emphasis and strong emphasis", + "html": "

    foo___

    \n", + "markdown": "_foo____\n", + "example": 436, + "start_line": 6988 + }, + { + "end_line": 7002, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "**foo**\n", + "example": 437, + "start_line": 6998 + }, + { + "end_line": 7009, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "*_foo_*\n", + "example": 438, + "start_line": 7005 + }, + { + "end_line": 7016, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "__foo__\n", + "example": 439, + "start_line": 7012 + }, + { + "end_line": 7023, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "_*foo*_\n", + "example": 440, + "start_line": 7019 + }, + { + "end_line": 7033, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "****foo****\n", + "example": 441, + "start_line": 7029 + }, + { + "end_line": 7040, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "____foo____\n", + "example": 442, + "start_line": 7036 + }, + { + "end_line": 7051, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "******foo******\n", + "example": 443, + "start_line": 7047 + }, + { + "end_line": 7060, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "***foo***\n", + "example": 444, + "start_line": 7056 + }, + { + "end_line": 7067, + "section": "Emphasis and strong emphasis", + "html": "

    foo

    \n", + "markdown": "_____foo_____\n", + "example": 445, + "start_line": 7063 + }, + { + "end_line": 7076, + "section": "Emphasis and strong emphasis", + "html": "

    foo _bar baz_

    \n", + "markdown": "*foo _bar* baz_\n", + "example": 446, + "start_line": 7072 + }, + { + "end_line": 7083, + "section": "Emphasis and strong emphasis", + "html": "

    foo bar *baz bim bam

    \n", + "markdown": "*foo __bar *baz bim__ bam*\n", + "example": 447, + "start_line": 7079 + }, + { + "end_line": 7092, + "section": "Emphasis and strong emphasis", + "html": "

    **foo bar baz

    \n", + "markdown": "**foo **bar baz**\n", + "example": 448, + "start_line": 7088 + }, + { + "end_line": 7099, + "section": "Emphasis and strong emphasis", + "html": "

    *foo bar baz

    \n", + "markdown": "*foo *bar baz*\n", + "example": 449, + "start_line": 7095 + }, + { + "end_line": 7108, + "section": "Emphasis and strong emphasis", + "html": "

    *bar*

    \n", + "markdown": "*[bar*](/url)\n", + "example": 450, + "start_line": 7104 + }, + { + "end_line": 7115, + "section": "Emphasis and strong emphasis", + "html": "

    _foo bar_

    \n", + "markdown": "_foo [bar_](/url)\n", + "example": 451, + "start_line": 7111 + }, + { + "end_line": 7122, + "section": "Emphasis and strong emphasis", + "html": "

    *

    \n", + "markdown": "*\n", + "example": 452, + "start_line": 7118 + }, + { + "end_line": 7129, + "section": "Emphasis and strong emphasis", + "html": "

    **

    \n", + "markdown": "**\n", + "example": 453, + "start_line": 7125 + }, + { + "end_line": 7136, + "section": "Emphasis and strong emphasis", + "html": "

    __

    \n", + "markdown": "__\n", + "example": 454, + "start_line": 7132 + }, + { + "end_line": 7143, + "section": "Emphasis and strong emphasis", + "html": "

    a *

    \n", + "markdown": "*a `*`*\n", + "example": 455, + "start_line": 7139 + }, + { + "end_line": 7150, + "section": "Emphasis and strong emphasis", + "html": "

    a _

    \n", + "markdown": "_a `_`_\n", + "example": 456, + "start_line": 7146 + }, + { + "end_line": 7157, + "section": "Emphasis and strong emphasis", + "html": "

    **ahttp://foo.bar/?q=**

    \n", + "markdown": "**a\n", + "example": 457, + "start_line": 7153 + }, + { + "end_line": 7164, + "section": "Emphasis and strong emphasis", + "html": "

    __ahttp://foo.bar/?q=__

    \n", + "markdown": "__a\n", + "example": 458, + "start_line": 7160 + }, + { + "end_line": 7245, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](/uri \"title\")\n", + "example": 459, + "start_line": 7241 + }, + { + "end_line": 7254, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](/uri)\n", + "example": 460, + "start_line": 7250 + }, + { + "end_line": 7263, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link]()\n", + "example": 461, + "start_line": 7259 + }, + { + "end_line": 7270, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](<>)\n", + "example": 462, + "start_line": 7266 + }, + { + "end_line": 7280, + "section": "Links", + "html": "

    [link](/my uri)

    \n", + "markdown": "[link](/my uri)\n", + "example": 463, + "start_line": 7276 + }, + { + "end_line": 7287, + "section": "Links", + "html": "

    [link](</my uri>)

    \n", + "markdown": "[link]()\n", + "example": 464, + "start_line": 7283 + }, + { + "end_line": 7296, + "section": "Links", + "html": "

    [link](foo\nbar)

    \n", + "markdown": "[link](foo\nbar)\n", + "example": 465, + "start_line": 7290 + }, + { + "end_line": 7305, + "section": "Links", + "html": "

    [link]()

    \n", + "markdown": "[link]()\n", + "example": 466, + "start_line": 7299 + }, + { + "end_line": 7313, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](\\(foo\\))\n", + "example": 467, + "start_line": 7309 + }, + { + "end_line": 7322, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](foo(and(bar)))\n", + "example": 468, + "start_line": 7318 + }, + { + "end_line": 7331, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](foo\\(and\\(bar\\))\n", + "example": 469, + "start_line": 7327 + }, + { + "end_line": 7338, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link]()\n", + "example": 470, + "start_line": 7334 + }, + { + "end_line": 7348, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](foo\\)\\:)\n", + "example": 471, + "start_line": 7344 + }, + { + "end_line": 7363, + "section": "Links", + "html": "

    link

    \n

    link

    \n

    link

    \n", + "markdown": "[link](#fragment)\n\n[link](http://example.com#fragment)\n\n[link](http://example.com?foo=3#frag)\n", + "example": 472, + "start_line": 7353 + }, + { + "end_line": 7373, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](foo\\bar)\n", + "example": 473, + "start_line": 7369 + }, + { + "end_line": 7389, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](foo%20bä)\n", + "example": 474, + "start_line": 7385 + }, + { + "end_line": 7400, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](\"title\")\n", + "example": 475, + "start_line": 7396 + }, + { + "end_line": 7413, + "section": "Links", + "html": "

    link\nlink\nlink

    \n", + "markdown": "[link](/url \"title\")\n[link](/url 'title')\n[link](/url (title))\n", + "example": 476, + "start_line": 7405 + }, + { + "end_line": 7423, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](/url \"title \\\""\")\n", + "example": 477, + "start_line": 7419 + }, + { + "end_line": 7433, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](/url \"title\")\n", + "example": 478, + "start_line": 7429 + }, + { + "end_line": 7442, + "section": "Links", + "html": "

    [link](/url "title "and" title")

    \n", + "markdown": "[link](/url \"title \"and\" title\")\n", + "example": 479, + "start_line": 7438 + }, + { + "end_line": 7451, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link](/url 'title \"and\" title')\n", + "example": 480, + "start_line": 7447 + }, + { + "end_line": 7476, + "section": "Links", + "html": "

    link

    \n", + "markdown": "[link]( /uri\n \"title\" )\n", + "example": 481, + "start_line": 7471 + }, + { + "end_line": 7486, + "section": "Links", + "html": "

    [link] (/uri)

    \n", + "markdown": "[link] (/uri)\n", + "example": 482, + "start_line": 7482 + }, + { + "end_line": 7496, + "section": "Links", + "html": "

    link [foo [bar]]

    \n", + "markdown": "[link [foo [bar]]](/uri)\n", + "example": 483, + "start_line": 7492 + }, + { + "end_line": 7503, + "section": "Links", + "html": "

    [link] bar](/uri)

    \n", + "markdown": "[link] bar](/uri)\n", + "example": 484, + "start_line": 7499 + }, + { + "end_line": 7510, + "section": "Links", + "html": "

    [link bar

    \n", + "markdown": "[link [bar](/uri)\n", + "example": 485, + "start_line": 7506 + }, + { + "end_line": 7517, + "section": "Links", + "html": "

    link [bar

    \n", + "markdown": "[link \\[bar](/uri)\n", + "example": 486, + "start_line": 7513 + }, + { + "end_line": 7526, + "section": "Links", + "html": "

    link foo bar #

    \n", + "markdown": "[link *foo **bar** `#`*](/uri)\n", + "example": 487, + "start_line": 7522 + }, + { + "end_line": 7533, + "section": "Links", + "html": "

    \"moon\"

    \n", + "markdown": "[![moon](moon.jpg)](/uri)\n", + "example": 488, + "start_line": 7529 + }, + { + "end_line": 7542, + "section": "Links", + "html": "

    [foo bar](/uri)

    \n", + "markdown": "[foo [bar](/uri)](/uri)\n", + "example": 489, + "start_line": 7538 + }, + { + "end_line": 7549, + "section": "Links", + "html": "

    [foo [bar baz](/uri)](/uri)

    \n", + "markdown": "[foo *[bar [baz](/uri)](/uri)*](/uri)\n", + "example": 490, + "start_line": 7545 + }, + { + "end_line": 7556, + "section": "Links", + "html": "

    \"[foo](uri2)\"

    \n", + "markdown": "![[[foo](uri1)](uri2)](uri3)\n", + "example": 491, + "start_line": 7552 + }, + { + "end_line": 7566, + "section": "Links", + "html": "

    *foo*

    \n", + "markdown": "*[foo*](/uri)\n", + "example": 492, + "start_line": 7562 + }, + { + "end_line": 7573, + "section": "Links", + "html": "

    foo *bar

    \n", + "markdown": "[foo *bar](baz*)\n", + "example": 493, + "start_line": 7569 + }, + { + "end_line": 7583, + "section": "Links", + "html": "

    foo [bar baz]

    \n", + "markdown": "*foo [bar* baz]\n", + "example": 494, + "start_line": 7579 + }, + { + "end_line": 7593, + "section": "Links", + "html": "

    [foo

    \n", + "markdown": "[foo \n", + "example": 495, + "start_line": 7589 + }, + { + "end_line": 7600, + "section": "Links", + "html": "

    [foo](/uri)

    \n", + "markdown": "[foo`](/uri)`\n", + "example": 496, + "start_line": 7596 + }, + { + "end_line": 7607, + "section": "Links", + "html": "

    [foohttp://example.com/?search=](uri)

    \n", + "markdown": "[foo\n", + "example": 497, + "start_line": 7603 + }, + { + "end_line": 7647, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo][bar]\n\n[bar]: /url \"title\"\n", + "example": 498, + "start_line": 7641 + }, + { + "end_line": 7662, + "section": "Links", + "html": "

    link [foo [bar]]

    \n", + "markdown": "[link [foo [bar]]][ref]\n\n[ref]: /uri\n", + "example": 499, + "start_line": 7656 + }, + { + "end_line": 7671, + "section": "Links", + "html": "

    link [bar

    \n", + "markdown": "[link \\[bar][ref]\n\n[ref]: /uri\n", + "example": 500, + "start_line": 7665 + }, + { + "end_line": 7682, + "section": "Links", + "html": "

    link foo bar #

    \n", + "markdown": "[link *foo **bar** `#`*][ref]\n\n[ref]: /uri\n", + "example": 501, + "start_line": 7676 + }, + { + "end_line": 7691, + "section": "Links", + "html": "

    \"moon\"

    \n", + "markdown": "[![moon](moon.jpg)][ref]\n\n[ref]: /uri\n", + "example": 502, + "start_line": 7685 + }, + { + "end_line": 7702, + "section": "Links", + "html": "

    [foo bar]ref

    \n", + "markdown": "[foo [bar](/uri)][ref]\n\n[ref]: /uri\n", + "example": 503, + "start_line": 7696 + }, + { + "end_line": 7711, + "section": "Links", + "html": "

    [foo bar baz]ref

    \n", + "markdown": "[foo *bar [baz][ref]*][ref]\n\n[ref]: /uri\n", + "example": 504, + "start_line": 7705 + }, + { + "end_line": 7726, + "section": "Links", + "html": "

    *foo*

    \n", + "markdown": "*[foo*][ref]\n\n[ref]: /uri\n", + "example": 505, + "start_line": 7720 + }, + { + "end_line": 7735, + "section": "Links", + "html": "

    foo *bar

    \n", + "markdown": "[foo *bar][ref]\n\n[ref]: /uri\n", + "example": 506, + "start_line": 7729 + }, + { + "end_line": 7747, + "section": "Links", + "html": "

    [foo

    \n", + "markdown": "[foo \n\n[ref]: /uri\n", + "example": 507, + "start_line": 7741 + }, + { + "end_line": 7756, + "section": "Links", + "html": "

    [foo][ref]

    \n", + "markdown": "[foo`][ref]`\n\n[ref]: /uri\n", + "example": 508, + "start_line": 7750 + }, + { + "end_line": 7765, + "section": "Links", + "html": "

    [foohttp://example.com/?search=][ref]

    \n", + "markdown": "[foo\n\n[ref]: /uri\n", + "example": 509, + "start_line": 7759 + }, + { + "end_line": 7776, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo][BaR]\n\n[bar]: /url \"title\"\n", + "example": 510, + "start_line": 7770 + }, + { + "end_line": 7787, + "section": "Links", + "html": "

    Толпой is a Russian word.

    \n", + "markdown": "[Толпой][Толпой] is a Russian word.\n\n[ТОЛПОЙ]: /url\n", + "example": 511, + "start_line": 7781 + }, + { + "end_line": 7800, + "section": "Links", + "html": "

    Baz

    \n", + "markdown": "[Foo\n bar]: /url\n\n[Baz][Foo bar]\n", + "example": 512, + "start_line": 7793 + }, + { + "end_line": 7812, + "section": "Links", + "html": "

    [foo] bar

    \n", + "markdown": "[foo] [bar]\n\n[bar]: /url \"title\"\n", + "example": 513, + "start_line": 7806 + }, + { + "end_line": 7823, + "section": "Links", + "html": "

    [foo]\nbar

    \n", + "markdown": "[foo]\n[bar]\n\n[bar]: /url \"title\"\n", + "example": 514, + "start_line": 7815 + }, + { + "end_line": 7864, + "section": "Links", + "html": "

    bar

    \n", + "markdown": "[foo]: /url1\n\n[foo]: /url2\n\n[bar][foo]\n", + "example": 515, + "start_line": 7856 + }, + { + "end_line": 7877, + "section": "Links", + "html": "

    [bar][foo!]

    \n", + "markdown": "[bar][foo\\!]\n\n[foo!]: /url\n", + "example": 516, + "start_line": 7871 + }, + { + "end_line": 7890, + "section": "Links", + "html": "

    [foo][ref[]

    \n

    [ref[]: /uri

    \n", + "markdown": "[foo][ref[]\n\n[ref[]: /uri\n", + "example": 517, + "start_line": 7883 + }, + { + "end_line": 7900, + "section": "Links", + "html": "

    [foo][ref[bar]]

    \n

    [ref[bar]]: /uri

    \n", + "markdown": "[foo][ref[bar]]\n\n[ref[bar]]: /uri\n", + "example": 518, + "start_line": 7893 + }, + { + "end_line": 7910, + "section": "Links", + "html": "

    [[[foo]]]

    \n

    [[[foo]]]: /url

    \n", + "markdown": "[[[foo]]]\n\n[[[foo]]]: /url\n", + "example": 519, + "start_line": 7903 + }, + { + "end_line": 7919, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo][ref\\[]\n\n[ref\\[]: /uri\n", + "example": 520, + "start_line": 7913 + }, + { + "end_line": 7930, + "section": "Links", + "html": "

    bar\\

    \n", + "markdown": "[bar\\\\]: /uri\n\n[bar\\\\]\n", + "example": 521, + "start_line": 7924 + }, + { + "end_line": 7942, + "section": "Links", + "html": "

    []

    \n

    []: /uri

    \n", + "markdown": "[]\n\n[]: /uri\n", + "example": 522, + "start_line": 7935 + }, + { + "end_line": 7956, + "section": "Links", + "html": "

    [\n]

    \n

    [\n]: /uri

    \n", + "markdown": "[\n ]\n\n[\n ]: /uri\n", + "example": 523, + "start_line": 7945 + }, + { + "end_line": 7974, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo][]\n\n[foo]: /url \"title\"\n", + "example": 524, + "start_line": 7968 + }, + { + "end_line": 7983, + "section": "Links", + "html": "

    foo bar

    \n", + "markdown": "[*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", + "example": 525, + "start_line": 7977 + }, + { + "end_line": 7994, + "section": "Links", + "html": "

    Foo

    \n", + "markdown": "[Foo][]\n\n[foo]: /url \"title\"\n", + "example": 526, + "start_line": 7988 + }, + { + "end_line": 8009, + "section": "Links", + "html": "

    foo\n[]

    \n", + "markdown": "[foo] \n[]\n\n[foo]: /url \"title\"\n", + "example": 527, + "start_line": 8001 + }, + { + "end_line": 8027, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo]\n\n[foo]: /url \"title\"\n", + "example": 528, + "start_line": 8021 + }, + { + "end_line": 8036, + "section": "Links", + "html": "

    foo bar

    \n", + "markdown": "[*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", + "example": 529, + "start_line": 8030 + }, + { + "end_line": 8045, + "section": "Links", + "html": "

    [foo bar]

    \n", + "markdown": "[[*foo* bar]]\n\n[*foo* bar]: /url \"title\"\n", + "example": 530, + "start_line": 8039 + }, + { + "end_line": 8054, + "section": "Links", + "html": "

    [[bar foo

    \n", + "markdown": "[[bar [foo]\n\n[foo]: /url\n", + "example": 531, + "start_line": 8048 + }, + { + "end_line": 8065, + "section": "Links", + "html": "

    Foo

    \n", + "markdown": "[Foo]\n\n[foo]: /url \"title\"\n", + "example": 532, + "start_line": 8059 + }, + { + "end_line": 8076, + "section": "Links", + "html": "

    foo bar

    \n", + "markdown": "[foo] bar\n\n[foo]: /url\n", + "example": 533, + "start_line": 8070 + }, + { + "end_line": 8088, + "section": "Links", + "html": "

    [foo]

    \n", + "markdown": "\\[foo]\n\n[foo]: /url \"title\"\n", + "example": 534, + "start_line": 8082 + }, + { + "end_line": 8100, + "section": "Links", + "html": "

    *foo*

    \n", + "markdown": "[foo*]: /url\n\n*[foo*]\n", + "example": 535, + "start_line": 8094 + }, + { + "end_line": 8113, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo][bar]\n\n[foo]: /url1\n[bar]: /url2\n", + "example": 536, + "start_line": 8106 + }, + { + "end_line": 8121, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo][]\n\n[foo]: /url1\n", + "example": 537, + "start_line": 8115 + }, + { + "end_line": 8131, + "section": "Links", + "html": "

    foo

    \n", + "markdown": "[foo]()\n\n[foo]: /url1\n", + "example": 538, + "start_line": 8125 + }, + { + "end_line": 8139, + "section": "Links", + "html": "

    foo(not a link)

    \n", + "markdown": "[foo](not a link)\n\n[foo]: /url1\n", + "example": 539, + "start_line": 8133 + }, + { + "end_line": 8150, + "section": "Links", + "html": "

    [foo]bar

    \n", + "markdown": "[foo][bar][baz]\n\n[baz]: /url\n", + "example": 540, + "start_line": 8144 + }, + { + "end_line": 8163, + "section": "Links", + "html": "

    foobaz

    \n", + "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[bar]: /url2\n", + "example": 541, + "start_line": 8156 + }, + { + "end_line": 8176, + "section": "Links", + "html": "

    [foo]bar

    \n", + "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[foo]: /url2\n", + "example": 542, + "start_line": 8169 + }, + { + "end_line": 8196, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo](/url \"title\")\n", + "example": 543, + "start_line": 8192 + }, + { + "end_line": 8205, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![foo *bar*]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", + "example": 544, + "start_line": 8199 + }, + { + "end_line": 8212, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![foo ![bar](/url)](/url2)\n", + "example": 545, + "start_line": 8208 + }, + { + "end_line": 8219, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![foo [bar](/url)](/url2)\n", + "example": 546, + "start_line": 8215 + }, + { + "end_line": 8235, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![foo *bar*][]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", + "example": 547, + "start_line": 8229 + }, + { + "end_line": 8244, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![foo *bar*][foobar]\n\n[FOOBAR]: train.jpg \"train & tracks\"\n", + "example": 548, + "start_line": 8238 + }, + { + "end_line": 8251, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo](train.jpg)\n", + "example": 549, + "start_line": 8247 + }, + { + "end_line": 8258, + "section": "Images", + "html": "

    My \"foo

    \n", + "markdown": "My ![foo bar](/path/to/train.jpg \"title\" )\n", + "example": 550, + "start_line": 8254 + }, + { + "end_line": 8265, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo]()\n", + "example": 551, + "start_line": 8261 + }, + { + "end_line": 8272, + "section": "Images", + "html": "

    \"\"

    \n", + "markdown": "![](/url)\n", + "example": 552, + "start_line": 8268 + }, + { + "end_line": 8283, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo][bar]\n\n[bar]: /url\n", + "example": 553, + "start_line": 8277 + }, + { + "end_line": 8292, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo][bar]\n\n[BAR]: /url\n", + "example": 554, + "start_line": 8286 + }, + { + "end_line": 8303, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo][]\n\n[foo]: /url \"title\"\n", + "example": 555, + "start_line": 8297 + }, + { + "end_line": 8312, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", + "example": 556, + "start_line": 8306 + }, + { + "end_line": 8323, + "section": "Images", + "html": "

    \"Foo\"

    \n", + "markdown": "![Foo][]\n\n[foo]: /url \"title\"\n", + "example": 557, + "start_line": 8317 + }, + { + "end_line": 8337, + "section": "Images", + "html": "

    \"foo\"\n[]

    \n", + "markdown": "![foo] \n[]\n\n[foo]: /url \"title\"\n", + "example": 558, + "start_line": 8329 + }, + { + "end_line": 8348, + "section": "Images", + "html": "

    \"foo\"

    \n", + "markdown": "![foo]\n\n[foo]: /url \"title\"\n", + "example": 559, + "start_line": 8342 + }, + { + "end_line": 8357, + "section": "Images", + "html": "

    \"foo

    \n", + "markdown": "![*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", + "example": 560, + "start_line": 8351 + }, + { + "end_line": 8369, + "section": "Images", + "html": "

    ![[foo]]

    \n

    [[foo]]: /url "title"

    \n", + "markdown": "![[foo]]\n\n[[foo]]: /url \"title\"\n", + "example": 561, + "start_line": 8362 + }, + { + "end_line": 8380, + "section": "Images", + "html": "

    \"Foo\"

    \n", + "markdown": "![Foo]\n\n[foo]: /url \"title\"\n", + "example": 562, + "start_line": 8374 + }, + { + "end_line": 8392, + "section": "Images", + "html": "

    ![foo]

    \n", + "markdown": "!\\[foo]\n\n[foo]: /url \"title\"\n", + "example": 563, + "start_line": 8386 + }, + { + "end_line": 8404, + "section": "Images", + "html": "

    !foo

    \n", + "markdown": "\\![foo]\n\n[foo]: /url \"title\"\n", + "example": 564, + "start_line": 8398 + }, + { + "end_line": 8435, + "section": "Autolinks", + "html": "

    http://foo.bar.baz

    \n", + "markdown": "\n", + "example": 565, + "start_line": 8431 + }, + { + "end_line": 8442, + "section": "Autolinks", + "html": "

    http://foo.bar.baz/test?q=hello&id=22&boolean

    \n", + "markdown": "\n", + "example": 566, + "start_line": 8438 + }, + { + "end_line": 8449, + "section": "Autolinks", + "html": "

    irc://foo.bar:2233/baz

    \n", + "markdown": "\n", + "example": 567, + "start_line": 8445 + }, + { + "end_line": 8458, + "section": "Autolinks", + "html": "

    MAILTO:FOO@BAR.BAZ

    \n", + "markdown": "\n", + "example": 568, + "start_line": 8454 + }, + { + "end_line": 8470, + "section": "Autolinks", + "html": "

    a+b+c:d

    \n", + "markdown": "\n", + "example": 569, + "start_line": 8466 + }, + { + "end_line": 8477, + "section": "Autolinks", + "html": "

    made-up-scheme://foo,bar

    \n", + "markdown": "\n", + "example": 570, + "start_line": 8473 + }, + { + "end_line": 8484, + "section": "Autolinks", + "html": "

    http://../

    \n", + "markdown": "\n", + "example": 571, + "start_line": 8480 + }, + { + "end_line": 8491, + "section": "Autolinks", + "html": "

    localhost:5001/foo

    \n", + "markdown": "\n", + "example": 572, + "start_line": 8487 + }, + { + "end_line": 8500, + "section": "Autolinks", + "html": "

    <http://foo.bar/baz bim>

    \n", + "markdown": "\n", + "example": 573, + "start_line": 8496 + }, + { + "end_line": 8509, + "section": "Autolinks", + "html": "

    http://example.com/\\[\\

    \n", + "markdown": "\n", + "example": 574, + "start_line": 8505 + }, + { + "end_line": 8531, + "section": "Autolinks", + "html": "

    foo@bar.example.com

    \n", + "markdown": "\n", + "example": 575, + "start_line": 8527 + }, + { + "end_line": 8538, + "section": "Autolinks", + "html": "

    foo+special@Bar.baz-bar0.com

    \n", + "markdown": "\n", + "example": 576, + "start_line": 8534 + }, + { + "end_line": 8547, + "section": "Autolinks", + "html": "

    <foo+@bar.example.com>

    \n", + "markdown": "\n", + "example": 577, + "start_line": 8543 + }, + { + "end_line": 8556, + "section": "Autolinks", + "html": "

    <>

    \n", + "markdown": "<>\n", + "example": 578, + "start_line": 8552 + }, + { + "end_line": 8563, + "section": "Autolinks", + "html": "

    < http://foo.bar >

    \n", + "markdown": "< http://foo.bar >\n", + "example": 579, + "start_line": 8559 + }, + { + "end_line": 8570, + "section": "Autolinks", + "html": "

    <m:abc>

    \n", + "markdown": "\n", + "example": 580, + "start_line": 8566 + }, + { + "end_line": 8577, + "section": "Autolinks", + "html": "

    <foo.bar.baz>

    \n", + "markdown": "\n", + "example": 581, + "start_line": 8573 + }, + { + "end_line": 8584, + "section": "Autolinks", + "html": "

    http://example.com

    \n", + "markdown": "http://example.com\n", + "example": 582, + "start_line": 8580 + }, + { + "end_line": 8591, + "section": "Autolinks", + "html": "

    foo@bar.example.com

    \n", + "markdown": "foo@bar.example.com\n", + "example": 583, + "start_line": 8587 + }, + { + "end_line": 8673, + "section": "Raw HTML", + "html": "

    \n", + "markdown": "\n", + "example": 584, + "start_line": 8669 + }, + { + "end_line": 8682, + "section": "Raw HTML", + "html": "

    \n", + "markdown": "\n", + "example": 585, + "start_line": 8678 + }, + { + "end_line": 8693, + "section": "Raw HTML", + "html": "

    \n", + "markdown": "\n", + "example": 586, + "start_line": 8687 + }, + { + "end_line": 8704, + "section": "Raw HTML", + "html": "

    \n", + "markdown": "\n", + "example": 587, + "start_line": 8698 + }, + { + "end_line": 8713, + "section": "Raw HTML", + "html": "

    Foo

    \n", + "markdown": "Foo \n", + "example": 588, + "start_line": 8709 + }, + { + "end_line": 8722, + "section": "Raw HTML", + "html": "

    <33> <__>

    \n", + "markdown": "<33> <__>\n", + "example": 589, + "start_line": 8718 + }, + { + "end_line": 8731, + "section": "Raw HTML", + "html": "

    <a h*#ref="hi">

    \n", + "markdown": "
    \n", + "example": 590, + "start_line": 8727 + }, + { + "end_line": 8740, + "section": "Raw HTML", + "html": "

    <a href="hi'> <a href=hi'>

    \n", + "markdown": "
    \n", + "example": 591, + "start_line": 8736 + }, + { + "end_line": 8751, + "section": "Raw HTML", + "html": "

    < a><\nfoo><bar/ >

    \n", + "markdown": "< a><\nfoo>\n", + "example": 592, + "start_line": 8745 + }, + { + "end_line": 8760, + "section": "Raw HTML", + "html": "

    <a href='bar'title=title>

    \n", + "markdown": "
    \n", + "example": 593, + "start_line": 8756 + }, + { + "end_line": 8769, + "section": "Raw HTML", + "html": "

    \n", + "markdown": "\n", + "example": 594, + "start_line": 8765 + }, + { + "end_line": 8778, + "section": "Raw HTML", + "html": "

    </a href="foo">

    \n", + "markdown": "\n", + "example": 595, + "start_line": 8774 + }, + { + "end_line": 8789, + "section": "Raw HTML", + "html": "

    foo

    \n", + "markdown": "foo \n", + "example": 596, + "start_line": 8783 + }, + { + "end_line": 8796, + "section": "Raw HTML", + "html": "

    foo <!-- not a comment -- two hyphens -->

    \n", + "markdown": "foo \n", + "example": 597, + "start_line": 8792 + }, + { + "end_line": 8808, + "section": "Raw HTML", + "html": "

    foo <!--> foo -->

    \n

    foo <!-- foo--->

    \n", + "markdown": "foo foo -->\n\nfoo \n", + "example": 598, + "start_line": 8801 + }, + { + "end_line": 8817, + "section": "Raw HTML", + "html": "

    foo

    \n", + "markdown": "foo \n", + "example": 599, + "start_line": 8813 + }, + { + "end_line": 8826, + "section": "Raw HTML", + "html": "

    foo

    \n", + "markdown": "foo \n", + "example": 600, + "start_line": 8822 + }, + { + "end_line": 8835, + "section": "Raw HTML", + "html": "

    foo &<]]>

    \n", + "markdown": "foo &<]]>\n", + "example": 601, + "start_line": 8831 + }, + { + "end_line": 8845, + "section": "Raw HTML", + "html": "

    foo

    \n", + "markdown": "foo \n", + "example": 602, + "start_line": 8841 + }, + { + "end_line": 8854, + "section": "Raw HTML", + "html": "

    foo

    \n", + "markdown": "foo \n", + "example": 603, + "start_line": 8850 + }, + { + "end_line": 8861, + "section": "Raw HTML", + "html": "

    <a href=""">

    \n", + "markdown": "
    \n", + "example": 604, + "start_line": 8857 + }, + { + "end_line": 8877, + "section": "Hard line breaks", + "html": "

    foo
    \nbaz

    \n", + "markdown": "foo \nbaz\n", + "example": 605, + "start_line": 8871 + }, + { + "end_line": 8889, + "section": "Hard line breaks", + "html": "

    foo
    \nbaz

    \n", + "markdown": "foo\\\nbaz\n", + "example": 606, + "start_line": 8883 + }, + { + "end_line": 8900, + "section": "Hard line breaks", + "html": "

    foo
    \nbaz

    \n", + "markdown": "foo \nbaz\n", + "example": 607, + "start_line": 8894 + }, + { + "end_line": 8911, + "section": "Hard line breaks", + "html": "

    foo
    \nbar

    \n", + "markdown": "foo \n bar\n", + "example": 608, + "start_line": 8905 + }, + { + "end_line": 8920, + "section": "Hard line breaks", + "html": "

    foo
    \nbar

    \n", + "markdown": "foo\\\n bar\n", + "example": 609, + "start_line": 8914 + }, + { + "end_line": 8932, + "section": "Hard line breaks", + "html": "

    foo
    \nbar

    \n", + "markdown": "*foo \nbar*\n", + "example": 610, + "start_line": 8926 + }, + { + "end_line": 8941, + "section": "Hard line breaks", + "html": "

    foo
    \nbar

    \n", + "markdown": "*foo\\\nbar*\n", + "example": 611, + "start_line": 8935 + }, + { + "end_line": 8951, + "section": "Hard line breaks", + "html": "

    code span

    \n", + "markdown": "`code \nspan`\n", + "example": 612, + "start_line": 8946 + }, + { + "end_line": 8959, + "section": "Hard line breaks", + "html": "

    code\\ span

    \n", + "markdown": "`code\\\nspan`\n", + "example": 613, + "start_line": 8954 + }, + { + "end_line": 8970, + "section": "Hard line breaks", + "html": "

    \n", + "markdown": "\n", + "example": 614, + "start_line": 8964 + }, + { + "end_line": 8979, + "section": "Hard line breaks", + "html": "

    \n", + "markdown": "\n", + "example": 615, + "start_line": 8973 + }, + { + "end_line": 8990, + "section": "Hard line breaks", + "html": "

    foo\\

    \n", + "markdown": "foo\\\n", + "example": 616, + "start_line": 8986 + }, + { + "end_line": 8997, + "section": "Hard line breaks", + "html": "

    foo

    \n", + "markdown": "foo \n", + "example": 617, + "start_line": 8993 + }, + { + "end_line": 9004, + "section": "Hard line breaks", + "html": "

    foo\\

    \n", + "markdown": "### foo\\\n", + "example": 618, + "start_line": 9000 + }, + { + "end_line": 9011, + "section": "Hard line breaks", + "html": "

    foo

    \n", + "markdown": "### foo \n", + "example": 619, + "start_line": 9007 + }, + { + "end_line": 9028, + "section": "Soft line breaks", + "html": "

    foo\nbaz

    \n", + "markdown": "foo\nbaz\n", + "example": 620, + "start_line": 9022 + }, + { + "end_line": 9040, + "section": "Soft line breaks", + "html": "

    foo\nbaz

    \n", + "markdown": "foo \n baz\n", + "example": 621, + "start_line": 9034 + }, + { + "end_line": 9058, + "section": "Textual content", + "html": "

    hello $.;'there

    \n", + "markdown": "hello $.;'there\n", + "example": 622, + "start_line": 9054 + }, + { + "end_line": 9065, + "section": "Textual content", + "html": "

    Foo χρῆν

    \n", + "markdown": "Foo χρῆν\n", + "example": 623, + "start_line": 9061 + }, + { + "end_line": 9074, + "section": "Textual content", + "html": "

    Multiple spaces

    \n", + "markdown": "Multiple spaces\n", + "example": 624, + "start_line": 9070 + } +] \ No newline at end of file diff --git a/test/integration/marked-spec.js b/test/integration/marked-spec.js index c2c8955f..607ecb15 100644 --- a/test/integration/marked-spec.js +++ b/test/integration/marked-spec.js @@ -1,17 +1,451 @@ -var marked = require('../../marked.min.js'); +var marked = require('../../lib/marked.js'); +var cmSpec = require('./commonmark.json'); +var HtmlDiffer = require('html-differ').HtmlDiffer, + htmlDiffer = new HtmlDiffer(); +var since = require('jasmine2-custom-message'); -it('should run the test', function () { - expect(marked('Hello World!')).toBe('

    Hello World!

    \n'); +var Messenger = function() {} + +Messenger.prototype.message = function(spec, expected, actual) { + return 'CommonMark (' + spec.section + '):\n' + spec.markdown + '\n------\n\nExpected:\n' + expected + '\n------\n\nMarked:\n' + actual; +} + +Messenger.prototype.test = function(spec, section, ignore) { + if (spec.section === section && ignore.indexOf(spec.example) < 0) { + it('should pass example ' + spec.example, function() { + var expected = spec.html; + var actual = marked(spec.markdown, { headerIds: false, xhtml: true }); + since(messenger.message(spec, expected, actual)).expect( + htmlDiffer.isEqual(expected, actual) + ).toEqual(true); + }); + } +} + +var messenger = new Messenger(); +/* +|Section |Count |Percent | +|:---------------------------|:-------:|---------:| +|Tabs |7 of 11 |63% | +|Thematic breaks |16 of 19 |84% | +|ATX headings |13 of 18 |72% | +|Setext headings |20 of 26 |77% | +|Indented code blocks |11 of 12 |92% | +|Fenced code blocks |17 of 28 |61% | +|HTML blocks |12 of 43 |28% | +|Link reference definitions |21 of 23 |91% | +|Paragraphs |6 of 8 |75% | +|Block quotes |21 of 25 |84% | +|List items |32 of 48 |67% | +|Lists |10 of 24 |42% | +|Backslash escapes |4 of 13 |31% | +|Entity and numeric character references|8 of 12|67%| +|Code spans |10 of 17 |59% | +|Emphasis and strong emphasis|62 of 128|48% | +|Links |46 of 84 |55% | +|Images |13 of 22 |59% | +|Autolinks |14 of 19 |74% | +|Hard line breaks |32 of 36 |89% | +|Soft line breaks |1 of 2 |50% | +*/ + +describe('CommonMark 0.28 Tabs', function() { + var section = 'Tabs'; + + // These examples probably should pass but don't for some reason. + // This is the easiest way to demonstrate limitations or defects + // within Marked. Toggle comments for next two lines to see which examples + // are known failures. Note: If all arrays are empty, it means Marked is + // 100% compliant with that section of the given specification. + // + // var shouldPassButFails = []; + var shouldPassButFails = [1, 2, 3, 7]; + + // Identifies examples that the Marked core team has determined beyond + // the ability or desire to correct; thereby, implicitly requesting + // outside help and assistance. + var willNotBeAttemptedByCoreTeam = []; + + // Combine known failures and skips. + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + // Run test. + messenger.test(spec, section, ignore); + }); }); -// http://spec.commonmark.org/0.28/#example-230 -it('should start an ordered list at 0 when requested', function () { - expect(marked('0. ok')) - .toBe('
      \n
    1. ok
    2. \n
    \n') +describe('CommonMark 0.28 Precedence', function() { + var section = 'Precedence'; + + // var shouldPassButFails = []; + var shouldPassButFails = []; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); }); -// http://spec.commonmark.org/0.28/#example-234 -it('indents code within an explicitly-started ordered list', function () { - expect(marked(' 10. foo\n\n bar')) - .toBe('
      \n
    1. foo

      \n
      bar\n
    2. \n
    \n'); +describe('CommonMark 0.28 Thematic breaks', function() { + var section = 'Thematic breaks'; + + // var shouldPassButFails = []; + var shouldPassButFails = [19]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 ATX headings', function() { + var section = 'ATX headings'; + + // var shouldPassButFails = []; + var shouldPassButFails = [40, 45, 46, 49]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Setext headings', function() { + var section = 'Setext headings'; + + // var shouldPassButFails = []; + var shouldPassButFails = [51, 52, 56, 62, 64]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Indented code blocks', function() { + var section = 'Indented code blocks'; + + // var shouldPassButFails = []; + var shouldPassButFails = [82]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Fenced code blocks', function() { + var section = 'Fenced code blocks'; + + // var shouldPassButFails = []; + var shouldPassButFails = [93, 95, 96, 97, 101, 102, 106, 108, 111, 112, 113]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 HTML blocks', function() { + var section = 'HTML blocks'; + + // var shouldPassButFails = []; + var shouldPassButFails = [132, 126, 147, 121, 124, 120, 153, 133, 119, 127, 117, 118, 141, 116, 158, 122, 123, 128, 143, 130, 136, 137, 140, 125, 134, 131, 144, 145, 146, 148, 139, 149, 129, 156, 135, 138, 142, 150, 151, 152, 154, 155, 157]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Link reference definitions', function() { + var section = 'Link reference definitions'; + + // var shouldPassButFails = []; + var shouldPassButFails = [167, 171]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Paragraphs', function() { + var section = 'Paragraphs'; + + // var shouldPassButFails = []; + var shouldPassButFails = [185, 186]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Blank lines', function() { + var section = 'Blank lines'; + + // var shouldPassButFails = []; + var shouldPassButFails = []; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Block quotes', function() { + var section = 'Block quotes'; + + // var shouldPassButFails = []; + var shouldPassButFails = [198, 199, 200, 201]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 List items', function() { + var section = 'List items'; + + // var shouldPassButFails = []; + var shouldPassButFails = [229, 237, 236, 227, 218, 243, 259, 241, 239, 247, 246, 225, 220, 258, 260, 244]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Lists', function() { + var section = 'Lists'; + + // var shouldPassButFails = []; + var shouldPassButFails = [282, 270, 280, 278, 271, 272, 273, 275, 274, 264, 277, 265, 276, 279, 267, 269]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Inlines', function() { + var section = 'Inlines'; + + // var shouldPassButFails = []; + var shouldPassButFails = []; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Backslash escapes', function() { + var section = 'Backslash escapes'; + + // var shouldPassButFails = []; + var shouldPassButFails = [290, 291, 289, 293, 297, 301, 299, 298, 300]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Entity and numeric character references', function() { + var section = 'Entity and numeric character references'; + + // var shouldPassButFails = []; + var shouldPassButFails = [311, 309, 310, 308]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Code spans', function() { + var section = 'Code spans'; + + // var shouldPassButFails = []; + var shouldPassButFails = [330, 316, 325, 327, 328, 320, 323, 322]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Emphasis and strong emphasis', function() { + var section = 'Emphasis and strong emphasis'; + + // var shouldPassButFails = []; + var shouldPassButFails = [333, 334, 342, 348, 349, 352, 353, 354, 355, 356, 360, 368, 369, 371, 372, 378, 380, 381, 382, 387, 388, 392, 393, 394, 395, 396, 402, 403, 409, 416, 419, 420, 421, 422, 423, 424, 428, 431, 432, 433, 434, 435, 436, 443, 444, 445, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Links', function() { + var section = 'Links'; + + // var shouldPassButFails = []; + var shouldPassButFails = [499, 489, 471, 484, 466, 483, 535, 476, 474, 508, 468, 523, 527, 475, 467, 509, 539, 464, 497, 473, 507, 463, 492, 478, 504, 514, 479, 491, 512, 477, 503, 513, 496, 470, 495, 505, 490, 469, 465]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Images', function() { + var section = 'Images'; + + // var shouldPassButFails = []; + var shouldPassButFails = [556, 465, 548, 545, 544, 546, 558, 547, 560]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Autolinks', function() { + var section = 'Autolinks'; + + // var shouldPassButFails = []; + var shouldPassButFails = [582, 574, 573, 579, 583]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Raw HTML', function() { + var section = 'Raw HTML'; + + // var shouldPassButFails = []; + var shouldPassButFails = [584, 585, 586, 587, 588, 590, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Hard line breaks', function() { + var section = 'Hard line breaks'; + + // var shouldPassButFails = []; + var shouldPassButFails = [611, 606, 609, 613, 614, 615]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Soft line breaks', function() { + var section = 'Soft line breaks'; + + // var shouldPassButFails = []; + var shouldPassButFails = [621]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('CommonMark 0.28 Textual content', function() { + var section = 'Textual content'; + + // var shouldPassButFails = []; + var shouldPassButFails = []; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + cmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); }); From 017b7cc2896d665c6c332d69aa041dc072f127ab Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 5 Apr 2018 17:15:11 -0400 Subject: [PATCH 379/459] Update readme with emoji --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 70e325bf..8b155355 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,18 @@ + + # Marked -Marked is - -1. built for speed. -2. a low-level markdown compiler for parsing markdown without caching or blocking for long periods of time. -3. light-weight while implementing all markdown features from the supported flavors & specifications. -4. available as a command line interface (CLI) and running in client- or server-side JavaScript projects. +- ⚡ built for speed +- ⬇️ low-level markdown compiler for parsing markdown without caching or blocking for long periods of time +- ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications +- 🌐 works in the browser, on the server, or on the command line interface (CLI) ## Demo Checkout the [demo page](https://marked.js.org/demo/) to see marked in action ⛹️ +## Docs + Our [documentation pages](https://marked.js.org) are also rendered using marked 💯 ## Installation From f30fee56defede20be0a38aa7fafee65d36b6109 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 5 Apr 2018 17:18:10 -0400 Subject: [PATCH 380/459] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b155355..8b21b13b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # Marked - ⚡ built for speed -- ⬇️ low-level markdown compiler for parsing markdown without caching or blocking for long periods of time +- ⬇️ low-level markdown compiler for parsing without caching or blocking for long periods of time - ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications - 🌐 works in the browser, on the server, or on the command line interface (CLI) From 87285b6eb7c015be44ee32d5f2dfd9ac702839d3 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 5 Apr 2018 20:47:03 -0400 Subject: [PATCH 381/459] Decrease size of logo --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b21b13b..f29866b0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ - +
    + + # Marked From 0d6c24f8afe069d257b272e2548ae3e33224382a Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 6 Apr 2018 15:21:20 -0400 Subject: [PATCH 382/459] Change to "from" the command line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f29866b0..e4be9ed3 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - ⚡ built for speed - ⬇️ low-level markdown compiler for parsing without caching or blocking for long periods of time - ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications -- 🌐 works in the browser, on the server, or on the command line interface (CLI) +- 🌐 works in the browser, on the server, or from the command line interface (CLI) ## Demo From 586bb2dc7b16b6b081116e1a6c811219bdc456e2 Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 6 Apr 2018 16:12:17 -0400 Subject: [PATCH 383/459] Change "the" to "a" --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e4be9ed3..88ec1511 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ # Marked - ⚡ built for speed -- ⬇️ low-level markdown compiler for parsing without caching or blocking for long periods of time +- ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time - ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications -- 🌐 works in the browser, on the server, or from the command line interface (CLI) +- 🌐 works in a browser, on a server, or from a command line interface (CLI) ## Demo From 19b53737012a312306024eaecd7fffac2652d1c2 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 9 Apr 2018 10:28:43 -0400 Subject: [PATCH 384/459] Test spec --- .../integration/github_flavored_markdown.json | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 test/integration/github_flavored_markdown.json diff --git a/test/integration/github_flavored_markdown.json b/test/integration/github_flavored_markdown.json new file mode 100644 index 00000000..018ec23d --- /dev/null +++ b/test/integration/github_flavored_markdown.json @@ -0,0 +1,152 @@ +[ + { + "section": "Tables", + "html": "\n\n\n\n\n\n\n\n\n\n\n
    foobar
    bazbim
    ", + "markdown": "| foo | bar |\n| --- | --- |\n| baz | bim |", + "example": 191 + }, + { + "section": "Tables", + "html": "\n\n\n\n\n\n\n\n\n\n\n
    abcdefghi
    barbaz
    ", + "markdown": "| abc | defghi |\n:-: | -----------:\nbar | baz", + "example": 192 + }, + { + "section": "Tables", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
    f|oo
    b | az
    b | im
    ", + "markdown": "| f\|oo |\n| ------ |\n| b `\|` az |\n| b **\|** im |", + "example": 193 + }, + { + "section": "Tables", + "html": "\n\n\n\n\n\n\n\n\n\n\n
    abcdef
    barbaz
    \n
    \n

    bar

    \n
    ", + "markdown": "| abc | def |\n| --- | --- |\n| bar | baz |\n> bar", + "example": 194 + }, + { + "section": "Tables", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    abcdef
    barbaz
    bar
    \n

    bar

    ", + "markdown": "| abc | def |\n| --- | --- |\n| bar | baz |\nbar\n\nbar", + "example": 195 + }, + { + "section": "Tables", + "html": "

    | abc | def |\n| --- |\n| bar |

    ", + "markdown": "| abc | def |\n| --- |\n| bar |", + "example": 196 + }, + { + "section": "Tables", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
    abcdef
    bar
    barbaz
    ", + "markdown": "| abc | def |\n| --- | --- |\n| bar |\n| bar | baz | boo |", + "example": 197 + }, + { + "section": "Tables", + "html": "\n\n\n\n\n\n
    abcdef
    ", + "markdown": "| abc | def |\n| --- | --- |", + "example": 197 + }, + { + "section": "Task list items", + "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    ", + "markdown": "- [ ] foo\n- [x] bar", + "example": 272 + }, + { + "section": "Task list items", + "html": "
      \n
    • foo\n
        \n
      • bar
      • \n
      • baz
      • \n
      \n
    • \n
    • bim
    • \n
    ", + "markdown": "- [x] foo\n - [ ] bar\n - [x] baz\n- [ ] bim", + "example": 273 + }, + { + "section": "Strikethrough", + "html": "

    Hi Hello, world!

    ", + "markdown": "~Hi~ Hello, world!", + "example": 469 + }, + { + "section": "Strikethrough", + "html": "

    This text is curious.

    ", + "markdown": "This ~text~~~~ is ~~~~curious~.", + "example": 470 + }, + { + "section": "Strikethrough", + "html": "

    This ~~has a

    \n

    new paragraph~~.

    ", + "markdown": "This ~~has a\n\nnew paragraph~~.", + "example": 471 + }, + { + "section": "Autolinks", + "html": "

    www.commonmark.org

    ", + "markdown": "www.commonmark.org", + "example": 597 + }, + { + "section": "Autolinks", + "html": "

    Visit www.commonmark.org/help for more information.

    ", + "markdown": "Visit www.commonmark.org/help for more information.", + "example": 598 + }, + { + "section": "Autolinks", + "html": "

    Visit www.commonmark.org.

    \n

    Visit www.commonmark.org/a.b.

    ", + "markdown": "Visit www.commonmark.org.\n\nVisit www.commonmark.org/a.b.", + "example": 599 + }, + { + "section": "Autolinks", + "html": "

    www.google.com/search?q=Markup+(business)

    \n

    (www.google.com/search?q=Markup+(business))

    ", + "markdown": "www.google.com/search?q=Markup+(business)\n\n(www.google.com/search?q=Markup+(business))", + "example": 600 + }, + { + "section": "Autolinks", + "html": "

    www.google.com/search?q=(business))+ok

    ", + "markdown": "www.google.com/search?q=(business))+ok", + "example": 601 + }, + { + "section": "Autolinks", + "html": "

    www.google.com/search?q=commonmark&hl=en

    \n

    www.google.com/search?q=commonmark&hl;

    ", + "markdown": "www.google.com/search?q=commonmark&hl=en\n\nwww.google.com/search?q=commonmark&hl;", + "example": 602 + }, + { + "section": "Autolinks", + "html": "

    www.commonmark.org/he<lp

    ", + "markdown": "www.commonmark.org/hehttp://commonmark.org

    \n

    (Visit https://encrypted.google.com/search?q=Markup+(business))

    \n

    Anonymous FTP is available at ftp://foo.bar.baz.

    ", + "markdown": "http://commonmark.org\n\n(Visit https://encrypted.google.com/search?q=Markup+(business))\n\nAnonymous FTP is available at ftp://foo.bar.baz.", + "example": 604 + }, + { + "section": "Autolinks", + "html": "

    foo@bar.baz

    ", + "markdown": "foo@bar.baz", + "example": 605 + }, + { + "section": "Autolinks", + "html": "

    hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is.

    ", + "markdown": "hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is.", + "example": 606 + }, + { + "section": "Autolinks", + "html": "

    a.b-c_d@a.b

    \n

    a.b-c_d@a.b.

    \n

    a.b-c_d@a.b-

    \n

    a.b-c_d@a.b_

    ", + "markdown": "a.b-c_d@a.b\n\na.b-c_d@a.b.\n\na.b-c_d@a.b-\n\na.b-c_d@a.b_", + "example": 607 + }, + { + "section": "Disallowed Raw HTML", + "html": "

    <title> <style>

    \n
    \n <xmp> is disallowed. <XMP> is also disallowed.\n
    ", + "markdown": " <style> <em>\n\n<blockquote>\n <xmp> is disallowed. <XMP> is also disallowed.\n</blockquote>", + "example": 629 + } +] From b2dd82aad3aeb9caad696d46ce37a876e85d3883 Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@joshbruce.com> Date: Mon, 9 Apr 2018 10:38:16 -0400 Subject: [PATCH 385/459] Initial pass --- .../integration/github_flavored_markdown.json | 2 +- test/integration/marked-spec.js | 72 +++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/test/integration/github_flavored_markdown.json b/test/integration/github_flavored_markdown.json index 018ec23d..87d12d35 100644 --- a/test/integration/github_flavored_markdown.json +++ b/test/integration/github_flavored_markdown.json @@ -14,7 +14,7 @@ { "section": "Tables", "html": "<table>\n<thead>\n<tr>\n<th>f|oo</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>b <code>|</code> az</td>\n</tr>\n<tr>\n<td>b <strong>|</strong> im</td>\n</tr></tbody></table>", - "markdown": "| f\|oo |\n| ------ |\n| b `\|` az |\n| b **\|** im |", + "markdown": "| f\\|oo |\n| ------ |\n| b `\\|` az |\n| b **\\|** im |", "example": 193 }, { diff --git a/test/integration/marked-spec.js b/test/integration/marked-spec.js index 607ecb15..44aabf36 100644 --- a/test/integration/marked-spec.js +++ b/test/integration/marked-spec.js @@ -1,5 +1,6 @@ var marked = require('../../lib/marked.js'); var cmSpec = require('./commonmark.json'); +var gfmSpec = require('./github_flavored_markdown.json') var HtmlDiffer = require('html-differ').HtmlDiffer, htmlDiffer = new HtmlDiffer(); var since = require('jasmine2-custom-message'); @@ -449,3 +450,74 @@ describe('CommonMark 0.28 Textual content', function() { messenger.test(spec, section, ignore); }); }); + +describe('GFM 0.28 Tables', function() { + var section = 'Tables'; + + // TODO: Verify exmaple 193 is valid and passing + var shouldPassButFails = [192, 193, 195, 196, 197]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('GFM 0.28 Task list items', function() { + var section = 'Task list items'; + + var shouldPassButFails = [272, 273]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('GFM 0.28 Strikethrough', function() { + var section = 'Strikethrough'; + + var shouldPassButFails = [469, 470]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('GFM 0.28 Autolinks', function() { + var section = 'Autolinks'; + + var shouldPassButFails = [607]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('GFM 0.28 Disallowed Raw HTML', function() { + var section = 'Disallowed Raw HTML'; + + var shouldPassButFails = [629]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); From 4aa4f02e1cc2503485d6070445d2cd64ebd5c5df Mon Sep 17 00:00:00 2001 From: Federico Soave <fede.covr@gmail.com> Date: Mon, 9 Apr 2018 21:22:53 +0200 Subject: [PATCH 386/459] re-enable passing commonmark tests --- test/integration/marked-spec.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test/integration/marked-spec.js b/test/integration/marked-spec.js index 607ecb15..5dd236d7 100644 --- a/test/integration/marked-spec.js +++ b/test/integration/marked-spec.js @@ -168,8 +168,7 @@ describe('CommonMark 0.28 Fenced code blocks', function() { describe('CommonMark 0.28 HTML blocks', function() { var section = 'HTML blocks'; - // var shouldPassButFails = []; - var shouldPassButFails = [132, 126, 147, 121, 124, 120, 153, 133, 119, 127, 117, 118, 141, 116, 158, 122, 123, 128, 143, 130, 136, 137, 140, 125, 134, 131, 144, 145, 146, 148, 139, 149, 129, 156, 135, 138, 142, 150, 151, 152, 154, 155, 157]; + var shouldPassButFails = []; var willNotBeAttemptedByCoreTeam = []; @@ -184,7 +183,7 @@ describe('CommonMark 0.28 Link reference definitions', function() { var section = 'Link reference definitions'; // var shouldPassButFails = []; - var shouldPassButFails = [167, 171]; + var shouldPassButFails = [167]; var willNotBeAttemptedByCoreTeam = []; @@ -289,7 +288,7 @@ describe('CommonMark 0.28 Backslash escapes', function() { var section = 'Backslash escapes'; // var shouldPassButFails = []; - var shouldPassButFails = [290, 291, 289, 293, 297, 301, 299, 298, 300]; + var shouldPassButFails = [290, 291, 293, 300, 301]; var willNotBeAttemptedByCoreTeam = []; @@ -304,7 +303,7 @@ describe('CommonMark 0.28 Entity and numeric character references', function() { var section = 'Entity and numeric character references'; // var shouldPassButFails = []; - var shouldPassButFails = [311, 309, 310, 308]; + var shouldPassButFails = [311, 309, 310]; var willNotBeAttemptedByCoreTeam = []; @@ -349,7 +348,7 @@ describe('CommonMark 0.28 Links', function() { var section = 'Links'; // var shouldPassButFails = []; - var shouldPassButFails = [499, 489, 471, 484, 466, 483, 535, 476, 474, 508, 468, 523, 527, 475, 467, 509, 539, 464, 497, 473, 507, 463, 492, 478, 504, 514, 479, 491, 512, 477, 503, 513, 496, 470, 495, 505, 490, 469, 465]; + var shouldPassButFails = [468, 474, 478, 483, 489, 490, 491, 492, 495, 496, 497, 499, 503, 504, 505, 507, 508, 509, 523, 535] var willNotBeAttemptedByCoreTeam = []; @@ -364,7 +363,7 @@ describe('CommonMark 0.28 Images', function() { var section = 'Images'; // var shouldPassButFails = []; - var shouldPassButFails = [556, 465, 548, 545, 544, 546, 558, 547, 560]; + var shouldPassButFails = [544, 545, 546, 547, 548, 556, 560]; var willNotBeAttemptedByCoreTeam = []; @@ -394,7 +393,7 @@ describe('CommonMark 0.28 Raw HTML', function() { var section = 'Raw HTML'; // var shouldPassButFails = []; - var shouldPassButFails = [584, 585, 586, 587, 588, 590, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604]; + var shouldPassButFails = [597, 598]; var willNotBeAttemptedByCoreTeam = []; From bc7c9dbfb3182f5dcaa42907304f9ce61a684c77 Mon Sep 17 00:00:00 2001 From: Federico Soave <fede.covr@gmail.com> Date: Tue, 10 Apr 2018 01:16:14 +0200 Subject: [PATCH 387/459] do not allow newlines inside html attributes, make cm test 60 pass --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index dbc1f6a0..25cef9ef 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -66,7 +66,7 @@ block._comment = /<!--(?!-?>)[\s\S]*?-->/; block.html = edit(block.html, 'i') .replace('comment', block._comment) .replace('tag', block._tag) - .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"]*"| *= *'[^']*'| *= *[^\s"'=<>`]+)?/) + .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) .getRegex(); block.paragraph = edit(block.paragraph) From d94a68caf840ba37ad36a505eb54dad32b3b1715 Mon Sep 17 00:00:00 2001 From: Federico Soave <fede.covr@gmail.com> Date: Tue, 10 Apr 2018 01:17:50 +0200 Subject: [PATCH 388/459] do not randomize jasmine tests (different spec files interfered with each other) --- jasmine.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jasmine.json b/jasmine.json index 8d1be919..66b7979b 100644 --- a/jasmine.json +++ b/jasmine.json @@ -7,5 +7,5 @@ "helpers/**/*.js" ], "stopSpecOnExpectationFailure": false, - "random": true + "random": false } From ae8f612de5a4165906983d6a6f38c9ce023ef27d Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 9 Apr 2018 21:45:24 -0500 Subject: [PATCH 389/459] add marked.origDefaults --- lib/marked.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/marked.js b/lib/marked.js index b56ad176..9d3b0a90 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1365,6 +1365,11 @@ marked.defaults = { xhtml: false }; +marked.origDefaults = {}; +for (var opt in marked.defaults) { + marked.origDefaults[opt] = marked.defaults[opt]; +} + /** * Expose */ From 1e0e4dccd4abdf4f2dd02932f4f04d7c8455b723 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 9 Apr 2018 21:45:37 -0500 Subject: [PATCH 390/459] reset defaults in beforeEach --- test/helpers/helpers.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/helpers/helpers.js diff --git a/test/helpers/helpers.js b/test/helpers/helpers.js new file mode 100644 index 00000000..fb14a458 --- /dev/null +++ b/test/helpers/helpers.js @@ -0,0 +1,5 @@ +var marked = require('../../lib/marked.js'); + +beforeEach(function () { + marked.setOptions(marked.origDefaults); +}); From b858452c9c3754bbc59220a777b3cfa661483dfa Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Tue, 10 Apr 2018 07:53:59 -0500 Subject: [PATCH 391/459] use getDefaults --- lib/marked.js | 50 +++++++++++++++++++++++------------------ test/helpers/helpers.js | 2 +- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 9d3b0a90..679c0cb0 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1345,31 +1345,37 @@ marked.setOptions = function(opt) { return marked; }; -marked.defaults = { - baseUrl: null, - breaks: false, - gfm: true, - headerIds: true, - headerPrefix: '', - highlight: null, - langPrefix: 'lang-', - mangle: true, - pedantic: false, - renderer: new Renderer(), - sanitize: false, - sanitizer: null, - silent: false, - smartLists: false, - smartypants: false, - tables: true, - xhtml: false -}; +marked.getDefaults = function () { + var defaults = { + baseUrl: null, + breaks: false, + gfm: true, + headerIds: true, + headerPrefix: '', + highlight: null, + langPrefix: 'lang-', + mangle: true, + pedantic: false, + renderer: new Renderer(), + sanitize: false, + sanitizer: null, + silent: false, + smartLists: false, + smartypants: false, + tables: true, + xhtml: false + }; -marked.origDefaults = {}; -for (var opt in marked.defaults) { - marked.origDefaults[opt] = marked.defaults[opt]; + var clone = {}; + for (var opt in defaults) { + clone[opt] = defaults[opt]; + } + + return clone; } +marked.defaults = marked.getDefaults(); + /** * Expose */ diff --git a/test/helpers/helpers.js b/test/helpers/helpers.js index fb14a458..d9244a88 100644 --- a/test/helpers/helpers.js +++ b/test/helpers/helpers.js @@ -1,5 +1,5 @@ var marked = require('../../lib/marked.js'); beforeEach(function () { - marked.setOptions(marked.origDefaults); + marked.setOptions(marked.getDefaults()); }); From 416e098559e339ff8e6ddee04d6ef76fb10f751a Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@joshbruce.com> Date: Tue, 10 Apr 2018 09:17:32 -0400 Subject: [PATCH 392/459] Use directory for tests --- package.json | 1 + test/specs/gfm/gfm-spec.js | 97 +++++++++++++++++++ .../gfm/gfm.0.28.json} | 0 3 files changed, 98 insertions(+) create mode 100644 test/specs/gfm/gfm-spec.js rename test/{integration/github_flavored_markdown.json => specs/gfm/gfm.0.28.json} (100%) diff --git a/package.json b/package.json index 02677295..0afc5e73 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "test": "jasmine --config=jasmine.json", "test:unit": "npm test -- test/unit/**/*-spec.js", "test:specs": "npm test -- test/specs/**/*-spec.js", + "test:gfm": "npm test -- test/specs/gfm/**/*-spec.js", "test:integration": "npm test -- test/integration/**/*-spec.js", "test:old": "node test", "test:lint": "eslint bin/marked .", diff --git a/test/specs/gfm/gfm-spec.js b/test/specs/gfm/gfm-spec.js new file mode 100644 index 00000000..a91b5396 --- /dev/null +++ b/test/specs/gfm/gfm-spec.js @@ -0,0 +1,97 @@ +var marked = require('../../../lib/marked.js'); +var gfmSpec = require('./gfm.0.28.json') +var HtmlDiffer = require('html-differ').HtmlDiffer, + htmlDiffer = new HtmlDiffer(); +var since = require('jasmine2-custom-message'); + +var Messenger = function() {} + +Messenger.prototype.message = function(spec, expected, actual) { + return 'CommonMark (' + spec.section + '):\n' + spec.markdown + '\n------\n\nExpected:\n' + expected + '\n------\n\nMarked:\n' + actual; +} + +Messenger.prototype.test = function(spec, section, ignore) { + if (spec.section === section && ignore.indexOf(spec.example) < 0) { + var shouldFail = ~ignore.indexOf(spec.example); + it('should ' + (shouldFail ? 'fail' : 'pass') + ' example ' + spec.example, function() { + var expected = spec.html; + var actual = marked(spec.markdown, { headerIds: false, xhtml: true }); + since(messenger.message(spec, expected, actual)).expect( + htmlDiffer.isEqual(expected, actual) + ).toEqual(!shouldFail); + }); + } +} + +var messenger = new Messenger(); + +describe('GFM 0.28 Tables', function() { + var section = 'Tables'; + + // TODO: Verify exmaple 193 is valid and passing + var shouldPassButFails = [192, 193, 195, 196, 197]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('GFM 0.28 Task list items', function() { + var section = 'Task list items'; + + var shouldPassButFails = [272, 273]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('GFM 0.28 Strikethrough', function() { + var section = 'Strikethrough'; + + var shouldPassButFails = [469, 470]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('GFM 0.28 Autolinks', function() { + var section = 'Autolinks'; + + var shouldPassButFails = [607]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); + +describe('GFM 0.28 Disallowed Raw HTML', function() { + var section = 'Disallowed Raw HTML'; + + var shouldPassButFails = [629]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + gfmSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); diff --git a/test/integration/github_flavored_markdown.json b/test/specs/gfm/gfm.0.28.json similarity index 100% rename from test/integration/github_flavored_markdown.json rename to test/specs/gfm/gfm.0.28.json From 818a071a286910f2bb9ab9cc2b44c0babdd369cc Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@joshbruce.com> Date: Tue, 10 Apr 2018 09:20:54 -0400 Subject: [PATCH 393/459] Remove GFM reference --- test/integration/marked-spec.js | 72 --------------------------------- 1 file changed, 72 deletions(-) diff --git a/test/integration/marked-spec.js b/test/integration/marked-spec.js index 44aabf36..607ecb15 100644 --- a/test/integration/marked-spec.js +++ b/test/integration/marked-spec.js @@ -1,6 +1,5 @@ var marked = require('../../lib/marked.js'); var cmSpec = require('./commonmark.json'); -var gfmSpec = require('./github_flavored_markdown.json') var HtmlDiffer = require('html-differ').HtmlDiffer, htmlDiffer = new HtmlDiffer(); var since = require('jasmine2-custom-message'); @@ -450,74 +449,3 @@ describe('CommonMark 0.28 Textual content', function() { messenger.test(spec, section, ignore); }); }); - -describe('GFM 0.28 Tables', function() { - var section = 'Tables'; - - // TODO: Verify exmaple 193 is valid and passing - var shouldPassButFails = [192, 193, 195, 196, 197]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - gfmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('GFM 0.28 Task list items', function() { - var section = 'Task list items'; - - var shouldPassButFails = [272, 273]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - gfmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('GFM 0.28 Strikethrough', function() { - var section = 'Strikethrough'; - - var shouldPassButFails = [469, 470]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - gfmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('GFM 0.28 Autolinks', function() { - var section = 'Autolinks'; - - var shouldPassButFails = [607]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - gfmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); - -describe('GFM 0.28 Disallowed Raw HTML', function() { - var section = 'Disallowed Raw HTML'; - - var shouldPassButFails = [629]; - - var willNotBeAttemptedByCoreTeam = []; - - var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); - - gfmSpec.forEach(function(spec) { - messenger.test(spec, section, ignore); - }); -}); From 17b231d484a72dbb2dc9c1599b25261f46101062 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Tue, 10 Apr 2018 08:28:40 -0500 Subject: [PATCH 394/459] return defaults --- lib/marked.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 679c0cb0..4399d3f7 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1346,7 +1346,7 @@ marked.setOptions = function(opt) { }; marked.getDefaults = function () { - var defaults = { + return { baseUrl: null, breaks: false, gfm: true, @@ -1365,13 +1365,6 @@ marked.getDefaults = function () { tables: true, xhtml: false }; - - var clone = {}; - for (var opt in defaults) { - clone[opt] = defaults[opt]; - } - - return clone; } marked.defaults = marked.getDefaults(); From db71a7f3b5ea99ca3da33c15acd20e7ce91489a6 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 9 Apr 2018 22:59:01 -0500 Subject: [PATCH 395/459] move cm tests --- package.json | 2 +- .../commonmark/commonmark-spec.js} | 11 ++++++----- .../commonmark/commonmark.0.28.json} | 0 test/specs/{ => original}/specs-spec.js | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) rename test/{integration/marked-spec.js => specs/commonmark/commonmark-spec.js} (97%) rename test/{integration/commonmark.json => specs/commonmark/commonmark.0.28.json} (100%) rename test/specs/{ => original}/specs-spec.js (87%) diff --git a/package.json b/package.json index 02677295..9dad9147 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "test": "jasmine --config=jasmine.json", "test:unit": "npm test -- test/unit/**/*-spec.js", "test:specs": "npm test -- test/specs/**/*-spec.js", - "test:integration": "npm test -- test/integration/**/*-spec.js", + "test:cm": "npm test -- test/specs/commonmark/**/*-spec.js", "test:old": "node test", "test:lint": "eslint bin/marked .", "bench": "node test --bench", diff --git a/test/integration/marked-spec.js b/test/specs/commonmark/commonmark-spec.js similarity index 97% rename from test/integration/marked-spec.js rename to test/specs/commonmark/commonmark-spec.js index 607ecb15..24e4f467 100644 --- a/test/integration/marked-spec.js +++ b/test/specs/commonmark/commonmark-spec.js @@ -1,5 +1,5 @@ -var marked = require('../../lib/marked.js'); -var cmSpec = require('./commonmark.json'); +var marked = require('../../../lib/marked.js'); +var cmSpec = require('./commonmark.0.28.json'); var HtmlDiffer = require('html-differ').HtmlDiffer, htmlDiffer = new HtmlDiffer(); var since = require('jasmine2-custom-message'); @@ -11,13 +11,14 @@ Messenger.prototype.message = function(spec, expected, actual) { } Messenger.prototype.test = function(spec, section, ignore) { - if (spec.section === section && ignore.indexOf(spec.example) < 0) { - it('should pass example ' + spec.example, function() { + if (spec.section === section) { + var shouldFail = ~ignore.indexOf(spec.example); + it('should ' + (shouldFail ? 'fail' : 'pass') + ' example ' + spec.example, function() { var expected = spec.html; var actual = marked(spec.markdown, { headerIds: false, xhtml: true }); since(messenger.message(spec, expected, actual)).expect( htmlDiffer.isEqual(expected, actual) - ).toEqual(true); + ).toEqual(!shouldFail); }); } } diff --git a/test/integration/commonmark.json b/test/specs/commonmark/commonmark.0.28.json similarity index 100% rename from test/integration/commonmark.json rename to test/specs/commonmark/commonmark.0.28.json diff --git a/test/specs/specs-spec.js b/test/specs/original/specs-spec.js similarity index 87% rename from test/specs/specs-spec.js rename to test/specs/original/specs-spec.js index 65526c86..2610b3bb 100644 --- a/test/specs/specs-spec.js +++ b/test/specs/original/specs-spec.js @@ -1,4 +1,4 @@ -var specTests = require('../'); +var specTests = require('../../'); it('should run spec tests', function () { // hide output From 667598bc8eb37339fce681344e08d078ccf3514b Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 9 Apr 2018 23:09:29 -0500 Subject: [PATCH 396/459] remove passing tests --- test/specs/commonmark/commonmark-spec.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/specs/commonmark/commonmark-spec.js b/test/specs/commonmark/commonmark-spec.js index 24e4f467..dce15564 100644 --- a/test/specs/commonmark/commonmark-spec.js +++ b/test/specs/commonmark/commonmark-spec.js @@ -170,7 +170,7 @@ describe('CommonMark 0.28 HTML blocks', function() { var section = 'HTML blocks'; // var shouldPassButFails = []; - var shouldPassButFails = [132, 126, 147, 121, 124, 120, 153, 133, 119, 127, 117, 118, 141, 116, 158, 122, 123, 128, 143, 130, 136, 137, 140, 125, 134, 131, 144, 145, 146, 148, 139, 149, 129, 156, 135, 138, 142, 150, 151, 152, 154, 155, 157]; + var shouldPassButFails = [132, 126, 147, 124, 120, 153, 133, 119, 127, 118, 141, 116, 158, 123, 143, 130, 137, 140, 125, 134, 131, 144, 145, 148, 139, 149, 129, 156, 135, 138, 155]; var willNotBeAttemptedByCoreTeam = []; @@ -260,7 +260,7 @@ describe('CommonMark 0.28 Lists', function() { var section = 'Lists'; // var shouldPassButFails = []; - var shouldPassButFails = [282, 270, 280, 278, 271, 272, 273, 275, 274, 264, 277, 265, 276, 279, 267, 269]; + var shouldPassButFails = [282, 270, 280, 278, 273, 275, 274, 264, 277, 265, 276, 279, 267, 269]; var willNotBeAttemptedByCoreTeam = []; @@ -320,7 +320,7 @@ describe('CommonMark 0.28 Code spans', function() { var section = 'Code spans'; // var shouldPassButFails = []; - var shouldPassButFails = [330, 316, 325, 327, 328, 320, 323, 322]; + var shouldPassButFails = [330, 316, 327, 328, 320, 323, 322]; var willNotBeAttemptedByCoreTeam = []; @@ -395,7 +395,7 @@ describe('CommonMark 0.28 Raw HTML', function() { var section = 'Raw HTML'; // var shouldPassButFails = []; - var shouldPassButFails = [584, 585, 586, 587, 588, 590, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604]; + var shouldPassButFails = [590, 595, 597, 598, 599, 600, 601, 604]; var willNotBeAttemptedByCoreTeam = []; @@ -410,7 +410,7 @@ describe('CommonMark 0.28 Hard line breaks', function() { var section = 'Hard line breaks'; // var shouldPassButFails = []; - var shouldPassButFails = [611, 606, 609, 613, 614, 615]; + var shouldPassButFails = [611, 606, 609, 613]; var willNotBeAttemptedByCoreTeam = []; From 69f663e0346627f48628193a6b5724420a799a93 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 9 Apr 2018 23:11:31 -0500 Subject: [PATCH 397/459] remove when #1212 is merged --- test/specs/commonmark/commonmark-spec.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/specs/commonmark/commonmark-spec.js b/test/specs/commonmark/commonmark-spec.js index dce15564..d29cd852 100644 --- a/test/specs/commonmark/commonmark-spec.js +++ b/test/specs/commonmark/commonmark-spec.js @@ -50,6 +50,12 @@ var messenger = new Messenger(); |Soft line breaks |1 of 2 |50% | */ +beforeEach(function () { + marked.setOptions({ + sanitize: false + }); +}); + describe('CommonMark 0.28 Tabs', function() { var section = 'Tabs'; From 1d00a7638a68602f6aa23cfac164c9c957403758 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Tue, 10 Apr 2018 09:33:47 -0500 Subject: [PATCH 398/459] remove beforeEach --- test/specs/commonmark/commonmark-spec.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/specs/commonmark/commonmark-spec.js b/test/specs/commonmark/commonmark-spec.js index d29cd852..dce15564 100644 --- a/test/specs/commonmark/commonmark-spec.js +++ b/test/specs/commonmark/commonmark-spec.js @@ -50,12 +50,6 @@ var messenger = new Messenger(); |Soft line breaks |1 of 2 |50% | */ -beforeEach(function () { - marked.setOptions({ - sanitize: false - }); -}); - describe('CommonMark 0.28 Tabs', function() { var section = 'Tabs'; From d06bf8d64c6c59a4c05e6dc1dd1bb97e8987c29e Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Tue, 10 Apr 2018 09:52:50 -0500 Subject: [PATCH 399/459] update completed table --- test/specs/commonmark/commonmark-spec.js | 47 ++++++++++++------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/test/specs/commonmark/commonmark-spec.js b/test/specs/commonmark/commonmark-spec.js index dce15564..30b8bea9 100644 --- a/test/specs/commonmark/commonmark-spec.js +++ b/test/specs/commonmark/commonmark-spec.js @@ -25,29 +25,30 @@ Messenger.prototype.test = function(spec, section, ignore) { var messenger = new Messenger(); /* -|Section |Count |Percent | -|:---------------------------|:-------:|---------:| -|Tabs |7 of 11 |63% | -|Thematic breaks |16 of 19 |84% | -|ATX headings |13 of 18 |72% | -|Setext headings |20 of 26 |77% | -|Indented code blocks |11 of 12 |92% | -|Fenced code blocks |17 of 28 |61% | -|HTML blocks |12 of 43 |28% | -|Link reference definitions |21 of 23 |91% | -|Paragraphs |6 of 8 |75% | -|Block quotes |21 of 25 |84% | -|List items |32 of 48 |67% | -|Lists |10 of 24 |42% | -|Backslash escapes |4 of 13 |31% | -|Entity and numeric character references|8 of 12|67%| -|Code spans |10 of 17 |59% | -|Emphasis and strong emphasis|62 of 128|48% | -|Links |46 of 84 |55% | -|Images |13 of 22 |59% | -|Autolinks |14 of 19 |74% | -|Hard line breaks |32 of 36 |89% | -|Soft line breaks |1 of 2 |50% | +|Section |Count |Percent | +|:---------------------------------------|:---------:|-------:| +|Tabs | 7 of 11 | 64%| +|Thematic breaks | 18 of 19 | 95%| +|ATX headings | 14 of 18 | 78%| +|Setext headings | 21 of 26 | 81%| +|Indented code blocks | 11 of 12 | 92%| +|Fenced code blocks | 17 of 28 | 61%| +|HTML blocks | 12 of 43 | 28%| +|Link reference definitions | 21 of 23 | 91%| +|Paragraphs | 6 of 8 | 75%| +|Block quotes | 21 of 25 | 84%| +|List items | 32 of 48 | 67%| +|Lists | 10 of 24 | 42%| +|Backslash escapes | 4 of 13 | 31%| +|Entity and numeric character references | 8 of 12 | 67%| +|Code spans | 10 of 17 | 59%| +|Emphasis and strong emphasis | 71 of 128 | 55%| +|Links | 45 of 84 | 54%| +|Images | 13 of 22 | 59%| +|Autolinks | 14 of 19 | 74%| +|Raw HTML | 13 of 21 | 62%| +|Hard line breaks | 32 of 36 | 89%| +|Soft line breaks | 1 of 2 | 50%| */ describe('CommonMark 0.28 Tabs', function() { From 539695079d8b9c0cbfb33760a4a0c7dddafcfd0f Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Tue, 10 Apr 2018 10:13:24 -0500 Subject: [PATCH 400/459] remove passing tests --- test/specs/commonmark/commonmark-spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/specs/commonmark/commonmark-spec.js b/test/specs/commonmark/commonmark-spec.js index e10a3ecb..87e6feae 100644 --- a/test/specs/commonmark/commonmark-spec.js +++ b/test/specs/commonmark/commonmark-spec.js @@ -320,7 +320,7 @@ describe('CommonMark 0.28 Code spans', function() { var section = 'Code spans'; // var shouldPassButFails = []; - var shouldPassButFails = [330, 316, 327, 328, 320, 323, 322]; + var shouldPassButFails = [330, 316, 328, 320, 323, 322]; var willNotBeAttemptedByCoreTeam = []; @@ -380,7 +380,7 @@ describe('CommonMark 0.28 Autolinks', function() { var section = 'Autolinks'; // var shouldPassButFails = []; - var shouldPassButFails = [582, 574, 573, 579, 583]; + var shouldPassButFails = [582, 573, 579, 583]; var willNotBeAttemptedByCoreTeam = []; From 8815ba328538f689c0f683752b76751852a9182c Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Tue, 10 Apr 2018 10:13:31 -0500 Subject: [PATCH 401/459] randomize tests --- jasmine.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jasmine.json b/jasmine.json index 66b7979b..8d1be919 100644 --- a/jasmine.json +++ b/jasmine.json @@ -7,5 +7,5 @@ "helpers/**/*.js" ], "stopSpecOnExpectationFailure": false, - "random": false + "random": true } From a6c6f0d5a2cb781c0b270cb65d707a4d346e75a4 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Tue, 10 Apr 2018 10:25:37 -0500 Subject: [PATCH 402/459] update completed table --- test/specs/commonmark/commonmark-spec.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/test/specs/commonmark/commonmark-spec.js b/test/specs/commonmark/commonmark-spec.js index 87e6feae..280824f1 100644 --- a/test/specs/commonmark/commonmark-spec.js +++ b/test/specs/commonmark/commonmark-spec.js @@ -33,20 +33,19 @@ var messenger = new Messenger(); |Setext headings | 21 of 26 | 81%| |Indented code blocks | 11 of 12 | 92%| |Fenced code blocks | 17 of 28 | 61%| -|HTML blocks | 12 of 43 | 28%| -|Link reference definitions | 21 of 23 | 91%| +|Link reference definitions | 22 of 23 | 96%| |Paragraphs | 6 of 8 | 75%| |Block quotes | 21 of 25 | 84%| |List items | 32 of 48 | 67%| |Lists | 10 of 24 | 42%| -|Backslash escapes | 4 of 13 | 31%| -|Entity and numeric character references | 8 of 12 | 67%| -|Code spans | 10 of 17 | 59%| +|Backslash escapes | 8 of 13 | 62%| +|Entity and numeric character references | 9 of 12 | 75%| +|Code spans | 11 of 17 | 65%| |Emphasis and strong emphasis | 71 of 128 | 55%| -|Links | 45 of 84 | 54%| -|Images | 13 of 22 | 59%| -|Autolinks | 14 of 19 | 74%| -|Raw HTML | 13 of 21 | 62%| +|Links | 64 of 84 | 76%| +|Images | 15 of 22 | 68%| +|Autolinks | 15 of 19 | 79%| +|Raw HTML | 19 of 21 | 90%| |Hard line breaks | 32 of 36 | 89%| |Soft line breaks | 1 of 2 | 50%| */ @@ -350,7 +349,7 @@ describe('CommonMark 0.28 Links', function() { var section = 'Links'; // var shouldPassButFails = []; - var shouldPassButFails = [468, 474, 478, 483, 489, 490, 491, 492, 495, 496, 497, 499, 503, 504, 505, 507, 508, 509, 523, 535] + var shouldPassButFails = [468, 474, 478, 483, 489, 490, 491, 492, 495, 496, 497, 499, 503, 504, 505, 507, 508, 509, 523, 535]; var willNotBeAttemptedByCoreTeam = []; From 9004cbcc20de6107b76ffb93a37938a49d41aa0d Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Sun, 4 Mar 2018 16:07:00 -0600 Subject: [PATCH 403/459] add test build stages --- .travis.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4964bcc7..cc057f9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,14 +3,23 @@ language: node_js jobs: include: - stage: spec tests 👩🏽‍💻 + script: npm run test:specs + node_js: lts/* + + - stage: unit tests 👩🏽‍💻 + script: npm run test:unit + node_js: lts/* + + - stage: integration tests 👩🏽‍💻 + script: npm run test:integration node_js: v0.10 - node_js: v4 - node_js: lts/* - node_js: node - stage: lint ✨ - node_js: lts/* script: npm run test:lint + node_js: lts/* cache: directories: From 2238c284af80304ee9bbc09befa7f69a25d2136f Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 5 Mar 2018 08:56:03 -0600 Subject: [PATCH 404/459] add minify stage --- .travis.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.travis.yml b/.travis.yml index cc057f9b..c347fda0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,20 @@ jobs: script: npm run test:lint node_js: lts/* + - stage: minify 🗜️ + script: | + npm run build + if ! git diff --quiet; then + git config --global user.email "travis@travis-ci.org" + git config --global user.name "Travis-CI" + git config credential.helper "store --file=.git/credentials" + echo "https://${GITHUB_TOKEN}:@github.com" > .git/credentials + git commit -am 'minify [skip ci]' + git push origin HEAD:${TRAVIS_BRANCH} + fi + node_js: lts/* + if: branch = master AND type = push + cache: directories: - node_modules From 373c64da8f44bf3bcecedb9933bbefd6d0df8d39 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Tue, 10 Apr 2018 15:41:47 -0500 Subject: [PATCH 405/459] remove integration tests --- .travis.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index c347fda0..62901307 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,16 +2,12 @@ language: node_js jobs: include: - - stage: spec tests 👩🏽‍💻 - script: npm run test:specs - node_js: lts/* - - stage: unit tests 👩🏽‍💻 script: npm run test:unit node_js: lts/* - - stage: integration tests 👩🏽‍💻 - script: npm run test:integration + - stage: spec tests 👩🏽‍💻 + script: npm run test:specs node_js: v0.10 - node_js: v4 - node_js: lts/* From 9ac2df43d34f099a47828de79c226d5e06046fcf Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Wed, 11 Apr 2018 14:34:39 -0500 Subject: [PATCH 406/459] add emoji to commit message --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 62901307..a1013223 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ jobs: git config --global user.name "Travis-CI" git config credential.helper "store --file=.git/credentials" echo "https://${GITHUB_TOKEN}:@github.com" > .git/credentials - git commit -am 'minify [skip ci]' + git commit -am '🗜️ minify [skip ci]' git push origin HEAD:${TRAVIS_BRANCH} fi node_js: lts/* From 737246c621aadf459941ce83e769d3cb680dcdce Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@8fold.pro> Date: Thu, 12 Apr 2018 13:14:44 -0400 Subject: [PATCH 407/459] Clarify 30 day window on badges (#1214) * Clarify 30 day window --- .github/PULL_REQUEST_TEMPLATE/badges.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/badges.md b/.github/PULL_REQUEST_TEMPLATE/badges.md index 6b77663a..2078243d 100644 --- a/.github/PULL_REQUEST_TEMPLATE/badges.md +++ b/.github/PULL_REQUEST_TEMPLATE/badges.md @@ -20,7 +20,10 @@ - [ ] graciously decline; or, - [ ] dispute the recommendation -within 30 days (silence is consent at this point, can't have the pull requests page filled with PRs related to badges forever). +within 30 days, if you have not indicated which option you are taking one of the following will happen: + +1. If adding a badge, we will assume you are graciously declining. +2. If removing a badge, we will assume you do not want to dispute the recommendation; therefore, the badge will be removed. <!-- From 3130e62bc210c68d8475e02a334f6a0fafa98d5f Mon Sep 17 00:00:00 2001 From: Travis-CI <travis@travis-ci.org> Date: Fri, 13 Apr 2018 02:50:19 +0000 Subject: [PATCH 408/459] =?UTF-8?q?=F0=9F=97=9C=EF=B8=8F=20minify=20[skip?= =?UTF-8?q?=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index 28a98262..d6f66a31 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|tag)[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||k.defaults,this.rules=t.normal,this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"|[^"]|"[^"\n]*")*"|'\n?(?:[^'\n]+\n?)*'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b",t.html=p(t.html).replace("comment",/<!--[\s\S]*?-->/).replace("closed",/<(tag)[\s\S]+?<\/\1>/).replace("closing",/<tag(?:"[^"]*"|'[^']*'|\s[^'"\/>\s]*)*?\/?>/).replace(/tag/g,t._tag).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag","<"+t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p<c;p++)h=(a=i[p]).length,~(a=a.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(h-=a.length,a=this.options.pedantic?a.replace(/^ {1,4}/gm,""):a.replace(new RegExp("^ {1,"+h+"}","gm"),"")),this.options.smartLists&&p!==c-1&&(l===(o=t.bullet.exec(i[p+1])[0])||l.length>1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase(),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(n&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var r={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:/^<!--[\s\S]*?-->|^<\/?[a-zA-Z0-9\-]+(?:"[^"]*"|'[^']*'|\s[^<'">\/\s]*)*?\/?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^_([^\s_](?:[^_]|__)+?[^\s_])_\b|^\*((?:\*\*|[^*])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function s(e,t){if(this.options=t||k.defaults,this.links=e,this.rules=r.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=r.breaks:this.rules=r.gfm:this.options.pedantic&&(this.rules=r.pedantic)}function i(e){this.options=e||{}}function l(){}function o(e){this.tokens=[],this.token=null,this.options=e||k.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._inside=/(?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/,r._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,r.link=p(r.link).replace("inside",r._inside).replace("href",r._href).getRegex(),r.reflink=p(r.reflink).replace("inside",r._inside).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,s,i="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),i+=s[1];else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=a(this.mangle(s[1]))):n=a(s[1]),i+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(s[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):a(s[0]):s[0];else if(s=this.rules.link.exec(e))e=e.substring(s[0].length),this.inLink=!0,i+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){i+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,i+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),i+=this.renderer.strong(this.output(s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),i+=this.renderer.em(this.output(s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),i+=this.renderer.codespan(a(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),i+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),i+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),i+=this.renderer.text(a(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else s[0]=this.rules._backpedal.exec(s[0])[0],e=e.substring(s[0].length),"@"===s[2]?r="mailto:"+(n=a(s[0])):(n=a(s[0]),r="www."===s[1]?"http://"+n:n),i+=this.renderer.link(r,null,n);return i},s.prototype.outputLink=function(e,t){var n=a(t.href),r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s<r;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var s='<a href="'+e+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>"},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(s+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});i+=this.renderer.tablerow(n)}return this.renderer.table(s,i);case"blockquote_start":for(i="";"blockquote_end"!==this.next().type;)i+=this.tok();return this.renderer.blockquote(i);case"list_start":i="";for(var l=this.token.ordered,o=this.token.start;"list_end"!==this.next().type;)i+=this.tok();return this.renderer.list(i,l,o);case"list_item_start":for(i="";"list_item_end"!==this.next().type;)i+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(i);case"loose_item_start":for(i="";"list_item_end"!==this.next().type;)i+=this.tok();return this.renderer.listitem(i);case"html":var a=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(a);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var c={},g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(){}function d(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function k(e,t,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(r||"function"==typeof t){r||(r=t,t=null);var s,i,l=(t=d({},k.defaults,t||{})).highlight,h=0;try{s=n.lex(e,t)}catch(e){return r(e)}i=s.length;var p=function(e){if(e)return t.highlight=l,r(e);var n;try{n=o.parse(s,t)}catch(t){e=t}return t.highlight=l,e?r(e):r(null,n)};if(!l||l.length<3)return p();if(delete t.highlight,!i)return p();for(;h<s.length;h++)!function(e){"code"!==e.type?--i||p():l(e.text,e.lang,function(t,n){return t?p(t):null==n||n===e.text?--i||p():(e.text=n,e.escaped=!0,void(--i||p()))})}(s[h])}else try{return t&&(t=d({},k.defaults,t)),o.parse(n.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||k.defaults).silent)return"<p>An error occurred:</p><pre>"+a(e.message+"",!0)+"</pre>";throw e}}f.exec=f,k.options=k.setOptions=function(e){return d(k.defaults,e),k},k.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1,baseUrl:null},k.Parser=o,k.parser=o.parse,k.Renderer=i,k.TextRenderer=l,k.Lexer=n,k.lexer=n.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.parse=k,"undefined"!=typeof module&&"object"==typeof exports?module.exports=k:"function"==typeof define&&define.amd?define(function(){return k}):e.marked=k}(this||("undefined"!=typeof window?window:global)); +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||b.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=/<!--(?!-?>)[\s\S]*?-->/,t.html=p(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.pedantic=d({},t.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p<c;p++)h=(a=i[p]).length,~(a=a.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(h-=a.length,a=this.options.pedantic?a.replace(/^ {1,4}/gm,""):a.replace(new RegExp("^ {1,"+h+"}","gm"),"")),this.options.smartLists&&p!==c-1&&(l===(o=t.bullet.exec(i[p+1])[0])||l.length>1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(n&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var r={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,em:/^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function s(e,t){if(this.options=t||b.defaults,this.links=e,this.rules=r.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=r.pedantic:this.options.gfm&&(this.options.breaks?this.rules=r.breaks:this.rules=r.gfm)}function i(e){this.options=e||b.defaults}function l(){}function o(e){this.tokens=[],this.token=null,this.options=e||b.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r.tag=p(r.tag).replace("comment",t._comment).replace("attribute",r._attribute).getRegex(),r._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,r._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/,r._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r.link=p(r.link).replace("label",r._label).replace("href",r._href).replace("title",r._title).getRegex(),r.reflink=p(r.reflink).replace("label",r._label).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\(\s*<?([\s\S]*?)>?(?:\s+(['"][\s\S]*?['"]))?\s*\)/).replace("label",r._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r._label).getRegex()}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,i,l,o="";e;)if(l=this.rules.escape.exec(e))e=e.substring(l[0].length),o+=l[1];else if(l=this.rules.autolink.exec(e))e=e.substring(l[0].length),r="@"===l[2]?"mailto:"+(n=a(this.mangle(l[1]))):n=a(l[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(l=this.rules.url.exec(e))){if(l=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(l[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(l[0])&&(this.inLink=!1),e=e.substring(l[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):a(l[0]):l[0];else if(l=this.rules.link.exec(e))e=e.substring(l[0].length),this.inLink=!0,r="<"===(r=l[2])[0]?r.substring(1,r.length-1):r,i=l[3]?l[3].substring(1,l[3].length-1):l[3],o+=this.outputLink(l,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1;else if((l=this.rules.reflink.exec(e))||(l=this.rules.nolink.exec(e))){if(e=e.substring(l[0].length),t=(l[2]||l[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=l[0].charAt(0),e=l[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(l,t),this.inLink=!1}else if(l=this.rules.strong.exec(e))e=e.substring(l[0].length),o+=this.renderer.strong(this.output(l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.em.exec(e))e=e.substring(l[0].length),o+=this.renderer.em(this.output(l[6]||l[5]||l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.code.exec(e))e=e.substring(l[0].length),o+=this.renderer.codespan(a(l[2].trim(),!0));else if(l=this.rules.br.exec(e))e=e.substring(l[0].length),o+=this.renderer.br();else if(l=this.rules.del.exec(e))e=e.substring(l[0].length),o+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(e))e=e.substring(l[0].length),o+=this.renderer.text(a(this.smartypants(l[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else l[0]=this.rules._backpedal.exec(l[0])[0],e=e.substring(l[0].length),"@"===l[2]?r="mailto:"+(n=a(l[0])):(n=a(l[0]),r="www."===l[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s<r;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='<a href="'+a(e)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>"},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(s+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});i+=this.renderer.tablerow(n)}return this.renderer.table(s,i);case"blockquote_start":for(i="";"blockquote_end"!==this.next().type;)i+=this.tok();return this.renderer.blockquote(i);case"list_start":i="";for(var l=this.token.ordered,o=this.token.start;"list_end"!==this.next().type;)i+=this.tok();return this.renderer.list(i,l,o);case"list_item_start":for(i="";"list_item_end"!==this.next().type;)i+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(i);case"loose_item_start":for(i="";"list_item_end"!==this.next().type;)i+=this.tok();return this.renderer.listitem(i);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var c={},g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(){}function d(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function b(e,t,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(r||"function"==typeof t){r||(r=t,t=null);var s,i,l=(t=d({},b.defaults,t||{})).highlight,h=0;try{s=n.lex(e,t)}catch(e){return r(e)}i=s.length;var p=function(e){if(e)return t.highlight=l,r(e);var n;try{n=o.parse(s,t)}catch(t){e=t}return t.highlight=l,e?r(e):r(null,n)};if(!l||l.length<3)return p();if(delete t.highlight,!i)return p();for(;h<s.length;h++)!function(e){"code"!==e.type?--i||p():l(e.text,e.lang,function(t,n){return t?p(t):null==n||n===e.text?--i||p():(e.text=n,e.escaped=!0,void(--i||p()))})}(s[h])}else try{return t&&(t=d({},b.defaults,t)),o.parse(n.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||b.defaults).silent)return"<p>An error occurred:</p><pre>"+a(e.message+"",!0)+"</pre>";throw e}}f.exec=f,b.options=b.setOptions=function(e){return d(b.defaults,e),b},b.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"lang-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},b.defaults=b.getDefaults(),b.Parser=o,b.parser=o.parse,b.Renderer=i,b.TextRenderer=l,b.Lexer=n,b.lexer=n.lex,b.InlineLexer=s,b.inlineLexer=s.output,b.parse=b,"undefined"!=typeof module&&"object"==typeof exports?module.exports=b:"function"==typeof define&&define.amd?define(function(){return b}):e.marked=b}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file From f6cdfb53738c00480ae236c030c133e5157e05df Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@joshbruce.com> Date: Fri, 13 Apr 2018 11:09:25 -0400 Subject: [PATCH 409/459] Make styfle only appear once --- docs/AUTHORS.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index b4a9a9ed..1afaa643 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -37,7 +37,6 @@ A note on "decision making authority". This is related to submitting PRs and the |Name |GiHub handle |Decision making |Badges of honor (tag for questions) | |:--------------|:--------------|:----------------------------------------|------------------------------------| |Jamie Davis |@davisjam |Seeker of Security | | -|Steven |@styfle |Open source, of course and GitHub Guru | | |Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | | **Should not exceed 5:** For larger PRs affecting more of the codebase and, most likely, review by more people, we try to keep this pool small and responsive and let those with decision making authority have final say without negative repercussions from the other committers. From a3ff53875eb14d08911e2ea1c9108e76ec2e02a4 Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@joshbruce.com> Date: Fri, 13 Apr 2018 11:11:23 -0400 Subject: [PATCH 410/459] Add defib badge and description --- docs/AUTHORS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 1afaa643..5c594f8d 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -143,6 +143,8 @@ Badges? If you *want* 'em, we got 'em, and here's how you get 'em (and…dr ### Special badges that come with the job: <dl> + <dt>Defibrillator</dt> + <dd>A contributor who stepped to help bring Marked back to life by contriuting solutions to help Marked pass when compared against the CommonMark and GitHub Flavored Markdown specifications.</dd> <dt>Maker of the Marked mark</dt> <dd>This badge is given to the person or oganization credited with creating the logo (or logotype) used in Marked communications for a given period of time. **Maker of the Marked mark from 2017 to present**, for example.</dd> <dt>Release Wrangler</dt> From 06a13ad2f74d39e64bab44445cd06a56018dbeb3 Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@joshbruce.com> Date: Sun, 15 Apr 2018 13:08:01 -0400 Subject: [PATCH 411/459] Test for #1218 & "marked" spec --- package.json | 1 + test/specs/marked/marked-spec.js | 49 ++++++++++++++++++++++++++++++++ test/specs/marked/marked.json | 8 ++++++ 3 files changed, 58 insertions(+) create mode 100644 test/specs/marked/marked-spec.js create mode 100644 test/specs/marked/marked.json diff --git a/package.json b/package.json index 5ebeef7e..17bdaec3 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "test:specs": "npm test -- test/specs/**/*-spec.js", "test:cm": "npm test -- test/specs/commonmark/**/*-spec.js", "test:gfm": "npm test -- test/specs/gfm/**/*-spec.js", + "test:marked": "npm test -- test/specs/marked/**/*-spec.js", "test:old": "node test", "test:lint": "eslint bin/marked .", "bench": "node test --bench", diff --git a/test/specs/marked/marked-spec.js b/test/specs/marked/marked-spec.js new file mode 100644 index 00000000..783693ef --- /dev/null +++ b/test/specs/marked/marked-spec.js @@ -0,0 +1,49 @@ +/** + * Marked does not have a custom markdown specification. However, there are times + * when we come across use cases that are not defined in a given specification. + * Therefore, we will put use cases together to illustrate those instances to + * consumers of marked. + * + */ +var marked = require('../../../lib/marked.js'); +var markedSpec = require('./marked.json'); +var HtmlDiffer = require('html-differ').HtmlDiffer, + htmlDiffer = new HtmlDiffer(); +var since = require('jasmine2-custom-message'); + + +var Messenger = function() {} + +Messenger.prototype.message = function(spec, expected, actual) { + return 'CommonMark (' + spec.section + '):\n' + spec.markdown + '\n------\n\nExpected:\n' + expected + '\n------\n\nMarked:\n' + actual; +} + +Messenger.prototype.test = function(spec, section, ignore) { + if (spec.section === section) { + var shouldFail = ~ignore.indexOf(spec.example); + it('should ' + (shouldFail ? 'fail' : 'pass') + ' example ' + spec.example, function() { + var expected = spec.html; + var actual = marked(spec.markdown, { headerIds: false, xhtml: true }); + since(messenger.message(spec, expected, actual)).expect( + htmlDiffer.isEqual(expected, actual) + ).toEqual(!shouldFail); + }); + } +} + +var messenger = new Messenger(); + +describe('Marked Code spans', function() { + var section = 'Code spans'; + + // var shouldPassButFails = []; + var shouldPassButFails = [1]; + + var willNotBeAttemptedByCoreTeam = []; + + var ignore = shouldPassButFails.concat(willNotBeAttemptedByCoreTeam); + + markedSpec.forEach(function(spec) { + messenger.test(spec, section, ignore); + }); +}); diff --git a/test/specs/marked/marked.json b/test/specs/marked/marked.json new file mode 100644 index 00000000..eedb65a8 --- /dev/null +++ b/test/specs/marked/marked.json @@ -0,0 +1,8 @@ +[ + { + "section": "Code spans", + "markdown": "`someone@example.com`", + "html": "<p><code>someone@exmaple.com</code></p>\n", + "example": 1 + } +] From 29e2cc6fb756a22877c81931287229683a1d36d6 Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@joshbruce.com> Date: Sun, 15 Apr 2018 13:18:51 -0400 Subject: [PATCH 412/459] Run lint --- test/specs/marked/marked-spec.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/specs/marked/marked-spec.js b/test/specs/marked/marked-spec.js index 783693ef..6a314273 100644 --- a/test/specs/marked/marked-spec.js +++ b/test/specs/marked/marked-spec.js @@ -3,7 +3,7 @@ * when we come across use cases that are not defined in a given specification. * Therefore, we will put use cases together to illustrate those instances to * consumers of marked. - * + * */ var marked = require('../../../lib/marked.js'); var markedSpec = require('./marked.json'); @@ -11,7 +11,6 @@ var HtmlDiffer = require('html-differ').HtmlDiffer, htmlDiffer = new HtmlDiffer(); var since = require('jasmine2-custom-message'); - var Messenger = function() {} Messenger.prototype.message = function(spec, expected, actual) { From e5cf974115367ad8fa6c9eecf9e642ee6bdcd4df Mon Sep 17 00:00:00 2001 From: Steven <steven@ceriously.com> Date: Sun, 15 Apr 2018 18:29:57 -0400 Subject: [PATCH 413/459] Add badges to README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 88ec1511..7d3af293 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ # Marked +[![npm](https://img.shields.io/npm/v/marked.svg)](https://www.npmjs.com/package/marked) +[![gzip size](http://img.badgesize.io/https://cdn.jsdelivr.net/npm/marked@0.3.19/marked.min.js?compression=gzip)](https://cdn.jsdelivr.net/npm/marked@0.3.19/marked.min.js) +[![install size](https://packagephobia.now.sh/badge?p=marked@0.3.19)](https://packagephobia.now.sh/result?p=marked@0.3.19) +[![downloads](https://img.shields.io/npm/dt/marked.svg)](https://www.npmjs.com/package/marked) +[![travis](https://travis-ci.org/markedjs/marked.svg?branch=master)](https://travis-ci.org/markedjs/marked) + - ⚡ built for speed - ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time - ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications From f052a2c04ecb371faa8c3e1cb2c72afe0eb13618 Mon Sep 17 00:00:00 2001 From: Jamie Davis <davisjam@vt.edu> Date: Sun, 15 Apr 2018 22:16:16 -0400 Subject: [PATCH 414/459] security: fix unsafe heading regex Problem: REDOS could be triggered through exploitation of the 'heading' regex. Solution: Refactor regex. It matches the same language as before but is less vulnerable to REDOS. It is now safe using the bounds suggested by those disclosing it. It remains super-linear but a successful exploit requires a much longer attack string. Fixes: Issue disclosed privately. Credit: This issue was pointed out by Nick Starke and Adam Cazzolla of Sonatype Security research. --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 80120630..ff4b7ba7 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -16,7 +16,7 @@ var block = { code: /^( {4}[^\n]+\n*)+/, fences: noop, hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, - heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, + heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/, nptable: noop, blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, From fa15a373a33dd3688a2d3e5da9b55063fc9ba2e9 Mon Sep 17 00:00:00 2001 From: Travis-CI <travis@travis-ci.org> Date: Mon, 16 Apr 2018 12:43:08 +0000 Subject: [PATCH 415/459] =?UTF-8?q?=F0=9F=97=9C=EF=B8=8F=20minify=20[skip?= =?UTF-8?q?=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index d6f66a31..f2aba922 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||b.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=/<!--(?!-?>)[\s\S]*?-->/,t.html=p(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.pedantic=d({},t.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p<c;p++)h=(a=i[p]).length,~(a=a.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(h-=a.length,a=this.options.pedantic?a.replace(/^ {1,4}/gm,""):a.replace(new RegExp("^ {1,"+h+"}","gm"),"")),this.options.smartLists&&p!==c-1&&(l===(o=t.bullet.exec(i[p+1])[0])||l.length>1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(n&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var r={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,em:/^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function s(e,t){if(this.options=t||b.defaults,this.links=e,this.rules=r.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=r.pedantic:this.options.gfm&&(this.options.breaks?this.rules=r.breaks:this.rules=r.gfm)}function i(e){this.options=e||b.defaults}function l(){}function o(e){this.tokens=[],this.token=null,this.options=e||b.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r.tag=p(r.tag).replace("comment",t._comment).replace("attribute",r._attribute).getRegex(),r._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,r._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/,r._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r.link=p(r.link).replace("label",r._label).replace("href",r._href).replace("title",r._title).getRegex(),r.reflink=p(r.reflink).replace("label",r._label).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\(\s*<?([\s\S]*?)>?(?:\s+(['"][\s\S]*?['"]))?\s*\)/).replace("label",r._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r._label).getRegex()}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,i,l,o="";e;)if(l=this.rules.escape.exec(e))e=e.substring(l[0].length),o+=l[1];else if(l=this.rules.autolink.exec(e))e=e.substring(l[0].length),r="@"===l[2]?"mailto:"+(n=a(this.mangle(l[1]))):n=a(l[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(l=this.rules.url.exec(e))){if(l=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(l[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(l[0])&&(this.inLink=!1),e=e.substring(l[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):a(l[0]):l[0];else if(l=this.rules.link.exec(e))e=e.substring(l[0].length),this.inLink=!0,r="<"===(r=l[2])[0]?r.substring(1,r.length-1):r,i=l[3]?l[3].substring(1,l[3].length-1):l[3],o+=this.outputLink(l,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1;else if((l=this.rules.reflink.exec(e))||(l=this.rules.nolink.exec(e))){if(e=e.substring(l[0].length),t=(l[2]||l[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=l[0].charAt(0),e=l[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(l,t),this.inLink=!1}else if(l=this.rules.strong.exec(e))e=e.substring(l[0].length),o+=this.renderer.strong(this.output(l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.em.exec(e))e=e.substring(l[0].length),o+=this.renderer.em(this.output(l[6]||l[5]||l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.code.exec(e))e=e.substring(l[0].length),o+=this.renderer.codespan(a(l[2].trim(),!0));else if(l=this.rules.br.exec(e))e=e.substring(l[0].length),o+=this.renderer.br();else if(l=this.rules.del.exec(e))e=e.substring(l[0].length),o+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(e))e=e.substring(l[0].length),o+=this.renderer.text(a(this.smartypants(l[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else l[0]=this.rules._backpedal.exec(l[0])[0],e=e.substring(l[0].length),"@"===l[2]?r="mailto:"+(n=a(l[0])):(n=a(l[0]),r="www."===l[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s<r;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='<a href="'+a(e)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>"},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(s+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});i+=this.renderer.tablerow(n)}return this.renderer.table(s,i);case"blockquote_start":for(i="";"blockquote_end"!==this.next().type;)i+=this.tok();return this.renderer.blockquote(i);case"list_start":i="";for(var l=this.token.ordered,o=this.token.start;"list_end"!==this.next().type;)i+=this.tok();return this.renderer.list(i,l,o);case"list_item_start":for(i="";"list_item_end"!==this.next().type;)i+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(i);case"loose_item_start":for(i="";"list_item_end"!==this.next().type;)i+=this.tok();return this.renderer.listitem(i);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var c={},g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(){}function d(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function b(e,t,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(r||"function"==typeof t){r||(r=t,t=null);var s,i,l=(t=d({},b.defaults,t||{})).highlight,h=0;try{s=n.lex(e,t)}catch(e){return r(e)}i=s.length;var p=function(e){if(e)return t.highlight=l,r(e);var n;try{n=o.parse(s,t)}catch(t){e=t}return t.highlight=l,e?r(e):r(null,n)};if(!l||l.length<3)return p();if(delete t.highlight,!i)return p();for(;h<s.length;h++)!function(e){"code"!==e.type?--i||p():l(e.text,e.lang,function(t,n){return t?p(t):null==n||n===e.text?--i||p():(e.text=n,e.escaped=!0,void(--i||p()))})}(s[h])}else try{return t&&(t=d({},b.defaults,t)),o.parse(n.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||b.defaults).silent)return"<p>An error occurred:</p><pre>"+a(e.message+"",!0)+"</pre>";throw e}}f.exec=f,b.options=b.setOptions=function(e){return d(b.defaults,e),b},b.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"lang-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},b.defaults=b.getDefaults(),b.Parser=o,b.parser=o.parse,b.Renderer=i,b.TextRenderer=l,b.Lexer=n,b.lexer=n.lex,b.InlineLexer=s,b.inlineLexer=s.output,b.parse=b,"undefined"!=typeof module&&"object"==typeof exports?module.exports=b:"function"==typeof define&&define.amd?define(function(){return b}):e.marked=b}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||b.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=/<!--(?!-?>)[\s\S]*?-->/,t.html=p(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.pedantic=d({},t.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p<c;p++)h=(a=i[p]).length,~(a=a.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(h-=a.length,a=this.options.pedantic?a.replace(/^ {1,4}/gm,""):a.replace(new RegExp("^ {1,"+h+"}","gm"),"")),this.options.smartLists&&p!==c-1&&(l===(o=t.bullet.exec(i[p+1])[0])||l.length>1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(n&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var r={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,em:/^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function s(e,t){if(this.options=t||b.defaults,this.links=e,this.rules=r.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=r.pedantic:this.options.gfm&&(this.options.breaks?this.rules=r.breaks:this.rules=r.gfm)}function i(e){this.options=e||b.defaults}function l(){}function o(e){this.tokens=[],this.token=null,this.options=e||b.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r.tag=p(r.tag).replace("comment",t._comment).replace("attribute",r._attribute).getRegex(),r._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,r._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/,r._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r.link=p(r.link).replace("label",r._label).replace("href",r._href).replace("title",r._title).getRegex(),r.reflink=p(r.reflink).replace("label",r._label).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\(\s*<?([\s\S]*?)>?(?:\s+(['"][\s\S]*?['"]))?\s*\)/).replace("label",r._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r._label).getRegex()}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,i,l,o="";e;)if(l=this.rules.escape.exec(e))e=e.substring(l[0].length),o+=l[1];else if(l=this.rules.autolink.exec(e))e=e.substring(l[0].length),r="@"===l[2]?"mailto:"+(n=a(this.mangle(l[1]))):n=a(l[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(l=this.rules.url.exec(e))){if(l=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(l[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(l[0])&&(this.inLink=!1),e=e.substring(l[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):a(l[0]):l[0];else if(l=this.rules.link.exec(e))e=e.substring(l[0].length),this.inLink=!0,r="<"===(r=l[2])[0]?r.substring(1,r.length-1):r,i=l[3]?l[3].substring(1,l[3].length-1):l[3],o+=this.outputLink(l,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1;else if((l=this.rules.reflink.exec(e))||(l=this.rules.nolink.exec(e))){if(e=e.substring(l[0].length),t=(l[2]||l[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=l[0].charAt(0),e=l[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(l,t),this.inLink=!1}else if(l=this.rules.strong.exec(e))e=e.substring(l[0].length),o+=this.renderer.strong(this.output(l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.em.exec(e))e=e.substring(l[0].length),o+=this.renderer.em(this.output(l[6]||l[5]||l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.code.exec(e))e=e.substring(l[0].length),o+=this.renderer.codespan(a(l[2].trim(),!0));else if(l=this.rules.br.exec(e))e=e.substring(l[0].length),o+=this.renderer.br();else if(l=this.rules.del.exec(e))e=e.substring(l[0].length),o+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(e))e=e.substring(l[0].length),o+=this.renderer.text(a(this.smartypants(l[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else l[0]=this.rules._backpedal.exec(l[0])[0],e=e.substring(l[0].length),"@"===l[2]?r="mailto:"+(n=a(l[0])):(n=a(l[0]),r="www."===l[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s<r;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='<a href="'+a(e)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>"},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(s+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});i+=this.renderer.tablerow(n)}return this.renderer.table(s,i);case"blockquote_start":for(i="";"blockquote_end"!==this.next().type;)i+=this.tok();return this.renderer.blockquote(i);case"list_start":i="";for(var l=this.token.ordered,o=this.token.start;"list_end"!==this.next().type;)i+=this.tok();return this.renderer.list(i,l,o);case"list_item_start":for(i="";"list_item_end"!==this.next().type;)i+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(i);case"loose_item_start":for(i="";"list_item_end"!==this.next().type;)i+=this.tok();return this.renderer.listitem(i);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var c={},g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(){}function d(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function b(e,t,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(r||"function"==typeof t){r||(r=t,t=null);var s,i,l=(t=d({},b.defaults,t||{})).highlight,h=0;try{s=n.lex(e,t)}catch(e){return r(e)}i=s.length;var p=function(e){if(e)return t.highlight=l,r(e);var n;try{n=o.parse(s,t)}catch(t){e=t}return t.highlight=l,e?r(e):r(null,n)};if(!l||l.length<3)return p();if(delete t.highlight,!i)return p();for(;h<s.length;h++)!function(e){"code"!==e.type?--i||p():l(e.text,e.lang,function(t,n){return t?p(t):null==n||n===e.text?--i||p():(e.text=n,e.escaped=!0,void(--i||p()))})}(s[h])}else try{return t&&(t=d({},b.defaults,t)),o.parse(n.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||b.defaults).silent)return"<p>An error occurred:</p><pre>"+a(e.message+"",!0)+"</pre>";throw e}}f.exec=f,b.options=b.setOptions=function(e){return d(b.defaults,e),b},b.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"lang-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},b.defaults=b.getDefaults(),b.Parser=o,b.parser=o.parse,b.Renderer=i,b.TextRenderer=l,b.Lexer=n,b.lexer=n.lex,b.InlineLexer=s,b.inlineLexer=s.output,b.parse=b,"undefined"!=typeof module&&"object"==typeof exports?module.exports=b:"function"==typeof define&&define.amd?define(function(){return b}):e.marked=b}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file From 5ab4ae36494df2272d2957dc1435c259a1e7eed6 Mon Sep 17 00:00:00 2001 From: Jamie Davis <davisjam@vt.edu> Date: Mon, 16 Apr 2018 20:21:12 -0400 Subject: [PATCH 416/459] security: replace vulnerable regex with parser (#1223) * security: replace vulnerable regex with parser Problem: link regex was vulnerable Solution: dedicated parser Fixes: #1222 --- lib/marked.js | 65 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index ff4b7ba7..1ecfc3ee 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -554,9 +554,68 @@ inline.normal = merge({}, inline); inline.pedantic = merge({}, inline.normal, { strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, - link: edit(/^!?\[(label)\]\(\s*<?([\s\S]*?)>?(?:\s+(['"][\s\S]*?['"]))?\s*\)/) - .replace('label', inline._label) - .getRegex(), + /* Original link re: /^!?\[(label)\]\(\s*<?([\s\S]*?)>?(?:\s+(['"][\s\S]*?['"]))?\s*\)/ + * This captures the spec reasonably well but is vulnerable to REDOS. + * Instead we use a custom parser that follows the RegExp.exec semantics. */ + link: { + exec: function (s) { + // [TEXT](DESTINATION) + var generalLinkRe = edit(/^!?\[(label)\]\((.*?)\)/) + .replace('label', inline._label) + .getRegex(); + + // destination: DESTINATION from generalLinkRe + // returns [destination, title]: no angle-brackets on destination, no quotes on title + function splitIntoDestinationAndTitle (destination) { + function unwrapAngleBrackets (str) { + if (str.match(/^<.*>$/)) { + str = str.slice(1, -1); + } + return str; + } + + // Valid DESTINATIONs, in decreasing specificity. + var destinationAndTitleRe = /^([^'"(]*[^\s])\s+(['"(].*['")])/; + var destinationRe = /^(<?[\s\S]*>?)/; + var parsingRegexes = [destinationAndTitleRe, destinationRe]; + + var match = false; + for (var i = 0; i < parsingRegexes.length; i++) { + match = parsingRegexes[i].exec(destination); + if (match) { + break; + } + } + + if (!match) { + return null; + } + + var dest = match[1]; + var title = match[2] || ''; // Not all parsingRegexes have 2 groups. + + // Format dest. + dest = dest.trim(); + dest = unwrapAngleBrackets(dest); + + return [dest, title]; + } + + var fullMatch = generalLinkRe.exec(s); + if (!fullMatch) { + return null; + } + + var text = fullMatch[1]; + var destination = fullMatch[2]; + + var destinationAndTitle = splitIntoDestinationAndTitle(destination); + if (!destinationAndTitle) { + return null; + } + return [fullMatch[0], text, destinationAndTitle[0], destinationAndTitle[1]]; + } + }, reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) .replace('label', inline._label) .getRegex() From 4711f6bb51c538b3693e35e8091cd55bdf23a934 Mon Sep 17 00:00:00 2001 From: Travis-CI <travis@travis-ci.org> Date: Tue, 17 Apr 2018 00:27:05 +0000 Subject: [PATCH 417/459] =?UTF-8?q?=F0=9F=97=9C=EF=B8=8F=20minify=20[skip?= =?UTF-8?q?=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index f2aba922..d301f5c6 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||b.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=/<!--(?!-?>)[\s\S]*?-->/,t.html=p(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.pedantic=d({},t.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p<c;p++)h=(a=i[p]).length,~(a=a.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(h-=a.length,a=this.options.pedantic?a.replace(/^ {1,4}/gm,""):a.replace(new RegExp("^ {1,"+h+"}","gm"),"")),this.options.smartLists&&p!==c-1&&(l===(o=t.bullet.exec(i[p+1])[0])||l.length>1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(n&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var r={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,em:/^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function s(e,t){if(this.options=t||b.defaults,this.links=e,this.rules=r.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=r.pedantic:this.options.gfm&&(this.options.breaks?this.rules=r.breaks:this.rules=r.gfm)}function i(e){this.options=e||b.defaults}function l(){}function o(e){this.tokens=[],this.token=null,this.options=e||b.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r.tag=p(r.tag).replace("comment",t._comment).replace("attribute",r._attribute).getRegex(),r._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,r._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/,r._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r.link=p(r.link).replace("label",r._label).replace("href",r._href).replace("title",r._title).getRegex(),r.reflink=p(r.reflink).replace("label",r._label).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\(\s*<?([\s\S]*?)>?(?:\s+(['"][\s\S]*?['"]))?\s*\)/).replace("label",r._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r._label).getRegex()}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,i,l,o="";e;)if(l=this.rules.escape.exec(e))e=e.substring(l[0].length),o+=l[1];else if(l=this.rules.autolink.exec(e))e=e.substring(l[0].length),r="@"===l[2]?"mailto:"+(n=a(this.mangle(l[1]))):n=a(l[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(l=this.rules.url.exec(e))){if(l=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(l[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(l[0])&&(this.inLink=!1),e=e.substring(l[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):a(l[0]):l[0];else if(l=this.rules.link.exec(e))e=e.substring(l[0].length),this.inLink=!0,r="<"===(r=l[2])[0]?r.substring(1,r.length-1):r,i=l[3]?l[3].substring(1,l[3].length-1):l[3],o+=this.outputLink(l,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1;else if((l=this.rules.reflink.exec(e))||(l=this.rules.nolink.exec(e))){if(e=e.substring(l[0].length),t=(l[2]||l[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=l[0].charAt(0),e=l[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(l,t),this.inLink=!1}else if(l=this.rules.strong.exec(e))e=e.substring(l[0].length),o+=this.renderer.strong(this.output(l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.em.exec(e))e=e.substring(l[0].length),o+=this.renderer.em(this.output(l[6]||l[5]||l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.code.exec(e))e=e.substring(l[0].length),o+=this.renderer.codespan(a(l[2].trim(),!0));else if(l=this.rules.br.exec(e))e=e.substring(l[0].length),o+=this.renderer.br();else if(l=this.rules.del.exec(e))e=e.substring(l[0].length),o+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(e))e=e.substring(l[0].length),o+=this.renderer.text(a(this.smartypants(l[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else l[0]=this.rules._backpedal.exec(l[0])[0],e=e.substring(l[0].length),"@"===l[2]?r="mailto:"+(n=a(l[0])):(n=a(l[0]),r="www."===l[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s<r;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='<a href="'+a(e)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>"},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(s+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});i+=this.renderer.tablerow(n)}return this.renderer.table(s,i);case"blockquote_start":for(i="";"blockquote_end"!==this.next().type;)i+=this.tok();return this.renderer.blockquote(i);case"list_start":i="";for(var l=this.token.ordered,o=this.token.start;"list_end"!==this.next().type;)i+=this.tok();return this.renderer.list(i,l,o);case"list_item_start":for(i="";"list_item_end"!==this.next().type;)i+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(i);case"loose_item_start":for(i="";"list_item_end"!==this.next().type;)i+=this.tok();return this.renderer.listitem(i);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var c={},g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(){}function d(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function b(e,t,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(r||"function"==typeof t){r||(r=t,t=null);var s,i,l=(t=d({},b.defaults,t||{})).highlight,h=0;try{s=n.lex(e,t)}catch(e){return r(e)}i=s.length;var p=function(e){if(e)return t.highlight=l,r(e);var n;try{n=o.parse(s,t)}catch(t){e=t}return t.highlight=l,e?r(e):r(null,n)};if(!l||l.length<3)return p();if(delete t.highlight,!i)return p();for(;h<s.length;h++)!function(e){"code"!==e.type?--i||p():l(e.text,e.lang,function(t,n){return t?p(t):null==n||n===e.text?--i||p():(e.text=n,e.escaped=!0,void(--i||p()))})}(s[h])}else try{return t&&(t=d({},b.defaults,t)),o.parse(n.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||b.defaults).silent)return"<p>An error occurred:</p><pre>"+a(e.message+"",!0)+"</pre>";throw e}}f.exec=f,b.options=b.setOptions=function(e){return d(b.defaults,e),b},b.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"lang-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},b.defaults=b.getDefaults(),b.Parser=o,b.parser=o.parse,b.Renderer=i,b.TextRenderer=l,b.Lexer=n,b.lexer=n.lex,b.InlineLexer=s,b.inlineLexer=s.output,b.parse=b,"undefined"!=typeof module&&"object"==typeof exports?module.exports=b:"function"==typeof define&&define.amd?define(function(){return b}):e.marked=b}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||m.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=/<!--(?!-?>)[\s\S]*?-->/,t.html=p(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.pedantic=d({},t.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p<c;p++)h=(a=i[p]).length,~(a=a.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(h-=a.length,a=this.options.pedantic?a.replace(/^ {1,4}/gm,""):a.replace(new RegExp("^ {1,"+h+"}","gm"),"")),this.options.smartLists&&p!==c-1&&(l===(o=t.bullet.exec(i[p+1])[0])||l.length>1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(n&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var r={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,em:/^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function s(e,t){if(this.options=t||m.defaults,this.links=e,this.rules=r.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=r.pedantic:this.options.gfm&&(this.options.breaks?this.rules=r.breaks:this.rules=r.gfm)}function i(e){this.options=e||m.defaults}function l(){}function o(e){this.tokens=[],this.token=null,this.options=e||m.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r.tag=p(r.tag).replace("comment",t._comment).replace("attribute",r._attribute).getRegex(),r._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,r._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/,r._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r.link=p(r.link).replace("label",r._label).replace("href",r._href).replace("title",r._title).getRegex(),r.reflink=p(r.reflink).replace("label",r._label).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:{exec:function(e){var t=p(/^!?\[(label)\]\((.*?)\)/).replace("label",r._label).getRegex().exec(e);if(!t)return null;var n=t[1],s=function(e){for(var t=[/^([^'"(]*[^\s])\s+(['"(].*['")])/,/^(<?[\s\S]*>?)/],n=!1,r=0;r<t.length&&!(n=t[r].exec(e));r++);if(!n)return null;var s,i=n[1],l=n[2]||"";return i=i.trim(),(s=i).match(/^<.*>$/)&&(s=s.slice(1,-1)),[i=s,l]}(t[2]);return s?[t[0],n,s[0],s[1]]:null}},reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r._label).getRegex()}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,i,l,o="";e;)if(l=this.rules.escape.exec(e))e=e.substring(l[0].length),o+=l[1];else if(l=this.rules.autolink.exec(e))e=e.substring(l[0].length),r="@"===l[2]?"mailto:"+(n=a(this.mangle(l[1]))):n=a(l[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(l=this.rules.url.exec(e))){if(l=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(l[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(l[0])&&(this.inLink=!1),e=e.substring(l[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):a(l[0]):l[0];else if(l=this.rules.link.exec(e))e=e.substring(l[0].length),this.inLink=!0,r="<"===(r=l[2])[0]?r.substring(1,r.length-1):r,i=l[3]?l[3].substring(1,l[3].length-1):l[3],o+=this.outputLink(l,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1;else if((l=this.rules.reflink.exec(e))||(l=this.rules.nolink.exec(e))){if(e=e.substring(l[0].length),t=(l[2]||l[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=l[0].charAt(0),e=l[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(l,t),this.inLink=!1}else if(l=this.rules.strong.exec(e))e=e.substring(l[0].length),o+=this.renderer.strong(this.output(l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.em.exec(e))e=e.substring(l[0].length),o+=this.renderer.em(this.output(l[6]||l[5]||l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.code.exec(e))e=e.substring(l[0].length),o+=this.renderer.codespan(a(l[2].trim(),!0));else if(l=this.rules.br.exec(e))e=e.substring(l[0].length),o+=this.renderer.br();else if(l=this.rules.del.exec(e))e=e.substring(l[0].length),o+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(e))e=e.substring(l[0].length),o+=this.renderer.text(a(this.smartypants(l[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else l[0]=this.rules._backpedal.exec(l[0])[0],e=e.substring(l[0].length),"@"===l[2]?r="mailto:"+(n=a(l[0])):(n=a(l[0]),r="www."===l[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s<r;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='<a href="'+a(e)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>"},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(s+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});i+=this.renderer.tablerow(n)}return this.renderer.table(s,i);case"blockquote_start":for(i="";"blockquote_end"!==this.next().type;)i+=this.tok();return this.renderer.blockquote(i);case"list_start":i="";for(var l=this.token.ordered,o=this.token.start;"list_end"!==this.next().type;)i+=this.tok();return this.renderer.list(i,l,o);case"list_item_start":for(i="";"list_item_end"!==this.next().type;)i+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(i);case"loose_item_start":for(i="";"list_item_end"!==this.next().type;)i+=this.tok();return this.renderer.listitem(i);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var c={},g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(){}function d(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function m(e,t,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(r||"function"==typeof t){r||(r=t,t=null);var s,i,l=(t=d({},m.defaults,t||{})).highlight,h=0;try{s=n.lex(e,t)}catch(e){return r(e)}i=s.length;var p=function(e){if(e)return t.highlight=l,r(e);var n;try{n=o.parse(s,t)}catch(t){e=t}return t.highlight=l,e?r(e):r(null,n)};if(!l||l.length<3)return p();if(delete t.highlight,!i)return p();for(;h<s.length;h++)!function(e){"code"!==e.type?--i||p():l(e.text,e.lang,function(t,n){return t?p(t):null==n||n===e.text?--i||p():(e.text=n,e.escaped=!0,void(--i||p()))})}(s[h])}else try{return t&&(t=d({},m.defaults,t)),o.parse(n.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||m.defaults).silent)return"<p>An error occurred:</p><pre>"+a(e.message+"",!0)+"</pre>";throw e}}f.exec=f,m.options=m.setOptions=function(e){return d(m.defaults,e),m},m.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"lang-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},m.defaults=m.getDefaults(),m.Parser=o,m.parser=o.parse,m.Renderer=i,m.TextRenderer=l,m.Lexer=n,m.lexer=n.lex,m.InlineLexer=s,m.inlineLexer=s.output,m.parse=m,"undefined"!=typeof module&&"object"==typeof exports?module.exports=m:"function"==typeof define&&define.amd?define(function(){return m}):e.marked=m}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file From 02b13432f1af96c08f02ec3996033b8058e02598 Mon Sep 17 00:00:00 2001 From: Jamie Davis <davisjam@vt.edu> Date: Sun, 15 Apr 2018 17:18:43 -0400 Subject: [PATCH 418/459] test: security scan - 'npm run test:redos' now scans for REDOS issues - added a Travis stage for 'security scan' Fixes: #1201 (a step towards it, anyway) --- .travis.yml | 4 + package-lock.json | 211 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 + 3 files changed, 217 insertions(+) diff --git a/.travis.yml b/.travis.yml index a1013223..e479e620 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,10 @@ jobs: - node_js: lts/* - node_js: node + - stage: security scan + script: npm run test:redos + node_js: lts/* + - stage: lint ✨ script: npm run test:lint node_js: lts/* diff --git a/package-lock.json b/package-lock.json index d30c3bdb..7a361a37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,36 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@types/concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-OU2+C7X+5Gs42JZzXoto7yOQ0A0=", + "dev": true, + "requires": { + "@types/node": "9.6.5" + } + }, + "@types/form-data": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", + "integrity": "sha1-yayFsqX9GENbjIXZ7LUObWyJP/g=", + "dev": true, + "requires": { + "@types/node": "9.6.5" + } + }, + "@types/node": { + "version": "9.6.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.5.tgz", + "integrity": "sha512-NOLEgsT6UiDTjnWG5Hd2Mg25LRyz/oe8ql3wbjzgSFeRzRROhPmtlsvIrei4B46UjERF0td9SZ1ZXPLOdcrBHg==", + "dev": true + }, + "@types/qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-mNhVdZHdtKHMMxbqzNK3RzkBcN1cux3AvuCYGTvjEIQT2uheH3eCAyYsbMbh2Bq8nXkeOWs1kyDiF7geWRFQ4Q==", + "dev": true + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -99,6 +129,18 @@ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", @@ -147,6 +189,12 @@ "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", @@ -223,6 +271,15 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, "commander": { "version": "2.14.1", "resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz", @@ -357,6 +414,12 @@ } } }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, "diff": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/diff/-/diff-1.0.8.tgz", @@ -662,6 +725,16 @@ "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=", "dev": true }, + "eslint-plugin-vuln-regex-detector": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-vuln-regex-detector/-/eslint-plugin-vuln-regex-detector-1.0.4.tgz", + "integrity": "sha512-MlGNEvfk/lmHrbp6gIXKP2NPedA+wX2+KwezolXLE6t9q0pcmohkYm2EKmgL9z5n57CAIYFJ/I4SSI3ANWyl/A==", + "dev": true, + "requires": { + "requireindex": "1.1.0", + "vuln-regex-detector": "1.3.0" + } + }, "eslint-scope": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", @@ -833,6 +906,17 @@ } } }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.6", + "mime-types": "2.1.18" + } + }, "front-matter": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-2.3.0.tgz", @@ -866,6 +950,12 @@ "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", "dev": true }, + "get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", + "dev": true + }, "get-stdin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", @@ -1040,6 +1130,29 @@ } } }, + "http-basic": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-7.0.0.tgz", + "integrity": "sha1-gvClBr6UJzLsje6+6A50bvVzbbo=", + "dev": true, + "requires": { + "@types/concat-stream": "1.6.0", + "@types/node": "9.6.5", + "caseless": "0.12.0", + "concat-stream": "1.6.0", + "http-response-object": "3.0.1", + "parse-cache-control": "1.0.1" + } + }, + "http-response-object": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.1.tgz", + "integrity": "sha512-6L0Fkd6TozA8kFSfh9Widst0wfza3U1Ex2RjJ6zNDK0vR1U1auUR6jY4Nn2Xl7CCy0ikFmxW1XcspVpb9RvwTg==", + "dev": true, + "requires": { + "@types/node": "9.6.5" + } + }, "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", @@ -1395,6 +1508,21 @@ "mimic-fn": "1.1.0" } }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "requires": { + "mime-db": "1.33.0" + } + }, "mimic-fn": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", @@ -1557,6 +1685,12 @@ "p-limit": "1.1.0" } }, + "parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha1-juqz5U+laSD+Fro493+iGqzC104=", + "dev": true + }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -1686,6 +1820,15 @@ "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", "dev": true }, + "promise": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.0.1.tgz", + "integrity": "sha1-5F1osAoXZHttpxG/he1u1HII9FA=", + "dev": true, + "requires": { + "asap": "2.0.6" + } + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -1698,6 +1841,12 @@ "integrity": "sha1-TeLmyzspCIyeTLwDv51C+5bOL3U=", "dev": true }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "dev": true + }, "read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", @@ -1741,6 +1890,12 @@ "resolve-from": "1.0.1" } }, + "requireindex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.1.0.tgz", + "integrity": "sha1-5UBLgVV+91225JxacgBIk/4D4WI=", + "dev": true + }, "resolve": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", @@ -2034,6 +2189,26 @@ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, + "sync-request": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.0.0.tgz", + "integrity": "sha512-jGNIAlCi9iU4X3Dm4oQnNQshDD3h0/1A7r79LyqjbjUnj69sX6mShAXlhRXgImsfVKtTcnra1jfzabdZvp+Lmw==", + "dev": true, + "requires": { + "http-response-object": "3.0.1", + "sync-rpc": "1.3.3", + "then-request": "6.0.0" + } + }, + "sync-rpc": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.3.tgz", + "integrity": "sha512-xtTZUAeFaescZALim6yqjMDsVQD7mKAkdZ0/FOvVjlrr4uQqrARlWxs4P7bKV2ZPnvOyTVyHyyxqztxtBF4iIw==", + "dev": true, + "requires": { + "get-port": "3.2.0" + } + }, "table": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", @@ -2091,6 +2266,33 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "then-request": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.0.tgz", + "integrity": "sha512-xA+7uEMc+jsQIoyySJ93Ad08Kuqnik7u6jLS5hR91Z3smAoCfL3M8/MqMlobAa9gzBfO9pA88A/AntfepkkMJQ==", + "dev": true, + "requires": { + "@types/concat-stream": "1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "8.10.8", + "@types/qs": "6.5.1", + "caseless": "0.12.0", + "concat-stream": "1.6.0", + "form-data": "2.3.2", + "http-basic": "7.0.0", + "http-response-object": "3.0.1", + "promise": "8.0.1", + "qs": "6.5.1" + }, + "dependencies": { + "@types/node": { + "version": "8.10.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.8.tgz", + "integrity": "sha512-BvcUxNZe9JgiiUVivtiQt3NrPVu9OAQzkxR1Ko9ESftCYU7V6Np5kpDzQwxd+34lsop7SNRdL292Flv52OvCaw==", + "dev": true + } + } + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -2198,6 +2400,15 @@ "integrity": "sha1-qbVhR3x+pdVjsMqqUuQOZo3gwjg=", "dev": true }, + "vuln-regex-detector": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/vuln-regex-detector/-/vuln-regex-detector-1.3.0.tgz", + "integrity": "sha512-QWm8buVznZjdcfMuFHYsiNfHd0YQ7dO41G0iEGVPlUng5eZUo8uy+QsVCmbgVZ2b96xprY1Tz9dQD7QtvbFHXw==", + "dev": true, + "requires": { + "sync-request": "6.0.0" + } + }, "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", diff --git a/package.json b/package.json index 5ebeef7e..c0cfef69 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "eslint-plugin-node": "^5.2.1", "eslint-plugin-promise": "^3.6.0", "eslint-plugin-standard": "^3.0.1", + "eslint-plugin-vuln-regex-detector": "^1.0.4", "front-matter": "^2.3.0", "glob-to-regexp": "0.3.0", "html-differ": "^1.3.4", @@ -47,6 +48,7 @@ "test:gfm": "npm test -- test/specs/gfm/**/*-spec.js", "test:old": "node test", "test:lint": "eslint bin/marked .", + "test:redos": "eslint --plugin vuln-regex-detector --rule '\"vuln-regex-detector/no-vuln-regex\": 2' lib/marked.js", "bench": "node test --bench", "lint": "eslint --fix bin/marked .", "build": "uglifyjs lib/marked.js -cm --comments /Copyright/ -o marked.min.js", From 090debd9b4e9c865ea64a3085d8a0933970e3954 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 16 Apr 2018 21:51:28 -0500 Subject: [PATCH 419/459] move processing --- lib/marked.js | 81 ++++++++++----------------------------------------- 1 file changed, 16 insertions(+), 65 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 1ecfc3ee..7128ebdd 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -554,68 +554,9 @@ inline.normal = merge({}, inline); inline.pedantic = merge({}, inline.normal, { strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, - /* Original link re: /^!?\[(label)\]\(\s*<?([\s\S]*?)>?(?:\s+(['"][\s\S]*?['"]))?\s*\)/ - * This captures the spec reasonably well but is vulnerable to REDOS. - * Instead we use a custom parser that follows the RegExp.exec semantics. */ - link: { - exec: function (s) { - // [TEXT](DESTINATION) - var generalLinkRe = edit(/^!?\[(label)\]\((.*?)\)/) - .replace('label', inline._label) - .getRegex(); - - // destination: DESTINATION from generalLinkRe - // returns [destination, title]: no angle-brackets on destination, no quotes on title - function splitIntoDestinationAndTitle (destination) { - function unwrapAngleBrackets (str) { - if (str.match(/^<.*>$/)) { - str = str.slice(1, -1); - } - return str; - } - - // Valid DESTINATIONs, in decreasing specificity. - var destinationAndTitleRe = /^([^'"(]*[^\s])\s+(['"(].*['")])/; - var destinationRe = /^(<?[\s\S]*>?)/; - var parsingRegexes = [destinationAndTitleRe, destinationRe]; - - var match = false; - for (var i = 0; i < parsingRegexes.length; i++) { - match = parsingRegexes[i].exec(destination); - if (match) { - break; - } - } - - if (!match) { - return null; - } - - var dest = match[1]; - var title = match[2] || ''; // Not all parsingRegexes have 2 groups. - - // Format dest. - dest = dest.trim(); - dest = unwrapAngleBrackets(dest); - - return [dest, title]; - } - - var fullMatch = generalLinkRe.exec(s); - if (!fullMatch) { - return null; - } - - var text = fullMatch[1]; - var destination = fullMatch[2]; - - var destinationAndTitle = splitIntoDestinationAndTitle(destination); - if (!destinationAndTitle) { - return null; - } - return [fullMatch[0], text, destinationAndTitle[0], destinationAndTitle[1]]; - } - }, + link: edit(/^!?\[(label)\]\((.*?)\)/) + .replace('label', inline._label) + .getRegex(), reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) .replace('label', inline._label) .getRegex() @@ -761,9 +702,19 @@ InlineLexer.prototype.output = function(src) { if (cap = this.rules.link.exec(src)) { src = src.substring(cap[0].length); this.inLink = true; - href = cap[2]; - href = href[0] === '<' ? href.substring(1, href.length - 1) : href; - title = cap[3] ? cap[3].substring(1, cap[3].length - 1) : cap[3]; + href = cap[2].trim(); + if (this.options.pedantic) { + link = /^([^'"(]*[^\s])\s+(['"(].*['")])/.exec(href); + + if (link) { + href = link[1]; + title = link[2].trim().slice(1, -1); + } + href = href.trim(); + } else { + title = cap[3] ? cap[3].slice(1, -1) : cap[3]; + } + href = href[0] === '<' ? href.slice(1, -1) : href; out += this.outputLink(cap, { href: InlineLexer.escapes(href), title: InlineLexer.escapes(title) From 4b7cfbe8f2126f1724ce87371adddfd944da8157 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 16 Apr 2018 22:05:02 -0500 Subject: [PATCH 420/459] remove unnecessary trim --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 7128ebdd..de2cf88e 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -702,7 +702,7 @@ InlineLexer.prototype.output = function(src) { if (cap = this.rules.link.exec(src)) { src = src.substring(cap[0].length); this.inLink = true; - href = cap[2].trim(); + href = cap[2]; if (this.options.pedantic) { link = /^([^'"(]*[^\s])\s+(['"(].*['")])/.exec(href); From 5bc83ea8a6dcebd2e35ee7971f81800a03039322 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 16 Apr 2018 22:16:36 -0500 Subject: [PATCH 421/459] fix href `<` --- lib/marked.js | 2 +- test/new/link_lt.html | 1 + test/new/link_lt.md | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 test/new/link_lt.html create mode 100644 test/new/link_lt.md diff --git a/lib/marked.js b/lib/marked.js index de2cf88e..7845b6b1 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -714,7 +714,7 @@ InlineLexer.prototype.output = function(src) { } else { title = cap[3] ? cap[3].slice(1, -1) : cap[3]; } - href = href[0] === '<' ? href.slice(1, -1) : href; + href = href.replace(/^<([\s\S]*)>$/, '$1'); out += this.outputLink(cap, { href: InlineLexer.escapes(href), title: InlineLexer.escapes(title) diff --git a/test/new/link_lt.html b/test/new/link_lt.html new file mode 100644 index 00000000..ea48caa9 --- /dev/null +++ b/test/new/link_lt.html @@ -0,0 +1 @@ +<p><a href="%3Ctest">URL</a></p> diff --git a/test/new/link_lt.md b/test/new/link_lt.md new file mode 100644 index 00000000..f4f9addd --- /dev/null +++ b/test/new/link_lt.md @@ -0,0 +1 @@ +[URL](<test) From 750563bf60fa05add47d6c57931cbc4e8db708d4 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Mon, 16 Apr 2018 22:59:40 -0500 Subject: [PATCH 422/459] show failing test when original tests takes > 1s --- test/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/index.js b/test/index.js index 0604364d..f6395ce8 100644 --- a/test/index.js +++ b/test/index.js @@ -111,12 +111,9 @@ function runTests(engine, options) { filename = filenames[i]; file = files[filename]; - var before = process.hrtime(); success = testFile(engine, file, filename, i + 1); - var elapsed = process.hrtime(before); - var tookLessThanOneSec = (elapsed[0] === 0); - if (success && tookLessThanOneSec) { + if (success) { succeeded++; } else { failed++; @@ -198,6 +195,11 @@ function testFile(engine, file, filename, index) { } } + if (elapsed[0] !== 0) { + console.log(' failed because it took too long.\n\n passed in %dms', prettyElapsedTime(elapsed)); + return false; + } + console.log(' passed in %dms', prettyElapsedTime(elapsed)); return true; } From 422e81f2d9661f5ffdd6058672ae5e90f2eb1562 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Tue, 17 Apr 2018 08:15:06 -0500 Subject: [PATCH 423/459] > 0 --- test/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index f6395ce8..6a617382 100644 --- a/test/index.js +++ b/test/index.js @@ -195,7 +195,7 @@ function testFile(engine, file, filename, index) { } } - if (elapsed[0] !== 0) { + if (elapsed[0] > 0) { console.log(' failed because it took too long.\n\n passed in %dms', prettyElapsedTime(elapsed)); return false; } From de0c8b4673de131f2753f95dd3838a0018b944dd Mon Sep 17 00:00:00 2001 From: Jamie Davis <davisjam@vt.edu> Date: Tue, 17 Apr 2018 09:25:27 -0400 Subject: [PATCH 424/459] address review comments: cool symbol --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e479e620..23281180 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ jobs: - node_js: lts/* - node_js: node - - stage: security scan + - stage: security scan 🔐 script: npm run test:redos node_js: lts/* From 5aed7249b1de672f04568312789b3e54936a4bab Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Tue, 17 Apr 2018 09:43:47 -0500 Subject: [PATCH 425/459] remove () around pedantic title --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 7845b6b1..eb8faefc 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -704,11 +704,11 @@ InlineLexer.prototype.output = function(src) { this.inLink = true; href = cap[2]; if (this.options.pedantic) { - link = /^([^'"(]*[^\s])\s+(['"(].*['")])/.exec(href); + link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); if (link) { href = link[1]; - title = link[2].trim().slice(1, -1); + title = link[3]; } href = href.trim(); } else { From 686999863864679ac25016574a9b064a4498fb1f Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Tue, 17 Apr 2018 13:27:18 -0500 Subject: [PATCH 426/459] set title to empty string --- lib/marked.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index eb8faefc..1fe8ba45 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -709,12 +709,13 @@ InlineLexer.prototype.output = function(src) { if (link) { href = link[1]; title = link[3]; + } else { + title = ''; } - href = href.trim(); } else { - title = cap[3] ? cap[3].slice(1, -1) : cap[3]; + title = cap[3] ? cap[3].slice(1, -1) : ''; } - href = href.replace(/^<([\s\S]*)>$/, '$1'); + href = href.trim().replace(/^<([\s\S]*)>$/, '$1'); out += this.outputLink(cap, { href: InlineLexer.escapes(href), title: InlineLexer.escapes(title) From a8dc412b1e7cf5ca7fefb08ef2821269b0e3a0c3 Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Thu, 19 Apr 2018 16:46:06 -0600 Subject: [PATCH 427/459] Add self from OUJS Organization to AUTHORS.md Technically this makes me a Contributor according to GH ;) LOL j/k I do what I can when I can. :) <!-- If release PR, add ?template=release.md to the PR url to use the release PR template. If badging PR, add ?template=badges.md to the PR url to use the badges PR template. Otherwise, you are stating this PR fixes an issue that has been submitted; or, describes the issue or proposal under consideration and contains the project-related code to implement. --> **Marked version:** 0.3.19 <!-- The NPM version or commit hash having the issue --> **Markdown flavor:** Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a GitHub Flavored Markdown *(Perhaps CommonMark down the line)* ## Description - Fixes the request at https://github.com/markedjs/marked/issues/1232#issuecomment-382747699 <!-- (if fixing a known issue; otherwise, describe issue using the following format) --> <!-- If no issue exists that you're aware of. The maintainers should be able to figure out if it's a duplicate. --> ## Expectation <!-- Describe the output you are expecting from marked --> GitHub Flavoured Markdown of course. ## Result <!-- Describe the output you received from marked --> Continued, awesome, markdown for > ~9437 users ... denoted. ## What was attempted <!-- Describe what code combination got you there --> A subtle, indirect, request for Usership addition in a comment. :) Hopefully I got the badge of honour correct. ## Contributor - [ ] Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or, - [ ] no tests required for this PR. - [ ] If submitting new feature, it has been documented in the appropriate places. ## Committer In most cases, this should be a different person than the contributor. - [ ] Draft GitHub release notes have been updated. - [ ] CI is green (no forced merge required). - [ ] Merge PR --- docs/AUTHORS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index b4a9a9ed..1094d419 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -6,6 +6,10 @@ Marked takes an encompassing approach to its community. As such, you can think o Users are anyone using Marked in some fashion, without them, there's no reason for us to exist. +|Name |GiHub handle |Decision making |Badges of honor (tag for questions) | +|:--------------|:--------------|:--------------------------------------------------|------------------------------------| +|Marti Martz |@Martii |@OpenUserJS.org Co-Owner/Project Active Maintainer |Grateful users of this fine project | + To be listed: please let us know or submit a PR. To be removed: please let us know or submit a PR. From 8d738ee761c49e5623d1ae4dccf31e5674bcfff4 Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Thu, 19 Apr 2018 16:53:31 -0600 Subject: [PATCH 428/459] Add some whitespace so CSS can break some words a bit * Hopefully --- docs/AUTHORS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 1094d419..0326c401 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -6,9 +6,9 @@ Marked takes an encompassing approach to its community. As such, you can think o Users are anyone using Marked in some fashion, without them, there's no reason for us to exist. -|Name |GiHub handle |Decision making |Badges of honor (tag for questions) | -|:--------------|:--------------|:--------------------------------------------------|------------------------------------| -|Marti Martz |@Martii |@OpenUserJS.org Co-Owner/Project Active Maintainer |Grateful users of this fine project | +|Name |GiHub handle |Decision making |Badges of honor (tag for questions) | +|:--------------|:--------------|:----------------------------------------------------|------------------------------------| +|Marti Martz |@Martii |@OpenUserJS.org Co-Owner / Project Active Maintainer |Grateful users of this fine project | To be listed: please let us know or submit a PR. From cf8d79f404936131776b35f77f80af2a5f655b23 Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Thu, 19 Apr 2018 17:08:58 -0600 Subject: [PATCH 429/459] Fix badge to known plays * Per https://github.com/markedjs/marked/blob/8d738ee761c49e5623d1ae4dccf31e5674bcfff4/docs/AUTHORS.md#badges NOTES: * Sorry... less gratitude this way I think but will comply. :) --- docs/AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 0326c401..babe2fbe 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -8,7 +8,7 @@ Users are anyone using Marked in some fashion, without them, there's no reason f |Name |GiHub handle |Decision making |Badges of honor (tag for questions) | |:--------------|:--------------|:----------------------------------------------------|------------------------------------| -|Marti Martz |@Martii |@OpenUserJS.org Co-Owner / Project Active Maintainer |Grateful users of this fine project | +|Marti Martz |@Martii |@OpenUserJS.org Co-Owner / Project Active Maintainer |Open source, of course | To be listed: please let us know or submit a PR. From 9d5dd76cb0acb0d5123ba5065b68d1371f16cb4b Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Thu, 19 Apr 2018 17:10:16 -0600 Subject: [PATCH 430/459] Put linkage in this header for badges --- docs/AUTHORS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index babe2fbe..15f97ad2 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -14,6 +14,8 @@ To be listed: please let us know or submit a PR. To be removed: please let us know or submit a PR. +[Details on badges](#badges) + ## Contributors Contributors are users who submit a [PR](https://github.com/markedjs/marked/pulls), [Issue](https://github.com/markedjs/marked/issues), or collaborate in making Marked a better product and experience for all the users. From 63a29816131710c9985cc8ad56e6f107c65e22d4 Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Thu, 19 Apr 2018 17:19:20 -0600 Subject: [PATCH 431/459] Fix whitespace to match current .editorconfig * Usually this is set to these values but I turned it off for this PR in case it blew up GH md. Had this happen once on another project. So crosses-fingers and things Ref: * https://github.com/markedjs/marked/blob/92f0ae232f48440cc1fbdcf91b7e3d87226ae05d/.editorconfig --- docs/AUTHORS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 15f97ad2..d2ce198e 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -98,7 +98,7 @@ Christopher Jeffrey @chjj <h2 id="badges">Badges</h2> -Badges? You don't *need* no stinkin' badges. +Badges? You don't *need* no stinkin' badges. Movie references aside. (It was either that or, "Let's play a game", but that would have been creepy…that's why it will most likely come later.) @@ -115,7 +115,7 @@ Badges? If you *want* 'em, we got 'em, and here's how you get 'em (and…dr <dd>A contributor with less than one year on this page who is actively engaged in submitting PRs, Issues, making recommendations, sharing thoughts…without being too annoying about it (let's be clear, submitting 100 Issues recommending the Marked Committers send everyone candy is trying for the badge, not honestly earning it).</dd> <dt>Dr. DevOps</dt> <dd> - <p>Someone who understands and contributes to improving the developer experience and flow of Marked into the world.</p> + <p>Someone who understands and contributes to improving the developer experience and flow of Marked into the world.</p> <blockquote> "The main characteristic of the DevOps movement is to strongly advocate automation and monitoring at all steps of software construction, from integration, testing, releasing to deployment and infrastructure management. DevOps aims at shorter development cycles, increased deployment frequency, more dependable releases, in close alignment with business objectives." ~ <a href="https://en.wikipedia.org/wiki/DevOps">Wikipedia</a> </blockquote> From 33ada902549b068e63ef56acf4f2af20fdbd9262 Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Thu, 19 Apr 2018 17:51:37 -0600 Subject: [PATCH 432/459] Let Wikipedia decide which language to show * Wikipedia has their own redirects for browser language used for this link * Also lets portables redirect to mobile page if available. --- docs/AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index d2ce198e..8d8a0998 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -117,7 +117,7 @@ Badges? If you *want* 'em, we got 'em, and here's how you get 'em (and…dr <dd> <p>Someone who understands and contributes to improving the developer experience and flow of Marked into the world.</p> <blockquote> - "The main characteristic of the DevOps movement is to strongly advocate automation and monitoring at all steps of software construction, from integration, testing, releasing to deployment and infrastructure management. DevOps aims at shorter development cycles, increased deployment frequency, more dependable releases, in close alignment with business objectives." ~ <a href="https://en.wikipedia.org/wiki/DevOps">Wikipedia</a> + "The main characteristic of the DevOps movement is to strongly advocate automation and monitoring at all steps of software construction, from integration, testing, releasing to deployment and infrastructure management. DevOps aims at shorter development cycles, increased deployment frequency, more dependable releases, in close alignment with business objectives." ~ <a href="https://www.wikipedia.org/wiki/DevOps">Wikipedia</a> </blockquote> </dd> <dt>Eye for the CLI</dt> From e717846d0f2b00aa90d4600cd7795e2a0f4a09b3 Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Thu, 19 Apr 2018 18:22:19 -0600 Subject: [PATCH 433/459] Drop `@` symbol in our project... * Don't know what I was thinking. :) okay enough O.C. for now. --- docs/AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 8d8a0998..12d5609c 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -8,7 +8,7 @@ Users are anyone using Marked in some fashion, without them, there's no reason f |Name |GiHub handle |Decision making |Badges of honor (tag for questions) | |:--------------|:--------------|:----------------------------------------------------|------------------------------------| -|Marti Martz |@Martii |@OpenUserJS.org Co-Owner / Project Active Maintainer |Open source, of course | +|Marti Martz |@Martii |OpenUserJS.org Co-Owner / Project Active Maintainer |Open source, of course | To be listed: please let us know or submit a PR. From a9614161121618268e09d6cb5593513d9c56897f Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Thu, 19 Apr 2018 18:47:07 -0600 Subject: [PATCH 434/459] Refactor GFM tabling to suggested --- docs/AUTHORS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 12d5609c..6b8fa9fe 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -6,9 +6,9 @@ Marked takes an encompassing approach to its community. As such, you can think o Users are anyone using Marked in some fashion, without them, there's no reason for us to exist. -|Name |GiHub handle |Decision making |Badges of honor (tag for questions) | -|:--------------|:--------------|:----------------------------------------------------|------------------------------------| -|Marti Martz |@Martii |OpenUserJS.org Co-Owner / Project Active Maintainer |Open source, of course | +|Individual or Organization |Website |Submitted by | +|:------------------------------|:--------------------------|:-----------------------------------------------------------| +|@OpenUserJS |https://openuserjs.org | Marti Martz (@Martii) Co-Owner / Project Active Maintainer | To be listed: please let us know or submit a PR. From 49839e12548c9f905876d3734ebec0b1fcd36e32 Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Thu, 19 Apr 2018 19:09:32 -0600 Subject: [PATCH 435/459] Trying another suggested column * No badge column now so remove linkage reference * Not everyone's project name matches their DN so that's why I put the `@` symbol in for the Organization *(username on GH)* --- docs/AUTHORS.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 6b8fa9fe..398efa8e 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -6,16 +6,14 @@ Marked takes an encompassing approach to its community. As such, you can think o Users are anyone using Marked in some fashion, without them, there's no reason for us to exist. -|Individual or Organization |Website |Submitted by | -|:------------------------------|:--------------------------|:-----------------------------------------------------------| -|@OpenUserJS |https://openuserjs.org | Marti Martz (@Martii) Co-Owner / Project Active Maintainer | +|Individual or Organization |Project |Website |Submitted by | +|:------------------------------|:--------------------------|:--------------------------|:-----------------------------------------------------------| +|@OpenUserJS |OpenUserJS.org |https://openuserjs.org | Marti Martz (@Martii) Co-Owner / Project Active Maintainer | To be listed: please let us know or submit a PR. To be removed: please let us know or submit a PR. -[Details on badges](#badges) - ## Contributors Contributors are users who submit a [PR](https://github.com/markedjs/marked/pulls), [Issue](https://github.com/markedjs/marked/issues), or collaborate in making Marked a better product and experience for all the users. From d95b1dccf52d26adb3c83811ac20b3c8d5e944c8 Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Thu, 19 Apr 2018 19:50:25 -0600 Subject: [PATCH 436/459] Reorder table columns * This is the nomenclature and the compromise that can remove the `@` symbol by linking... similar to mentioning GH teams * Using relative URLS unless you plan on putting this on a custom domain * Since no-one elses `@`nick mention is hyperlinked not doing mine for symmetry * Not everyones project is hosted on GH btw... so `Project` is neutral... typically we use the word `Development` --- docs/AUTHORS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 398efa8e..b1df2e5b 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -6,9 +6,9 @@ Marked takes an encompassing approach to its community. As such, you can think o Users are anyone using Marked in some fashion, without them, there's no reason for us to exist. -|Individual or Organization |Project |Website |Submitted by | -|:------------------------------|:--------------------------|:--------------------------|:-----------------------------------------------------------| -|@OpenUserJS |OpenUserJS.org |https://openuserjs.org | Marti Martz (@Martii) Co-Owner / Project Active Maintainer | +|Individual or Organization |Website |Project |Submitted by | +|:------------------------------|:--------------------------|:------------------------------------------------|:-----------------------------------------------------------| +|[OpenUserJS](/OpenUserJS) |https://openuserjs.org |[OpenUserJS.org](/OpenUserJS/OpenUserJS.org) | Marti Martz (@Martii) Co-Owner / Project Active Maintainer | To be listed: please let us know or submit a PR. From e752ed25503447de596a55056688ac675849c0dd Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Thu, 19 Apr 2018 19:54:39 -0600 Subject: [PATCH 437/459] Don't use relative urls * GFM is doing interesting things with md --- docs/AUTHORS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index b1df2e5b..6ffdf006 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -6,9 +6,9 @@ Marked takes an encompassing approach to its community. As such, you can think o Users are anyone using Marked in some fashion, without them, there's no reason for us to exist. -|Individual or Organization |Website |Project |Submitted by | -|:------------------------------|:--------------------------|:------------------------------------------------|:-----------------------------------------------------------| -|[OpenUserJS](/OpenUserJS) |https://openuserjs.org |[OpenUserJS.org](/OpenUserJS/OpenUserJS.org) | Marti Martz (@Martii) Co-Owner / Project Active Maintainer | +|Individual or Organization |Website |Project |Submitted by | +|:-------------------------------------------|:--------------------------|:------------------------------------------------|:-----------------------------------------------------------| +|[OpenUserJS](https://github.com/OpenUserJS) |https://openuserjs.org |[OpenUserJS.org](https://github.com/OpenUserJS/OpenUserJS.org) | Marti Martz (@Martii) Co-Owner / Project Active Maintainer | To be listed: please let us know or submit a PR. From 955af4c0293e6a90094f324df60ea6507c3fdb43 Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Thu, 19 Apr 2018 20:00:24 -0600 Subject: [PATCH 438/459] Since Project column exists remove extra text --- docs/AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 6ffdf006..ff2598dc 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -8,7 +8,7 @@ Users are anyone using Marked in some fashion, without them, there's no reason f |Individual or Organization |Website |Project |Submitted by | |:-------------------------------------------|:--------------------------|:------------------------------------------------|:-----------------------------------------------------------| -|[OpenUserJS](https://github.com/OpenUserJS) |https://openuserjs.org |[OpenUserJS.org](https://github.com/OpenUserJS/OpenUserJS.org) | Marti Martz (@Martii) Co-Owner / Project Active Maintainer | +|[OpenUserJS](https://github.com/OpenUserJS) |https://openuserjs.org |[OpenUserJS.org](https://github.com/OpenUserJS/OpenUserJS.org) | Marti Martz (@Martii) Co-Owner / Active Maintainer | To be listed: please let us know or submit a PR. From 74ee8c1ec88c2d7986c92bdb8f177bd195b22b6d Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@joshbruce.com> Date: Fri, 20 Apr 2018 10:16:21 -0400 Subject: [PATCH 439/459] Updated users, try to get Snyk to kick over --- docs/AUTHORS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 99c8ebb7..2a1f9094 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -6,9 +6,9 @@ Marked takes an encompassing approach to its community. As such, you can think o Users are anyone using Marked in some fashion, without them, there's no reason for us to exist. -|Individual or Organization |Website |Project |Submitted by | -|:-------------------------------------------|:--------------------------|:------------------------------------------------|:-----------------------------------------------------------| -|[OpenUserJS](https://github.com/OpenUserJS) |https://openuserjs.org |[OpenUserJS.org](https://github.com/OpenUserJS/OpenUserJS.org) | Marti Martz (@Martii) Co-Owner / Active Maintainer | +|Individual or Organization |Website |GitHub project |Submitted by | +|:--------------------------|:----------------------|:--------------------------------------------------------------|:---------------------------------------------------| +|OpenUserJS |https://openuserjs.org |[OpenUserJS.org](https://github.com/OpenUserJS/OpenUserJS.org) | Marti Martz (@Martii) Co-Owner / Active Maintainer | To be listed: please let us know or submit a PR. From 80cdd6bd0e1d54af21d2e64b2958c277d0055c13 Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@joshbruce.com> Date: Fri, 20 Apr 2018 10:18:14 -0400 Subject: [PATCH 440/459] Typo --- docs/AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 2a1f9094..619b04a0 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -148,7 +148,7 @@ Badges? If you *want* 'em, we got 'em, and here's how you get 'em (and…dr <dl> <dt>Defibrillator</dt> - <dd>A contributor who stepped to help bring Marked back to life by contriuting solutions to help Marked pass when compared against the CommonMark and GitHub Flavored Markdown specifications.</dd> + <dd>A contributor who stepped up to help bring Marked back to life by contriuting solutions to help Marked pass when compared against the CommonMark and GitHub Flavored Markdown specifications.</dd> <dt>Maker of the Marked mark</dt> <dd>This badge is given to the person or oganization credited with creating the logo (or logotype) used in Marked communications for a given period of time. **Maker of the Marked mark from 2017 to present**, for example.</dd> <dt>Release Wrangler</dt> From 5814e490c8b44e5c7f3fc57cde38b8ce1a253ec9 Mon Sep 17 00:00:00 2001 From: Martii <martii@users.noreply.github.com> Date: Sat, 21 Apr 2018 03:26:48 -0600 Subject: [PATCH 441/459] Withdraw permission for Branding usage * Unfortunately @joshbruce lost some credibility by a post edit with an edit misusing the OpenUserJS brand so respectfully removing listing. NOTE: * This is probably why no-one else has done this Ref: * #1233 with > LGTM! ... apparently it wasn't and shouldn't have been merged without all parties consent. --- docs/AUTHORS.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 619b04a0..136a0aeb 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -8,7 +8,6 @@ Users are anyone using Marked in some fashion, without them, there's no reason f |Individual or Organization |Website |GitHub project |Submitted by | |:--------------------------|:----------------------|:--------------------------------------------------------------|:---------------------------------------------------| -|OpenUserJS |https://openuserjs.org |[OpenUserJS.org](https://github.com/OpenUserJS/OpenUserJS.org) | Marti Martz (@Martii) Co-Owner / Active Maintainer | To be listed: please let us know or submit a PR. From c0091ef95616ef5dd71f8ae1225b62761ad728e3 Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@8fold.pro> Date: Sun, 22 Apr 2018 11:51:56 -0400 Subject: [PATCH 442/459] Be more explicit in what is requested for users (#1236) * Be more explicit in what is requested for users * Minor language change * typo * Table alignment * typos --- docs/AUTHORS.md | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 136a0aeb..98af6859 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -6,12 +6,18 @@ Marked takes an encompassing approach to its community. As such, you can think o Users are anyone using Marked in some fashion, without them, there's no reason for us to exist. -|Individual or Organization |Website |GitHub project |Submitted by | -|:--------------------------|:----------------------|:--------------------------------------------------------------|:---------------------------------------------------| +|Individual or Organization |Website |Project |Submitted by | +|:--------------------------|:-----------------------|:------------------------------------|:---------------------------------------------------| +|MarkedJS |https://marked.js.org |https://github.com/markedjs/marked |The marked committers | -To be listed: please let us know or submit a PR. +To be listed: All fields are optional. Contact any of the committers or, more timely, submit a pull request with the following (using the first row as an example): -To be removed: please let us know or submit a PR. +- **Individual or Organization:** The name you would like associated with the record. +- **Website:** A URL to a standalone website for the project. +- **Project:** A URL for the repository of the project using marked. +- **Submitted by:** The name and optional honorifics for the person adding the listing. + +To be removed: Same as above. Only instead of requesting addition request deletion or delete the row yourself. ## Contributors @@ -37,10 +43,10 @@ Committers are contributors who also have the responsibility, privilege, some mi A note on "decision making authority". This is related to submitting PRs and the [advice process](http://www.reinventingorganizationswiki.com/Decision_Making). The person marked as having decision making authority over a certain area should be sought for advice in that area before committing to a course of action. -|Name |GiHub handle |Decision making |Badges of honor (tag for questions) | -|:--------------|:--------------|:----------------------------------------|------------------------------------| -|Jamie Davis |@davisjam |Seeker of Security | | -|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | | +|Name |GitHub handle |Decision making |Badges of honor (tag for questions) | +|:--------------|:---------------|:----------------------------------------|:------------------------------------| +|Jamie Davis |@davisjam |Seeker of Security | | +|Tony Brix |@UziTech |Titan of the test harness and Dr. DevOps | | **Should not exceed 5:** For larger PRs affecting more of the codebase and, most likely, review by more people, we try to keep this pool small and responsive and let those with decision making authority have final say without negative repercussions from the other committers. @@ -60,9 +66,9 @@ A note on volunteering: Admins are committers who also have the responsibility, privilege, and burden of selecting committers and making sure the project itself runs smoothly, which includes community maintenance, governance, dispute resolution, and so on. (Letting the contributors easily enter into, and work within, the project to begin contributing, with as little friction as possible.) -|Name |GiHub handle |Decision making |Badges of honor (tag for questions) | -|:--------------|:--------------|:----------------------------------------|------------------------------------| -|Steven |@styfle |Open source, of course and GitHub Guru |Humaning Helper | +|Name |GitHub handle |Decision making |Badges of honor (tag for questions) | +|:--------------|:---------------|:----------------------------------------|:------------------------------------| +|Steven |@styfle |Open source, of course and GitHub Guru |Humaning Helper | **Should not exceed 3:** When there are too many people with the ability to reolves disputes, the dispute itself can quickly turn into a dispute amongst the admins themselves; therefore, we want this group to be small enough to commit to action and large enough to not put too much burden on one person. (Should ensure faster resolution and responsiveness.) From ecdef45e18eb0090909bec04b170b7e50d8bd661 Mon Sep 17 00:00:00 2001 From: Travis-CI <travis@travis-ci.org> Date: Mon, 23 Apr 2018 22:50:59 +0000 Subject: [PATCH 443/459] =?UTF-8?q?=F0=9F=97=9C=EF=B8=8F=20minify=20[skip?= =?UTF-8?q?=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index d301f5c6..89836bb8 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||m.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=/<!--(?!-?>)[\s\S]*?-->/,t.html=p(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.pedantic=d({},t.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p<c;p++)h=(a=i[p]).length,~(a=a.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(h-=a.length,a=this.options.pedantic?a.replace(/^ {1,4}/gm,""):a.replace(new RegExp("^ {1,"+h+"}","gm"),"")),this.options.smartLists&&p!==c-1&&(l===(o=t.bullet.exec(i[p+1])[0])||l.length>1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(n&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var r={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,em:/^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function s(e,t){if(this.options=t||m.defaults,this.links=e,this.rules=r.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=r.pedantic:this.options.gfm&&(this.options.breaks?this.rules=r.breaks:this.rules=r.gfm)}function i(e){this.options=e||m.defaults}function l(){}function o(e){this.tokens=[],this.token=null,this.options=e||m.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r.tag=p(r.tag).replace("comment",t._comment).replace("attribute",r._attribute).getRegex(),r._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,r._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/,r._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r.link=p(r.link).replace("label",r._label).replace("href",r._href).replace("title",r._title).getRegex(),r.reflink=p(r.reflink).replace("label",r._label).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:{exec:function(e){var t=p(/^!?\[(label)\]\((.*?)\)/).replace("label",r._label).getRegex().exec(e);if(!t)return null;var n=t[1],s=function(e){for(var t=[/^([^'"(]*[^\s])\s+(['"(].*['")])/,/^(<?[\s\S]*>?)/],n=!1,r=0;r<t.length&&!(n=t[r].exec(e));r++);if(!n)return null;var s,i=n[1],l=n[2]||"";return i=i.trim(),(s=i).match(/^<.*>$/)&&(s=s.slice(1,-1)),[i=s,l]}(t[2]);return s?[t[0],n,s[0],s[1]]:null}},reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r._label).getRegex()}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,i,l,o="";e;)if(l=this.rules.escape.exec(e))e=e.substring(l[0].length),o+=l[1];else if(l=this.rules.autolink.exec(e))e=e.substring(l[0].length),r="@"===l[2]?"mailto:"+(n=a(this.mangle(l[1]))):n=a(l[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(l=this.rules.url.exec(e))){if(l=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(l[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(l[0])&&(this.inLink=!1),e=e.substring(l[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):a(l[0]):l[0];else if(l=this.rules.link.exec(e))e=e.substring(l[0].length),this.inLink=!0,r="<"===(r=l[2])[0]?r.substring(1,r.length-1):r,i=l[3]?l[3].substring(1,l[3].length-1):l[3],o+=this.outputLink(l,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1;else if((l=this.rules.reflink.exec(e))||(l=this.rules.nolink.exec(e))){if(e=e.substring(l[0].length),t=(l[2]||l[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=l[0].charAt(0),e=l[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(l,t),this.inLink=!1}else if(l=this.rules.strong.exec(e))e=e.substring(l[0].length),o+=this.renderer.strong(this.output(l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.em.exec(e))e=e.substring(l[0].length),o+=this.renderer.em(this.output(l[6]||l[5]||l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.code.exec(e))e=e.substring(l[0].length),o+=this.renderer.codespan(a(l[2].trim(),!0));else if(l=this.rules.br.exec(e))e=e.substring(l[0].length),o+=this.renderer.br();else if(l=this.rules.del.exec(e))e=e.substring(l[0].length),o+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(e))e=e.substring(l[0].length),o+=this.renderer.text(a(this.smartypants(l[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else l[0]=this.rules._backpedal.exec(l[0])[0],e=e.substring(l[0].length),"@"===l[2]?r="mailto:"+(n=a(l[0])):(n=a(l[0]),r="www."===l[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s<r;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='<a href="'+a(e)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>"},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(s+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});i+=this.renderer.tablerow(n)}return this.renderer.table(s,i);case"blockquote_start":for(i="";"blockquote_end"!==this.next().type;)i+=this.tok();return this.renderer.blockquote(i);case"list_start":i="";for(var l=this.token.ordered,o=this.token.start;"list_end"!==this.next().type;)i+=this.tok();return this.renderer.list(i,l,o);case"list_item_start":for(i="";"list_item_end"!==this.next().type;)i+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(i);case"loose_item_start":for(i="";"list_item_end"!==this.next().type;)i+=this.tok();return this.renderer.listitem(i);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var c={},g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(){}function d(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function m(e,t,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(r||"function"==typeof t){r||(r=t,t=null);var s,i,l=(t=d({},m.defaults,t||{})).highlight,h=0;try{s=n.lex(e,t)}catch(e){return r(e)}i=s.length;var p=function(e){if(e)return t.highlight=l,r(e);var n;try{n=o.parse(s,t)}catch(t){e=t}return t.highlight=l,e?r(e):r(null,n)};if(!l||l.length<3)return p();if(delete t.highlight,!i)return p();for(;h<s.length;h++)!function(e){"code"!==e.type?--i||p():l(e.text,e.lang,function(t,n){return t?p(t):null==n||n===e.text?--i||p():(e.text=n,e.escaped=!0,void(--i||p()))})}(s[h])}else try{return t&&(t=d({},m.defaults,t)),o.parse(n.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||m.defaults).silent)return"<p>An error occurred:</p><pre>"+a(e.message+"",!0)+"</pre>";throw e}}f.exec=f,m.options=m.setOptions=function(e){return d(m.defaults,e),m},m.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"lang-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},m.defaults=m.getDefaults(),m.Parser=o,m.parser=o.parse,m.Renderer=i,m.TextRenderer=l,m.Lexer=n,m.lexer=n.lex,m.InlineLexer=s,m.inlineLexer=s.output,m.parse=m,"undefined"!=typeof module&&"object"==typeof exports?module.exports=m:"function"==typeof define&&define.amd?define(function(){return m}):e.marked=m}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||m.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=/<!--(?!-?>)[\s\S]*?-->/,t.html=p(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.pedantic=d({},t.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p<c;p++)h=(a=i[p]).length,~(a=a.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(h-=a.length,a=this.options.pedantic?a.replace(/^ {1,4}/gm,""):a.replace(new RegExp("^ {1,"+h+"}","gm"),"")),this.options.smartLists&&p!==c-1&&(l===(o=t.bullet.exec(i[p+1])[0])||l.length>1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(n&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var r={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,em:/^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function s(e,t){if(this.options=t||m.defaults,this.links=e,this.rules=r.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=r.pedantic:this.options.gfm&&(this.options.breaks?this.rules=r.breaks:this.rules=r.gfm)}function i(e){this.options=e||m.defaults}function l(){}function o(e){this.tokens=[],this.token=null,this.options=e||m.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r.tag=p(r.tag).replace("comment",t._comment).replace("attribute",r._attribute).getRegex(),r._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,r._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/,r._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r.link=p(r.link).replace("label",r._label).replace("href",r._href).replace("title",r._title).getRegex(),r.reflink=p(r.reflink).replace("label",r._label).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",r._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r._label).getRegex()}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,i,l,o="";e;)if(l=this.rules.escape.exec(e))e=e.substring(l[0].length),o+=l[1];else if(l=this.rules.autolink.exec(e))e=e.substring(l[0].length),r="@"===l[2]?"mailto:"+(n=a(this.mangle(l[1]))):n=a(l[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(l=this.rules.url.exec(e))){if(l=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(l[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(l[0])&&(this.inLink=!1),e=e.substring(l[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):a(l[0]):l[0];else if(l=this.rules.link.exec(e))e=e.substring(l[0].length),this.inLink=!0,r=l[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],i=t[3]):i="":i=l[3]?l[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),o+=this.outputLink(l,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1;else if((l=this.rules.reflink.exec(e))||(l=this.rules.nolink.exec(e))){if(e=e.substring(l[0].length),t=(l[2]||l[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=l[0].charAt(0),e=l[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(l,t),this.inLink=!1}else if(l=this.rules.strong.exec(e))e=e.substring(l[0].length),o+=this.renderer.strong(this.output(l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.em.exec(e))e=e.substring(l[0].length),o+=this.renderer.em(this.output(l[6]||l[5]||l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.code.exec(e))e=e.substring(l[0].length),o+=this.renderer.codespan(a(l[2].trim(),!0));else if(l=this.rules.br.exec(e))e=e.substring(l[0].length),o+=this.renderer.br();else if(l=this.rules.del.exec(e))e=e.substring(l[0].length),o+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(e))e=e.substring(l[0].length),o+=this.renderer.text(a(this.smartypants(l[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else l[0]=this.rules._backpedal.exec(l[0])[0],e=e.substring(l[0].length),"@"===l[2]?r="mailto:"+(n=a(l[0])):(n=a(l[0]),r="www."===l[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s<r;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='<a href="'+a(e)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>"},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(s+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});i+=this.renderer.tablerow(n)}return this.renderer.table(s,i);case"blockquote_start":for(i="";"blockquote_end"!==this.next().type;)i+=this.tok();return this.renderer.blockquote(i);case"list_start":i="";for(var l=this.token.ordered,o=this.token.start;"list_end"!==this.next().type;)i+=this.tok();return this.renderer.list(i,l,o);case"list_item_start":for(i="";"list_item_end"!==this.next().type;)i+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(i);case"loose_item_start":for(i="";"list_item_end"!==this.next().type;)i+=this.tok();return this.renderer.listitem(i);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var c={},g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(){}function d(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function m(e,t,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(r||"function"==typeof t){r||(r=t,t=null);var s,i,l=(t=d({},m.defaults,t||{})).highlight,h=0;try{s=n.lex(e,t)}catch(e){return r(e)}i=s.length;var p=function(e){if(e)return t.highlight=l,r(e);var n;try{n=o.parse(s,t)}catch(t){e=t}return t.highlight=l,e?r(e):r(null,n)};if(!l||l.length<3)return p();if(delete t.highlight,!i)return p();for(;h<s.length;h++)!function(e){"code"!==e.type?--i||p():l(e.text,e.lang,function(t,n){return t?p(t):null==n||n===e.text?--i||p():(e.text=n,e.escaped=!0,void(--i||p()))})}(s[h])}else try{return t&&(t=d({},m.defaults,t)),o.parse(n.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||m.defaults).silent)return"<p>An error occurred:</p><pre>"+a(e.message+"",!0)+"</pre>";throw e}}f.exec=f,m.options=m.setOptions=function(e){return d(m.defaults,e),m},m.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"lang-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},m.defaults=m.getDefaults(),m.Parser=o,m.parser=o.parse,m.Renderer=i,m.TextRenderer=l,m.Lexer=n,m.lexer=n.lex,m.InlineLexer=s,m.inlineLexer=s.output,m.parse=m,"undefined"!=typeof module&&"object"==typeof exports?module.exports=m:"function"==typeof define&&define.amd?define(function(){return m}):e.marked=m}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file From bbdf1919316f3820a7b3bc498965abe29081c5a0 Mon Sep 17 00:00:00 2001 From: Tom Theisen <tomtheisen@github.com> Date: Tue, 24 Apr 2018 21:19:14 -0700 Subject: [PATCH 444/459] handle escaped pipes in gfm tables --- lib/marked.js | 21 +++++++++++++++------ test/specs/gfm/gfm-spec.js | 3 +-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 1fe8ba45..dd6ab135 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -249,7 +249,7 @@ Lexer.prototype.token = function(src, top) { item = { type: 'table', - header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), cells: cap[3].replace(/\n$/, '').split('\n') }; @@ -267,7 +267,7 @@ Lexer.prototype.token = function(src, top) { } for (i = 0; i < item.cells.length; i++) { - item.cells[i] = item.cells[i].split(/ *\| */); + item.cells[i] = splitCells(item.cells[i]); } this.tokens.push(item); @@ -416,7 +416,7 @@ Lexer.prototype.token = function(src, top) { item = { type: 'table', - header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), + header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') }; @@ -434,9 +434,8 @@ Lexer.prototype.token = function(src, top) { } for (i = 0; i < item.cells.length; i++) { - item.cells[i] = item.cells[i] - .replace(/^ *\| *| *\| *$/g, '') - .split(/ *\| */); + item.cells[i] = splitCells( + item.cells[i].replace(/^ *\| *| *\| *$/g, '')); } this.tokens.push(item); @@ -1311,6 +1310,16 @@ function merge(obj) { return obj; } +function splitCells(tableRow) { + var cells = tableRow.replace(/([^\\])\|/g, "$1 |").split(/ +\| */), + i = 0; + + for (; i < cells.length; i++) { + cells[i] = cells[i].replace(/\\\|/g, "|"); + } + return cells; +} + /** * Marked */ diff --git a/test/specs/gfm/gfm-spec.js b/test/specs/gfm/gfm-spec.js index a91b5396..3589a5f3 100644 --- a/test/specs/gfm/gfm-spec.js +++ b/test/specs/gfm/gfm-spec.js @@ -28,8 +28,7 @@ var messenger = new Messenger(); describe('GFM 0.28 Tables', function() { var section = 'Tables'; - // TODO: Verify exmaple 193 is valid and passing - var shouldPassButFails = [192, 193, 195, 196, 197]; + var shouldPassButFails = [192, 195, 196, 197]; var willNotBeAttemptedByCoreTeam = []; From e4973edfed540f6284944274fc15bf094e47461c Mon Sep 17 00:00:00 2001 From: Tom Theisen <tomtheisen@github.com> Date: Tue, 24 Apr 2018 21:20:10 -0700 Subject: [PATCH 445/459] lint --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index dd6ab135..55b06b4a 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1311,11 +1311,11 @@ function merge(obj) { } function splitCells(tableRow) { - var cells = tableRow.replace(/([^\\])\|/g, "$1 |").split(/ +\| */), + var cells = tableRow.replace(/([^\\])\|/g, '$1 |').split(/ +\| */), i = 0; for (; i < cells.length; i++) { - cells[i] = cells[i].replace(/\\\|/g, "|"); + cells[i] = cells[i].replace(/\\\|/g, '|'); } return cells; } From b57518d9a573d0fd4a484e96eff3ce0274e098ec Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@joshbruce.com> Date: Wed, 25 Apr 2018 08:33:13 -0400 Subject: [PATCH 446/459] Remove details --- docs/PUBLISHING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/PUBLISHING.md b/docs/PUBLISHING.md index 99dcbfec..27937c2f 100644 --- a/docs/PUBLISHING.md +++ b/docs/PUBLISHING.md @@ -20,5 +20,5 @@ We follow [semantic versioning](https://semver.org) where the following sequence What to expect while Marked is a zero-major (0.x.y): 1. The major will remain at zero; thereby, alerting consumers to the potentially volatile nature of the package. -2. The minor will tend to be more analagous to a `major` release. For example, we plan to release `0.4.0` once we have fixed most, if not all, known issues related to the CommonMark and GFM specifications because the architecture changes planned during `0.4.0` will most likely introduce breaking changes. -3. The patch will tend to be more analagous to a `minor` release. +2. The minor will tend to be more analagous to a `major` release. +3. The patch will tend to be more analagous to a `minor` release or a collection of bug fixes (patches). From 9708f78d1864ab18968fa99be06980f61b9cff46 Mon Sep 17 00:00:00 2001 From: Josh Bruce <josh@joshbruce.com> Date: Wed, 25 Apr 2018 08:38:33 -0400 Subject: [PATCH 447/459] Add first defib --- docs/AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 98af6859..89d54871 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -30,6 +30,7 @@ Contributors are users who submit a [PR](https://github.com/markedjs/marked/pull |Federico Soave |@Feder1co5oave |Regent of the Regex, Master of Marked | |Karen Yavine |@karenyavine |Snyk's Security Saint | |Костя Третяк |@KostyaTretyak |-- | +|-- |@tomtheisen |Defibrillator | To be listed: make a contribution and, if it has significant impact, the committers may be able to add you here. From 03876239f5910f4914eeca8164893114bb8a3d05 Mon Sep 17 00:00:00 2001 From: Travis-CI <travis@travis-ci.org> Date: Wed, 25 Apr 2018 12:45:35 +0000 Subject: [PATCH 448/459] =?UTF-8?q?=F0=9F=97=9C=EF=B8=8F=20minify=20[skip?= =?UTF-8?q?=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index 89836bb8..c952af02 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||m.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=/<!--(?!-?>)[\s\S]*?-->/,t.html=p(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.pedantic=d({},t.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p<c;p++)h=(a=i[p]).length,~(a=a.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(h-=a.length,a=this.options.pedantic?a.replace(/^ {1,4}/gm,""):a.replace(new RegExp("^ {1,"+h+"}","gm"),"")),this.options.smartLists&&p!==c-1&&(l===(o=t.bullet.exec(i[p+1])[0])||l.length>1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=a.cells[p].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(a)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(n&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var r={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,em:/^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function s(e,t){if(this.options=t||m.defaults,this.links=e,this.rules=r.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=r.pedantic:this.options.gfm&&(this.options.breaks?this.rules=r.breaks:this.rules=r.gfm)}function i(e){this.options=e||m.defaults}function l(){}function o(e){this.tokens=[],this.token=null,this.options=e||m.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r.tag=p(r.tag).replace("comment",t._comment).replace("attribute",r._attribute).getRegex(),r._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,r._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/,r._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r.link=p(r.link).replace("label",r._label).replace("href",r._href).replace("title",r._title).getRegex(),r.reflink=p(r.reflink).replace("label",r._label).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",r._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r._label).getRegex()}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,i,l,o="";e;)if(l=this.rules.escape.exec(e))e=e.substring(l[0].length),o+=l[1];else if(l=this.rules.autolink.exec(e))e=e.substring(l[0].length),r="@"===l[2]?"mailto:"+(n=a(this.mangle(l[1]))):n=a(l[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(l=this.rules.url.exec(e))){if(l=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(l[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(l[0])&&(this.inLink=!1),e=e.substring(l[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):a(l[0]):l[0];else if(l=this.rules.link.exec(e))e=e.substring(l[0].length),this.inLink=!0,r=l[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],i=t[3]):i="":i=l[3]?l[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),o+=this.outputLink(l,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1;else if((l=this.rules.reflink.exec(e))||(l=this.rules.nolink.exec(e))){if(e=e.substring(l[0].length),t=(l[2]||l[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=l[0].charAt(0),e=l[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(l,t),this.inLink=!1}else if(l=this.rules.strong.exec(e))e=e.substring(l[0].length),o+=this.renderer.strong(this.output(l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.em.exec(e))e=e.substring(l[0].length),o+=this.renderer.em(this.output(l[6]||l[5]||l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.code.exec(e))e=e.substring(l[0].length),o+=this.renderer.codespan(a(l[2].trim(),!0));else if(l=this.rules.br.exec(e))e=e.substring(l[0].length),o+=this.renderer.br();else if(l=this.rules.del.exec(e))e=e.substring(l[0].length),o+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(e))e=e.substring(l[0].length),o+=this.renderer.text(a(this.smartypants(l[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else l[0]=this.rules._backpedal.exec(l[0])[0],e=e.substring(l[0].length),"@"===l[2]?r="mailto:"+(n=a(l[0])):(n=a(l[0]),r="www."===l[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s<r;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='<a href="'+a(e)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>"},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(s+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});i+=this.renderer.tablerow(n)}return this.renderer.table(s,i);case"blockquote_start":for(i="";"blockquote_end"!==this.next().type;)i+=this.tok();return this.renderer.blockquote(i);case"list_start":i="";for(var l=this.token.ordered,o=this.token.start;"list_end"!==this.next().type;)i+=this.tok();return this.renderer.list(i,l,o);case"list_item_start":for(i="";"list_item_end"!==this.next().type;)i+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(i);case"loose_item_start":for(i="";"list_item_end"!==this.next().type;)i+=this.tok();return this.renderer.listitem(i);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var c={},g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(){}function d(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function m(e,t,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(r||"function"==typeof t){r||(r=t,t=null);var s,i,l=(t=d({},m.defaults,t||{})).highlight,h=0;try{s=n.lex(e,t)}catch(e){return r(e)}i=s.length;var p=function(e){if(e)return t.highlight=l,r(e);var n;try{n=o.parse(s,t)}catch(t){e=t}return t.highlight=l,e?r(e):r(null,n)};if(!l||l.length<3)return p();if(delete t.highlight,!i)return p();for(;h<s.length;h++)!function(e){"code"!==e.type?--i||p():l(e.text,e.lang,function(t,n){return t?p(t):null==n||n===e.text?--i||p():(e.text=n,e.escaped=!0,void(--i||p()))})}(s[h])}else try{return t&&(t=d({},m.defaults,t)),o.parse(n.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||m.defaults).silent)return"<p>An error occurred:</p><pre>"+a(e.message+"",!0)+"</pre>";throw e}}f.exec=f,m.options=m.setOptions=function(e){return d(m.defaults,e),m},m.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"lang-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},m.defaults=m.getDefaults(),m.Parser=o,m.parser=o.parse,m.Renderer=i,m.TextRenderer=l,m.Lexer=n,m.lexer=n.lex,m.InlineLexer=s,m.inlineLexer=s.output,m.parse=m,"undefined"!=typeof module&&"object"==typeof exports?module.exports=m:"function"==typeof define&&define.amd?define(function(){return m}):e.marked=m}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file +!function(e){"use strict";var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:f,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/,text:/^[^\n]+/};function n(e){this.tokens=[],this.tokens.links={},this.options=e||b.defaults,this.rules=t.normal,this.options.pedantic?this.rules=t.pedantic:this.options.gfm&&(this.options.tables?this.rules=t.tables:this.rules=t.gfm)}t._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,t._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,t.def=p(t.def).replace("label",t._label).replace("title",t._title).getRegex(),t.bullet=/(?:[*+-]|\d+\.)/,t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,t.item=p(t.item,"gm").replace(/bull/g,t.bullet).getRegex(),t.list=p(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex(),t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",t._comment=/<!--(?!-?>)[\s\S]*?-->/,t.html=p(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),t.paragraph=p(t.paragraph).replace("hr",t.hr).replace("heading",t.heading).replace("lheading",t.lheading).replace("tag",t._tag).getRegex(),t.blockquote=p(t.blockquote).replace("paragraph",t.paragraph).getRegex(),t.normal=d({},t),t.gfm=d({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),t.gfm.paragraph=p(t.paragraph).replace("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|").getRegex(),t.tables=d({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.pedantic=d({},t.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),n.rules=t,n.lex=function(e,t){return new n(t).lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,n){var r,s,i,l,o,a,h,p,u,c,g;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(n&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:m(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=m(a.cells[p]);this.tokens.push(a)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,n),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),g=(l=i[2]).length>1,this.tokens.push({type:"list_start",ordered:g,start:g?+l:""}),r=!1,c=(i=i[0].match(this.rules.item)).length,p=0;p<c;p++)h=(a=i[p]).length,~(a=a.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(h-=a.length,a=this.options.pedantic?a.replace(/^ {1,4}/gm,""):a.replace(new RegExp("^ {1,"+h+"}","gm"),"")),this.options.smartLists&&p!==c-1&&(l===(o=t.bullet.exec(i[p+1])[0])||l.length>1&&o.length>1||(e=i.slice(p+1).join("\n")+e,p=c-1)),s=r||/\n\n(?!\s*$)/.test(a),p!==c-1&&(r="\n"===a.charAt(a.length-1),s||(s=r)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(a,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(n&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),u=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[u]||(this.tokens.links[u]={href:i[2],title:i[3]});else if(n&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),a={type:"table",header:m(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},p=0;p<a.align.length;p++)/^ *-+: *$/.test(a.align[p])?a.align[p]="right":/^ *:-+: *$/.test(a.align[p])?a.align[p]="center":/^ *:-+ *$/.test(a.align[p])?a.align[p]="left":a.align[p]=null;for(p=0;p<a.cells.length;p++)a.cells[p]=m(a.cells[p].replace(/^ *\| *| *\| *$/g,""));this.tokens.push(a)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(n&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var r={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:f,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)|^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)/,em:/^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*][\s\S]*?[^\s])\*(?!\*)|^_([^\s_])_(?!_)|^\*([^\s*])\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`]?)\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function s(e,t){if(this.options=t||b.defaults,this.links=e,this.rules=r.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=r.pedantic:this.options.gfm&&(this.options.breaks?this.rules=r.breaks:this.rules=r.gfm)}function i(e){this.options=e||b.defaults}function l(){}function o(e){this.tokens=[],this.token=null,this.options=e||b.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function h(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function p(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function u(e,t){return c[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?c[" "+e]=e+"/":c[" "+e]=e.replace(/[^/]*$/,"")),e=c[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}r._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r.autolink=p(r.autolink).replace("scheme",r._scheme).replace("email",r._email).getRegex(),r._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r.tag=p(r.tag).replace("comment",t._comment).replace("attribute",r._attribute).getRegex(),r._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,r._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f()\\]*\)|[^\s\x00-\x1f()\\])*?)/,r._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r.link=p(r.link).replace("label",r._label).replace("href",r._href).replace("title",r._title).getRegex(),r.reflink=p(r.reflink).replace("label",r._label).getRegex(),r.normal=d({},r),r.pedantic=d({},r.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",r._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r._label).getRegex()}),r.gfm=d({},r.normal,{escape:p(r.escape).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("email",r._email).getRegex(),_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:p(r.text).replace("]|","~]|").replace("|","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|").getRegex()}),r.breaks=d({},r.gfm,{br:p(r.br).replace("{2,}","*").getRegex(),text:p(r.gfm.text).replace("{2,}","*").getRegex()}),s.rules=r,s.output=function(e,t,n){return new s(t,n).output(e)},s.prototype.output=function(e){for(var t,n,r,i,l,o="";e;)if(l=this.rules.escape.exec(e))e=e.substring(l[0].length),o+=l[1];else if(l=this.rules.autolink.exec(e))e=e.substring(l[0].length),r="@"===l[2]?"mailto:"+(n=a(this.mangle(l[1]))):n=a(l[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(l=this.rules.url.exec(e))){if(l=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(l[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(l[0])&&(this.inLink=!1),e=e.substring(l[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):a(l[0]):l[0];else if(l=this.rules.link.exec(e))e=e.substring(l[0].length),this.inLink=!0,r=l[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],i=t[3]):i="":i=l[3]?l[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),o+=this.outputLink(l,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1;else if((l=this.rules.reflink.exec(e))||(l=this.rules.nolink.exec(e))){if(e=e.substring(l[0].length),t=(l[2]||l[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=l[0].charAt(0),e=l[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(l,t),this.inLink=!1}else if(l=this.rules.strong.exec(e))e=e.substring(l[0].length),o+=this.renderer.strong(this.output(l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.em.exec(e))e=e.substring(l[0].length),o+=this.renderer.em(this.output(l[6]||l[5]||l[4]||l[3]||l[2]||l[1]));else if(l=this.rules.code.exec(e))e=e.substring(l[0].length),o+=this.renderer.codespan(a(l[2].trim(),!0));else if(l=this.rules.br.exec(e))e=e.substring(l[0].length),o+=this.renderer.br();else if(l=this.rules.del.exec(e))e=e.substring(l[0].length),o+=this.renderer.del(this.output(l[1]));else if(l=this.rules.text.exec(e))e=e.substring(l[0].length),o+=this.renderer.text(a(this.smartypants(l[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else l[0]=this.rules._backpedal.exec(l[0])[0],e=e.substring(l[0].length),"@"===l[2]?r="mailto:"+(n=a(l[0])):(n=a(l[0]),r="www."===l[1]?"http://"+n:n),o+=this.renderer.link(r,null,n);return o},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,a(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s<r;s++)t=e.charCodeAt(s),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var s='<a href="'+a(e)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>"},i.prototype.image=function(e,t,n){this.options.baseUrl&&!g.test(e)&&(e=u(this.options.baseUrl,e));var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},i.prototype.text=function(e){return e},l.prototype.strong=l.prototype.em=l.prototype.codespan=l.prototype.del=l.prototype.text=function(e){return e},l.prototype.link=l.prototype.image=function(e,t,n){return""+n},l.prototype.br=function(){return""},o.parse=function(e,t){return new o(t).parse(e)},o.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,d({},this.options,{renderer:new l})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(s+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});i+=this.renderer.tablerow(n)}return this.renderer.table(s,i);case"blockquote_start":for(i="";"blockquote_end"!==this.next().type;)i+=this.tok();return this.renderer.blockquote(i);case"list_start":i="";for(var l=this.token.ordered,o=this.token.start;"list_end"!==this.next().type;)i+=this.tok();return this.renderer.list(i,l,o);case"list_item_start":for(i="";"list_item_end"!==this.next().type;)i+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(i);case"loose_item_start":for(i="";"list_item_end"!==this.next().type;)i+=this.tok();return this.renderer.listitem(i);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}};var c={},g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(){}function d(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function m(e){for(var t=e.replace(/([^\\])\|/g,"$1 |").split(/ +\| */),n=0;n<t.length;n++)t[n]=t[n].replace(/\\\|/g,"|");return t}function b(e,t,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(r||"function"==typeof t){r||(r=t,t=null);var s,i,l=(t=d({},b.defaults,t||{})).highlight,h=0;try{s=n.lex(e,t)}catch(e){return r(e)}i=s.length;var p=function(e){if(e)return t.highlight=l,r(e);var n;try{n=o.parse(s,t)}catch(t){e=t}return t.highlight=l,e?r(e):r(null,n)};if(!l||l.length<3)return p();if(delete t.highlight,!i)return p();for(;h<s.length;h++)!function(e){"code"!==e.type?--i||p():l(e.text,e.lang,function(t,n){return t?p(t):null==n||n===e.text?--i||p():(e.text=n,e.escaped=!0,void(--i||p()))})}(s[h])}else try{return t&&(t=d({},b.defaults,t)),o.parse(n.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||b.defaults).silent)return"<p>An error occurred:</p><pre>"+a(e.message+"",!0)+"</pre>";throw e}}f.exec=f,b.options=b.setOptions=function(e){return d(b.defaults,e),b},b.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"lang-",mangle:!0,pedantic:!1,renderer:new i,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},b.defaults=b.getDefaults(),b.Parser=o,b.parser=o.parse,b.Renderer=i,b.TextRenderer=l,b.Lexer=n,b.lexer=n.lex,b.InlineLexer=s,b.inlineLexer=s.output,b.parse=b,"undefined"!=typeof module&&"object"==typeof exports?module.exports=b:"function"==typeof define&&define.amd?define(function(){return b}):e.marked=b}(this||("undefined"!=typeof window?window:global)); \ No newline at end of file From 9483216ba9e4cf065165fc95e88bc54749d77ddb Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Wed, 25 Apr 2018 09:08:12 -0500 Subject: [PATCH 449/459] add name --- docs/AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md index 89d54871..d44bf5f0 100644 --- a/docs/AUTHORS.md +++ b/docs/AUTHORS.md @@ -30,7 +30,7 @@ Contributors are users who submit a [PR](https://github.com/markedjs/marked/pull |Federico Soave |@Feder1co5oave |Regent of the Regex, Master of Marked | |Karen Yavine |@karenyavine |Snyk's Security Saint | |Костя Третяк |@KostyaTretyak |-- | -|-- |@tomtheisen |Defibrillator | +|Tom Theisen |@tomtheisen |Defibrillator | To be listed: make a contribution and, if it has significant impact, the committers may be able to add you here. From c897e2acd1f63cf87ae63917a08397d00e49f3a0 Mon Sep 17 00:00:00 2001 From: Steven <steven@ceriously.com> Date: Mon, 30 Apr 2018 09:59:51 -0400 Subject: [PATCH 450/459] Update advanced usage docs --- docs/USING_ADVANCED.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/USING_ADVANCED.md b/docs/USING_ADVANCED.md index f8c0d883..49d4bba2 100644 --- a/docs/USING_ADVANCED.md +++ b/docs/USING_ADVANCED.md @@ -41,10 +41,10 @@ console.log(myMarked('I am using __markdown__.')); |Member |Type |Notes | |:-----------|:---------|:----------------------------------------------------------------------------------------------------------------------------| -|baseUrl |`??` |Default is `null` | +|baseUrl |`string` |A prefix url for any relative link. Default is `null` | |breaks |`boolean` |Use GFM [hard](https://github.github.com/gfm/#hard-line-breaks) and [soft](https://github.github.com/gfm/#soft-line-breaks) line breaks. Requires `gfm` be `true`. Default: `false`| |gfm |`boolean` |Use approved [GitHub Flavored Markdown (GFM) specification](https://github.github.com/gfm/). | -|headerIds |`boolean` |Whether to add an `id` attribute to headers. Default: `true` | +|headerIds |`boolean` |Whether to add an `id` attribute to headers. Default: `true`. Added in 0.4.0 | |headerPrefix|`string` |A short string to add as a prefix to the `id` attributes added to headers by default. Default: `empty string` | |highlight |`function`|A function to highlight code blocks. See also: <a href="#highlight">Asynchronous highlighting</a>. | |langPrefix |`??` |Default is `lang-` @@ -52,7 +52,7 @@ console.log(myMarked('I am using __markdown__.')); |pedantic |`boolean` |Conform to obscure parts of `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Turns off and overrides `gfm`. Default: `false`| |renderer |`object` |An object containing functions to render tokens to HTML. See [extensibility](https://github.com/markedjs/marked/blob/master/docs/USING_PRO.md) for more details. Default: `new Renderer()`| |sanitize |`boolean` |Ignore HTML passed into `markdownString` (sanitize the input). Default: `false` | -|sanitizer |`??` |Default is `null` | +|sanitizer |`function`|A function to sanitize html. Default is `null` | |silent |`boolean` |Default is `false` | |smartlists |`boolean` |Use smarter list behavior than those found in `markdown.pl`. Default: `true` | |smartypants |`boolean` |Use "smart" typographic punctuation for things like quotes and dashes. | From 4eeda22d1ae8f3d2f57eb4738f066a1448461be9 Mon Sep 17 00:00:00 2001 From: Steven <steven@ceriously.com> Date: Mon, 30 Apr 2018 10:06:48 -0400 Subject: [PATCH 451/459] Add docs for langPrefix --- docs/USING_ADVANCED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/USING_ADVANCED.md b/docs/USING_ADVANCED.md index 49d4bba2..aec79091 100644 --- a/docs/USING_ADVANCED.md +++ b/docs/USING_ADVANCED.md @@ -47,7 +47,7 @@ console.log(myMarked('I am using __markdown__.')); |headerIds |`boolean` |Whether to add an `id` attribute to headers. Default: `true`. Added in 0.4.0 | |headerPrefix|`string` |A short string to add as a prefix to the `id` attributes added to headers by default. Default: `empty string` | |highlight |`function`|A function to highlight code blocks. See also: <a href="#highlight">Asynchronous highlighting</a>. | -|langPrefix |`??` |Default is `lang-` +|langPrefix |`string` |A string to prefix the className in a `<code>` block. Useful for syntax highlighting. Default is `lang-` |mangle |`boolean` |Default is `true` |pedantic |`boolean` |Conform to obscure parts of `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Turns off and overrides `gfm`. Default: `false`| |renderer |`object` |An object containing functions to render tokens to HTML. See [extensibility](https://github.com/markedjs/marked/blob/master/docs/USING_PRO.md) for more details. Default: `new Renderer()`| From be922cecdd825350421be969777f7052c4cbc9e9 Mon Sep 17 00:00:00 2001 From: Tom Theisen <tomtheisen@github.com> Date: Mon, 30 Apr 2018 20:11:01 -0700 Subject: [PATCH 452/459] GFM table compliance --- lib/marked.js | 105 +++++++++++++++++++---------------- test/new/gfm_tables.html | 12 ++-- test/specs/gfm/gfm-spec.js | 2 +- test/specs/gfm/gfm.0.28.json | 2 +- 4 files changed, 66 insertions(+), 55 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 55b06b4a..759b9039 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -107,8 +107,8 @@ block.gfm.paragraph = edit(block.paragraph) */ block.tables = merge({}, block.gfm, { - nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, - table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ + nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/, + table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ }); /** @@ -245,34 +245,36 @@ Lexer.prototype.token = function(src, top) { // table no leading pipe (gfm) if (top && (cap = this.rules.nptable.exec(src))) { - src = src.substring(cap[0].length); - item = { type: 'table', header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3].replace(/\n$/, '').split('\n') + cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] }; - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; + if (item.header.length === item.align.length) { + src = src.substring(cap[0].length); + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = splitCells(item.cells[i], item.header.length); + } + + this.tokens.push(item); + + continue; } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = splitCells(item.cells[i]); - } - - this.tokens.push(item); - - continue; } // hr @@ -412,35 +414,38 @@ Lexer.prototype.token = function(src, top) { // table (gfm) if (top && (cap = this.rules.table.exec(src))) { - src = src.substring(cap[0].length); - item = { type: 'table', header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') + cells: cap[3] ? cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') : [] }; - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; + if (item.header.length === item.align.length) { + src = src.substring(cap[0].length); + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = splitCells( + item.cells[i].replace(/^ *\| *| *\| *$/g, ''), + item.header.length); + } + + this.tokens.push(item); + + continue; } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = splitCells( - item.cells[i].replace(/^ *\| *| *\| *$/g, '')); - } - - this.tokens.push(item); - - continue; } // lheading @@ -927,13 +932,13 @@ Renderer.prototype.paragraph = function(text) { }; Renderer.prototype.table = function(header, body) { + if (body) body = '<tbody>' + body + '</tbody>'; + return '<table>\n' + '<thead>\n' + header + '</thead>\n' - + '<tbody>\n' + body - + '</tbody>\n' + '</table>\n'; }; @@ -944,7 +949,7 @@ Renderer.prototype.tablerow = function(content) { Renderer.prototype.tablecell = function(content, flags) { var type = flags.header ? 'th' : 'td'; var tag = flags.align - ? '<' + type + ' style="text-align:' + flags.align + '">' + ? '<' + type + ' align="' + flags.align + '">' : '<' + type + '>'; return tag + content + '</' + type + '>\n'; }; @@ -1310,10 +1315,16 @@ function merge(obj) { return obj; } -function splitCells(tableRow) { +function splitCells(tableRow, count) { var cells = tableRow.replace(/([^\\])\|/g, '$1 |').split(/ +\| */), i = 0; + if (cells.length > count) { + cells.splice(count); + } else { + while (cells.length < count) cells.push(""); + } + for (; i < cells.length; i++) { cells[i] = cells[i].replace(/\\\|/g, '|'); } diff --git a/test/new/gfm_tables.html b/test/new/gfm_tables.html index 70bec827..1c596573 100644 --- a/test/new/gfm_tables.html +++ b/test/new/gfm_tables.html @@ -9,11 +9,11 @@ </table> <table> <thead> - <tr><th style="text-align:center">Header 1</th><th style="text-align:right">Header 2</th><th style="text-align:left">Header 3</th><th>Header 4</th></tr> + <tr><th align="center">Header 1</th><th align="right">Header 2</th><th align="left">Header 3</th><th>Header 4</th></tr> </thead> <tbody> - <tr><td style="text-align:center">Cell 1</td><td style="text-align:right">Cell 2</td><td style="text-align:left">Cell 3</td><td>Cell 4</td></tr> - <tr><td style="text-align:center">Cell 5</td><td style="text-align:right">Cell 6</td><td style="text-align:left">Cell 7</td><td>Cell 8</td></tr> + <tr><td align="center">Cell 1</td><td align="right">Cell 2</td><td align="left">Cell 3</td><td>Cell 4</td></tr> + <tr><td align="center">Cell 5</td><td align="right">Cell 6</td><td align="left">Cell 7</td><td>Cell 8</td></tr> </tbody> </table> <pre><code>Test code</code></pre> @@ -28,10 +28,10 @@ </table> <table> <thead> - <tr><th style="text-align:left">Header 1</th><th style="text-align:center">Header 2</th><th style="text-align:right">Header 3</th><th>Header 4</th></tr> + <tr><th align="left">Header 1</th><th align="center">Header 2</th><th align="right">Header 3</th><th>Header 4</th></tr> </thead> <tbody> - <tr><td style="text-align:left">Cell 1</td><td style="text-align:center">Cell 2</td><td style="text-align:right">Cell 3</td><td>Cell 4</td></tr> - <tr><td style="text-align:left"><em>Cell 5</em></td><td style="text-align:center">Cell 6</td><td style="text-align:right">Cell 7</td><td>Cell 8</td></tr> + <tr><td align="left">Cell 1</td><td align="center">Cell 2</td><td align="right">Cell 3</td><td>Cell 4</td></tr> + <tr><td align="left"><em>Cell 5</em></td><td align="center">Cell 6</td><td align="right">Cell 7</td><td>Cell 8</td></tr> </tbody> </table> diff --git a/test/specs/gfm/gfm-spec.js b/test/specs/gfm/gfm-spec.js index 3589a5f3..bf768bda 100644 --- a/test/specs/gfm/gfm-spec.js +++ b/test/specs/gfm/gfm-spec.js @@ -28,7 +28,7 @@ var messenger = new Messenger(); describe('GFM 0.28 Tables', function() { var section = 'Tables'; - var shouldPassButFails = [192, 195, 196, 197]; + var shouldPassButFails = []; var willNotBeAttemptedByCoreTeam = []; diff --git a/test/specs/gfm/gfm.0.28.json b/test/specs/gfm/gfm.0.28.json index 87d12d35..d045f8af 100644 --- a/test/specs/gfm/gfm.0.28.json +++ b/test/specs/gfm/gfm.0.28.json @@ -45,7 +45,7 @@ "section": "Tables", "html": "<table>\n<thead>\n<tr>\n<th>abc</th>\n<th>def</th>\n</tr>\n</thead></table>", "markdown": "| abc | def |\n| --- | --- |", - "example": 197 + "example": 198 }, { "section": "Task list items", From b78deebfcf4420427832acd749e8ebecf67c8778 Mon Sep 17 00:00:00 2001 From: Tom Theisen <tomtheisen@github.com> Date: Mon, 30 Apr 2018 20:11:43 -0700 Subject: [PATCH 453/459] lint --- lib/marked.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 759b9039..05be0b5d 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -266,13 +266,13 @@ Lexer.prototype.token = function(src, top) { item.align[i] = null; } } - + for (i = 0; i < item.cells.length; i++) { item.cells[i] = splitCells(item.cells[i], item.header.length); } - + this.tokens.push(item); - + continue; } } @@ -932,7 +932,7 @@ Renderer.prototype.paragraph = function(text) { }; Renderer.prototype.table = function(header, body) { - if (body) body = '<tbody>' + body + '</tbody>'; + if (body) body = '<tbody>' + body + '</tbody>'; return '<table>\n' + '<thead>\n' @@ -1322,7 +1322,7 @@ function splitCells(tableRow, count) { if (cells.length > count) { cells.splice(count); } else { - while (cells.length < count) cells.push(""); + while (cells.length < count) cells.push(''); } for (; i < cells.length; i++) { From 3b9ea4cc49d499da6121d3468a33be20cf23f70b Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Wed, 2 May 2018 08:34:33 -0500 Subject: [PATCH 454/459] add tests --- test/specs/original/specs-spec.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/test/specs/original/specs-spec.js b/test/specs/original/specs-spec.js index 2610b3bb..c31dc02f 100644 --- a/test/specs/original/specs-spec.js +++ b/test/specs/original/specs-spec.js @@ -1,4 +1,5 @@ -var specTests = require('../../'); +var marked = require('../../../lib/marked.js'); +var specTests = require('../../index.js'); it('should run spec tests', function () { // hide output @@ -10,3 +11,20 @@ it('should run spec tests', function () { fail(); } }); + +it('should use the correct paragraph type', function () { + const md = ` +A Paragraph. + +> A blockquote + +- list item + +`; + + const tokens = marked.lexer(md); + + expect(tokens[0].type).toBe('paragraph'); + expect(tokens[3].type).toBe('paragraph'); + expect(tokens[7].type).toBe('text'); +}); From ee463d4267a92b6d87da4ff7f2b431bda2b0b453 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Wed, 2 May 2018 08:41:30 -0500 Subject: [PATCH 455/459] add back q mark --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 05be0b5d..2b40cfaf 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -33,7 +33,7 @@ var block = { def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop, lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/, + paragraph: /^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/, text: /^[^\n]+/ }; From cc35600d3e9b379ab744d66683035c71f7853c75 Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Wed, 2 May 2018 08:46:26 -0500 Subject: [PATCH 456/459] use regular quotes --- test/specs/original/specs-spec.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/test/specs/original/specs-spec.js b/test/specs/original/specs-spec.js index c31dc02f..ad84c8b3 100644 --- a/test/specs/original/specs-spec.js +++ b/test/specs/original/specs-spec.js @@ -13,14 +13,7 @@ it('should run spec tests', function () { }); it('should use the correct paragraph type', function () { - const md = ` -A Paragraph. - -> A blockquote - -- list item - -`; + const md = 'A Paragraph.\n\n> A blockquote\n\n- list item\n'; const tokens = marked.lexer(md); From 484deb51fccd23764e8dee8df284b5c39e6e5a9e Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Wed, 2 May 2018 09:13:58 -0500 Subject: [PATCH 457/459] move to unit test --- test/specs/original/specs-spec.js | 13 +------------ test/unit/marked-spec.js | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/test/specs/original/specs-spec.js b/test/specs/original/specs-spec.js index ad84c8b3..2610b3bb 100644 --- a/test/specs/original/specs-spec.js +++ b/test/specs/original/specs-spec.js @@ -1,5 +1,4 @@ -var marked = require('../../../lib/marked.js'); -var specTests = require('../../index.js'); +var specTests = require('../../'); it('should run spec tests', function () { // hide output @@ -11,13 +10,3 @@ it('should run spec tests', function () { fail(); } }); - -it('should use the correct paragraph type', function () { - const md = 'A Paragraph.\n\n> A blockquote\n\n- list item\n'; - - const tokens = marked.lexer(md); - - expect(tokens[0].type).toBe('paragraph'); - expect(tokens[3].type).toBe('paragraph'); - expect(tokens[7].type).toBe('text'); -}); diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js index 0bb5b39f..97789afe 100644 --- a/test/unit/marked-spec.js +++ b/test/unit/marked-spec.js @@ -1,11 +1,5 @@ var marked = require('../../lib/marked.js'); -it('should run the test', function () { - spyOn(marked, 'parse').and.callThrough(); - marked.parse('Hello World!'); - expect(marked.parse).toHaveBeenCalled(); -}); - describe('Test heading ID functionality', function() { it('should add id attribute by default', function() { var renderer = new marked.Renderer(marked.defaults); @@ -19,3 +13,15 @@ describe('Test heading ID functionality', function() { expect(header).toBe('<h1>test</h1>\n'); }); }); + +describe('Test paragraph token type', function () { + it('should use the "paragraph" type on top level', function () { + const md = 'A Paragraph.\n\n> A blockquote\n\n- list item\n'; + + const tokens = marked.lexer(md); + + expect(tokens[0].type).toBe('paragraph'); + expect(tokens[3].type).toBe('paragraph'); + expect(tokens[7].type).toBe('text'); + }); +}); From 821bc81e08e23ecf0737056bcd9ac8ebd47d8304 Mon Sep 17 00:00:00 2001 From: Steven <steven@ceriously.com> Date: Wed, 2 May 2018 11:06:17 -0400 Subject: [PATCH 458/459] Add columns Default and Since Version --- docs/USING_ADVANCED.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/USING_ADVANCED.md b/docs/USING_ADVANCED.md index aec79091..6246ee22 100644 --- a/docs/USING_ADVANCED.md +++ b/docs/USING_ADVANCED.md @@ -39,25 +39,25 @@ console.log(myMarked('I am using __markdown__.')); <h2 id="options">Options</h2> -|Member |Type |Notes | -|:-----------|:---------|:----------------------------------------------------------------------------------------------------------------------------| -|baseUrl |`string` |A prefix url for any relative link. Default is `null` | -|breaks |`boolean` |Use GFM [hard](https://github.github.com/gfm/#hard-line-breaks) and [soft](https://github.github.com/gfm/#soft-line-breaks) line breaks. Requires `gfm` be `true`. Default: `false`| -|gfm |`boolean` |Use approved [GitHub Flavored Markdown (GFM) specification](https://github.github.com/gfm/). | -|headerIds |`boolean` |Whether to add an `id` attribute to headers. Default: `true`. Added in 0.4.0 | -|headerPrefix|`string` |A short string to add as a prefix to the `id` attributes added to headers by default. Default: `empty string` | -|highlight |`function`|A function to highlight code blocks. See also: <a href="#highlight">Asynchronous highlighting</a>. | -|langPrefix |`string` |A string to prefix the className in a `<code>` block. Useful for syntax highlighting. Default is `lang-` -|mangle |`boolean` |Default is `true` -|pedantic |`boolean` |Conform to obscure parts of `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Turns off and overrides `gfm`. Default: `false`| -|renderer |`object` |An object containing functions to render tokens to HTML. See [extensibility](https://github.com/markedjs/marked/blob/master/docs/USING_PRO.md) for more details. Default: `new Renderer()`| -|sanitize |`boolean` |Ignore HTML passed into `markdownString` (sanitize the input). Default: `false` | -|sanitizer |`function`|A function to sanitize html. Default is `null` | -|silent |`boolean` |Default is `false` | -|smartlists |`boolean` |Use smarter list behavior than those found in `markdown.pl`. Default: `true` | -|smartypants |`boolean` |Use "smart" typographic punctuation for things like quotes and dashes. | -|tables |`boolean` |Use [GFM Tables extension](https://github.github.com/gfm/#tables-extension-). Requires `gfm` be `true`. | -|xhtml |`boolean` |Self-close the tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML. Default: `false` | +|Member |Type |Default |Since |Notes | +|:-----------|:---------|:--------|:--------|:-------------| +|baseUrl |`string` |`null` |??? |A prefix url for any relative link. | +|breaks |`boolean` |`false` |??? |If true, use GFM [hard](https://github.github.com/gfm/#hard-line-breaks) and [soft](https://github.github.com/gfm/#soft-line-breaks) line breaks. Requires `gfm` be `true`.| +|gfm |`boolean` |`true` |??? |If trie. use approved [GitHub Flavored Markdown (GFM) specification](https://github.github.com/gfm/).| +|headerIds |`boolean` |`true` |v0.4.0 |If true, include an `id` attribute when emitting headings (h1, h2, h3, etc).| +|headerPrefix|`string` |`''` |??? |A string to prefix the `id` attribute when emitting headings (h1, h2, h3, etc).| +|highlight |`function`|`null` |??? |A function to highlight code blocks, see <a href="#highlight">Asynchronous highlighting</a>.| +|langPrefix |`string` |`'lang-'`|??? |A string to prefix the className in a `<code>` block. Useful for syntax highlighting.| +|mangle |`boolean` |`true` |??? |??? | +|pedantic |`boolean` |`false` |??? |If true, conform to the original `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Turns off and overrides `gfm`.| +|renderer |`object` |`new Renderer()`|???|An object containing functions to render tokens to HTML. See [extensibility](USING_PRO.md) for more details.| +|sanitize |`boolean` |`false` |??? |If true, sanitize the HTML passed into `markdownString` with the `sanitizer` function.| +|sanitizer |`function`|`null` |??? |A function to sanitize the HTML passed into `markdownString`.| +|silent |`boolean` |`false` |??? |??? | +|smartlists |`boolean` |`false` |??? |If true, use smarter list behavior than those found in `markdown.pl`.| +|smartypants |`boolean` |`false` |??? |If true, use "smart" typographic punctuation for things like quotes and dashes.| +|tables |`boolean` |`true` |??? |If true and `gfm` is true, use [GFM Tables extension](https://github.github.com/gfm/#tables-extension-).| +|xhtml |`boolean` |`false` |??? |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> From 9d5ecbe565114e116aef394dde1da71455ee41ce Mon Sep 17 00:00:00 2001 From: Tony Brix <tony@brix.ninja> Date: Wed, 2 May 2018 12:05:36 -0500 Subject: [PATCH 459/459] fix paragraph --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 2b40cfaf..9a6aeb23 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -33,7 +33,7 @@ var block = { def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop, lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - paragraph: /^([^\n]+(?:\n?(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)+)/, + paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/, text: /^[^\n]+/ };