From c1beaa637c6af1682c382dbea82b846704845c45 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Thu, 6 Feb 2014 10:46:53 -0500 Subject: [PATCH 001/308] typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 441c1eb05a..ba70e6493f 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ An object containing functions to render tokens to HTML. #### Overriding renderer methods -The renderer option allows you to render tokens in a custom manor. Here is an +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 From cac787f745cc0de1ad787ecb0c89c60edc3b3406 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Mon, 5 May 2014 21:43:35 +0200 Subject: [PATCH 002/308] Typo benchmarks are below reference in README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 441c1eb05a..f6c548725f 100644 --- a/README.md +++ b/README.md @@ -288,7 +288,7 @@ 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 above. +disadvantage in the benchmarks. Along with implementing every markdown feature, marked also implements [GFM features][gfmf]. From 1f0a49d18e4a6e6930fde5e52250c75dbc5617be Mon Sep 17 00:00:00 2001 From: Eric Theise Date: Sun, 10 Aug 2014 13:42:36 -0700 Subject: [PATCH 003/308] fix "typographic" typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 441c1eb05a..cd35fc419d 100644 --- a/README.md +++ b/README.md @@ -245,7 +245,7 @@ default with the old behavior moved into `pedantic`. Type: `boolean` Default: `false` -Use "smart" typograhic punctuation for things like quotes and dashes. +Use "smart" typographic punctuation for things like quotes and dashes. ## Access to lexer and parser From a5c5fcc43827538f69e581660ef75c42320a63c8 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Thu, 28 Aug 2014 20:47:48 +0800 Subject: [PATCH 004/308] Use svg instead of png to get better image quality --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 441c1eb05a..819b57598c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > A full-featured markdown parser and compiler, written in JavaScript. Built > for speed. -[![NPM version](https://badge.fury.io/js/marked.png)][badge] +[![NPM version](https://badge.fury.io/js/marked.svg)][badge] ## Install From c3f1284b397d021709f7b580e1fc1485ec3531d5 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Sat, 30 Aug 2014 17:39:22 +0100 Subject: [PATCH 005/308] Use the correct default value for "sanitize" The text implies that these are the default options, but the default option for sanitize is "false". --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 441c1eb05a..365f00e153 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ marked.setOptions({ tables: true, breaks: false, pedantic: false, - sanitize: true, + sanitize: false, smartLists: true, smartypants: false }); From d93df87f24b42691db4542ac172b8fa6351b482a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=93=81=E5=93=A5?= Date: Fri, 26 Jun 2015 18:33:33 +0800 Subject: [PATCH 006/308] Update marked.js it seems this argument is NOT used. --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 0c2ac4b100..9da0220a92 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -917,8 +917,8 @@ function Parser(options) { * Static Parse Method */ -Parser.parse = function(src, options, renderer) { - var parser = new Parser(options, renderer); +Parser.parse = function(src, options) { + var parser = new Parser(options); return parser.parse(src); }; From 46876e047ba202c5ea6d8e2a5999f06229807fc7 Mon Sep 17 00:00:00 2001 From: Giancarlo Date: Wed, 15 Jul 2015 12:47:55 -0500 Subject: [PATCH 007/308] Update year in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index efa71aaaab..1436dbcee6 100644 --- a/README.md +++ b/README.md @@ -393,7 +393,7 @@ all code is your original work. `` ## License -Copyright (c) 2011-2014, Christopher Jeffrey. (MIT License) +Copyright (c) 2011-2015, Christopher Jeffrey. (MIT License) See LICENSE for more info. From 7640e747489073fc2811710d056e597481265ff1 Mon Sep 17 00:00:00 2001 From: Vincent Woo Date: Wed, 22 Jul 2015 19:49:00 -0700 Subject: [PATCH 008/308] Fix small typo occur[r]ed --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 0c2ac4b100..74758913be 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1219,7 +1219,7 @@ function marked(src, opt, callback) { } catch (e) { e.message += '\nPlease report this to https://github.com/chjj/marked.'; if ((opt || marked.defaults).silent) { - return '

An error occured:

'
+      return '

An error occurred:

'
         + escape(e.message + '', true)
         + '
'; } From f9e817d9fb5097fcb603a78612c2114b3ff0705f Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sun, 15 Nov 2015 19:45:26 +0100 Subject: [PATCH 009/308] 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 03251f3c58..8ab79819e4 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 ff032bd83e7b4b7016a3fd2a574ee9f8252af150 Mon Sep 17 00:00:00 2001 From: Otto Jongerius Date: Sun, 24 Jan 2016 15:57:51 +1100 Subject: [PATCH 010/308] 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 efa71aaaab..57f16161ad 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 6470e8bd1c79de0ae76fff2d32de202f7443b803 Mon Sep 17 00:00:00 2001 From: Ozzie Neher Date: Mon, 14 Mar 2016 16:56:15 -0600 Subject: [PATCH 011/308] Update readme example to reflect defaults Changed sanitize default from true to false in the example. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index efa71aaaab..09f8ec3397 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ marked.setOptions({ tables: true, breaks: false, pedantic: false, - sanitize: true, + sanitize: false, smartLists: true, smartypants: false }); From 930555a723d1fa238b3b731e0f734f8f9253bb21 Mon Sep 17 00:00:00 2001 From: Matt Wisniewski Date: Wed, 20 Apr 2016 13:58:55 -0400 Subject: [PATCH 012/308] small typo I think this is a typo, figured I'd put in a PR just in case. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index efa71aaaab..231921c2cb 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ renderer.heading = function (text, level) { escapedText + '">' + text + ''; -}, +}; console.log(marked('# heading+', { renderer: renderer })); ``` From 34323df83aa580f3ec3b0a3c8c1ae17ff44c43d6 Mon Sep 17 00:00:00 2001 From: Matt d'Entremont Date: Fri, 8 Jul 2016 15:57:07 -0300 Subject: [PATCH 013/308] Remove "preferGlobal" from "package.json" file - Add instructions for installing the cli tool --- README.md | 6 ++++++ package.json | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index efa71aaaab..9cbf61e0f9 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,12 @@ npm install marked --save ``` +or if you want to use the `marked` CLI tool: + +``` bash +npm install -g marked +``` + ## Usage Minimal usage: diff --git a/package.json b/package.json index f17e3e5745..eaf158a5da 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", - "preferGlobal": true, "repository": "git://github.com/chjj/marked.git", "homepage": "https://github.com/chjj/marked", "bugs": { "url": "http://github.com/chjj/marked/issues" }, From e8525b2ff4a933801c35c50e4712a725068073e8 Mon Sep 17 00:00:00 2001 From: Matt d'Entremont Date: Fri, 8 Jul 2016 16:04:04 -0300 Subject: [PATCH 014/308] Update README to account for npm run-script usage --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9cbf61e0f9..b8007ff5be 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,12 @@ npm install marked --save ``` -or if you want to use the `marked` CLI tool: - +or if you want to use the `marked` CLI tool (not necessary when using npm run-scripts): + ``` bash npm install -g marked ``` - + ## Usage Minimal usage: From cd2f6f5b7091154c5526e79b5f3bfb4d15995a51 Mon Sep 17 00:00:00 2001 From: Matt Austin Date: Thu, 19 Jan 2017 15:03:37 -0800 Subject: [PATCH 015/308] added data: link fix to prevent xss --- lib/marked.js | 2 +- test/tests/links.sanitize.html | 1 + test/tests/links.sanitize.text | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 9f1584bb3b..2696019cda 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -875,7 +875,7 @@ Renderer.prototype.link = function(href, title, text) { } catch (e) { return ''; } - if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) { + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { return ''; } } diff --git a/test/tests/links.sanitize.html b/test/tests/links.sanitize.html index 5a5a973589..58d6f5ea38 100644 --- a/test/tests/links.sanitize.html +++ b/test/tests/links.sanitize.html @@ -1,4 +1,5 @@

+

\ No newline at end of file diff --git a/test/tests/links.sanitize.text b/test/tests/links.sanitize.text index c2158fc82e..ba5d09fed7 100644 --- a/test/tests/links.sanitize.text +++ b/test/tests/links.sanitize.text @@ -4,4 +4,6 @@ [URL](javascript:alert(1)) -[URL](javascript:document;alert(1)) \ No newline at end of file +[URL](javascript:document;alert(1)) + +[URL](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K) \ No newline at end of file From f06d62d4d6bdc8818d0efac3dbae1ff7f9b881ef Mon Sep 17 00:00:00 2001 From: Jeremy Blalock Date: Wed, 8 Feb 2017 11:00:20 -0800 Subject: [PATCH 016/308] Makes link text show up even if link is dangerous --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 2696019cda..a28b74f9b0 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -873,10 +873,10 @@ Renderer.prototype.link = function(href, title, text) { .replace(/[^\w:]/g, '') .toLowerCase(); } catch (e) { - return ''; + return text; } if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { - return ''; + return text; } } var out = ' Date: Fri, 10 Feb 2017 10:23:46 -0800 Subject: [PATCH 017/308] Updates tests --- test/tests/gfm_links_invalid.sanitize.html | 1 + test/tests/gfm_links_invalid.sanitize.text | 1 + test/tests/links.sanitize.html | 10 +++++----- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 test/tests/gfm_links_invalid.sanitize.html create mode 100644 test/tests/gfm_links_invalid.sanitize.text diff --git a/test/tests/gfm_links_invalid.sanitize.html b/test/tests/gfm_links_invalid.sanitize.html new file mode 100644 index 0000000000..4052efea6c --- /dev/null +++ b/test/tests/gfm_links_invalid.sanitize.html @@ -0,0 +1 @@ +

This should not be linked: http://example.com/%ff

diff --git a/test/tests/gfm_links_invalid.sanitize.text b/test/tests/gfm_links_invalid.sanitize.text new file mode 100644 index 0000000000..d92a8a8f57 --- /dev/null +++ b/test/tests/gfm_links_invalid.sanitize.text @@ -0,0 +1 @@ +This should not be linked: http://example.com/%ff diff --git a/test/tests/links.sanitize.html b/test/tests/links.sanitize.html index 58d6f5ea38..092ea471a0 100644 --- a/test/tests/links.sanitize.html +++ b/test/tests/links.sanitize.html @@ -1,5 +1,5 @@ -

-

-

-

-

\ No newline at end of file +

URL

+

URL

+

URL

+

URL

+

URL

From 82de6baed0a9df90b1d8b5570102acafa0c2e035 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Fri, 6 Oct 2017 20:40:21 -0400 Subject: [PATCH 018/308] Document the xhtml option --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 09f8ec3397..9ed68f8e49 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 e5b2998326bd3911cff76f6b79e1aad9469e24fa Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 1 Dec 2017 11:17:22 -0500 Subject: [PATCH 019/308] Initial commit --- bower.json | 1 - lib/marked.js | 37 +- marked.min.js | 2 +- package-lock.json | 2189 +++++++++++++++++ ...=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html | 35 + ...=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text | 27 + 6 files changed, 2286 insertions(+), 5 deletions(-) create mode 100644 package-lock.json create mode 100644 test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html create mode 100644 test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text diff --git a/bower.json b/bower.json index a2a8187759..ea79113cdc 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,5 @@ { "name": "marked", - "version": "0.3.4", "homepage": "https://github.com/chjj/marked", "authors": [ "Christopher Jeffrey " diff --git a/lib/marked.js b/lib/marked.js index 2696019cda..094f43f05f 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -457,7 +457,7 @@ var inline = { nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, - code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, + code: /^(`+)([\s\S]*?[^`])\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, del: noop, text: /^[\s\S]+?(?=[\\[^\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:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("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"+"|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.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();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,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;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,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});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,bq);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(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={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:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();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:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});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=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("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))){src=src.substring(cap[0].length);text=escape(cap[1]);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],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){var type=ordered?"ol":"ul";return"<"+type+">\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""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='
    ";return out};Renderer.prototype.image=function(href,title,text){var out=''+text+'":">";return out};Renderer.prototype.text=function(text){return text};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,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);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,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,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,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 replace(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}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:

    "+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};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;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{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file +(function(){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+));?/g,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 baseUrls[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?baseUrls[" "+e]=e+"/":baseUrls[" "+e]=e.replace(/[^\/]*$/,"")),e=baseUrls[" "+e],"//"===t.slice(0,2)?e.replace(/:[^]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[^]*/,"$1")+t:e+t}function h(){}function a(e){for(var t,n,r=1;rAn error occured:

    "+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=":"===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""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return""}this.options.baseUrl&&!originIndependentUrl.test(e)&&(e=o(this.options.baseUrl,e));var l='
    "},n.prototype.image=function(e,t,n){this.options.baseUrl&&!originIndependentUrl.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;eAbsolutization of RFC 3986 URIs + +

    Absolute URI

    + +

    section 4.3

    + +

    Network-path reference

    + +

    section 4.2

    + +

    Absolute path

    + +

    section 4.2

    + +

    Relative path

    + +

    section 4.2

    + +

    Dot-relative path

    + +

    section 3.3

    + +

    section 3.3

    + +

    Same-document query

    + +

    section 4.4

    + +

    Same-document fragment

    + +

    section 4.4

    + +

    Empty

    + +

    section 4.2

    diff --git a/test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text b/test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text new file mode 100644 index 0000000000..56f81820b1 --- /dev/null +++ b/test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text @@ -0,0 +1,27 @@ +# Absolutization of RFC 3986 URIs + +## Absolute URI +[![section 4.3](http://example.com/logo)](http://example.com/) + +## Network-path reference +[![section 4.2](//example.com/logo)](//example.com/) + +## Absolute path +[![section 4.2](/path/to/img)](/path/to/content) + +## Relative path +[![section 4.2](img)](content) + +## Dot-relative path +[![section 3.3](./img)](./content) + +[![section 3.3](../img)](../content) + +## Same-document query +[![section 4.4](?type=image)](?) + +## Same-document fragment +[![section 4.4](#img)](#) + +## Empty +[section 4.2]() From 02437f68c5b162711d7a93f7d0de9e75552d3c67 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 1 Dec 2017 11:23:27 -0500 Subject: [PATCH 020/308] 0.3.7 --- package-lock.json | 2 +- package.json | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0927289c3f..48465fe43d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "8fold-marked", - "version": "0.3.9", + "version": "0.3.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 75f31943db..3c28a710c7 100644 --- a/package.json +++ b/package.json @@ -2,17 +2,27 @@ "name": "marked", "description": "A markdown parser built for speed", "author": "Christopher Jeffrey", - "version": "0.3.6", + "version": "0.3.7", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", "preferGlobal": true, "repository": "git://github.com/chjj/marked.git", "homepage": "https://github.com/chjj/marked", - "bugs": { "url": "http://github.com/chjj/marked/issues" }, + "bugs": { + "url": "http://github.com/chjj/marked/issues" + }, "license": "MIT", - "keywords": ["markdown", "markup", "html"], - "tags": ["markdown", "markup", "html"], + "keywords": [ + "markdown", + "markup", + "html" + ], + "tags": [ + "markdown", + "markup", + "html" + ], "devDependencies": { "markdown": "*", "showdown": "*", @@ -20,5 +30,8 @@ "gulp-uglify": "^1.1.0", "gulp-concat": "^2.5.2" }, - "scripts": { "test": "node test", "bench": "node test --bench" } + "scripts": { + "test": "node test", + "bench": "node test --bench" + } } From 2f1ba440b50b1d60ea0923adc032a694aa63739c Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 1 Dec 2017 11:23:31 -0500 Subject: [PATCH 021/308] 0.3.8 --- 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 48465fe43d..102700b80c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "8fold-marked", - "version": "0.3.7", + "version": "0.3.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3c28a710c7..6e0cc4a874 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.7", + "version": "0.3.8", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", From 90376c0bcc30d133d6e547aad8f379596c691bba Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 1 Dec 2017 11:23:34 -0500 Subject: [PATCH 022/308] 0.3.9 --- 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 102700b80c..0927289c3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "8fold-marked", - "version": "0.3.8", + "version": "0.3.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6e0cc4a874..0668312a0c 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.8", + "version": "0.3.9", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", From d24427ef3b6499d09252ca038bdeec0f0b94c02f Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 1 Dec 2017 12:38:11 -0500 Subject: [PATCH 023/308] Add issue template --- .github/ISSUE_TEMPLATE.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..27fbcc1a13 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,11 @@ +## Expectation + + + +## Result + + + +## What was attempted + + From 753a7bd04a5067fef60e9dfc9acde61d1251d7ea Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 1 Dec 2017 12:54:48 -0500 Subject: [PATCH 024/308] 0.3.7 --- package.json | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 75f31943db..3c28a710c7 100644 --- a/package.json +++ b/package.json @@ -2,17 +2,27 @@ "name": "marked", "description": "A markdown parser built for speed", "author": "Christopher Jeffrey", - "version": "0.3.6", + "version": "0.3.7", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", "preferGlobal": true, "repository": "git://github.com/chjj/marked.git", "homepage": "https://github.com/chjj/marked", - "bugs": { "url": "http://github.com/chjj/marked/issues" }, + "bugs": { + "url": "http://github.com/chjj/marked/issues" + }, "license": "MIT", - "keywords": ["markdown", "markup", "html"], - "tags": ["markdown", "markup", "html"], + "keywords": [ + "markdown", + "markup", + "html" + ], + "tags": [ + "markdown", + "markup", + "html" + ], "devDependencies": { "markdown": "*", "showdown": "*", @@ -20,5 +30,8 @@ "gulp-uglify": "^1.1.0", "gulp-concat": "^2.5.2" }, - "scripts": { "test": "node test", "bench": "node test --bench" } + "scripts": { + "test": "node test", + "bench": "node test --bench" + } } From 2a920832e9f8e747399f89d0d7531680a5beba45 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 1 Dec 2017 12:58:35 -0500 Subject: [PATCH 025/308] Release 0.3.7 --- marked.min.js | 2 +- package-lock.json | 2189 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2190 insertions(+), 1 deletion(-) create mode 100644 package-lock.json diff --git a/marked.min.js b/marked.min.js index 555c1dc1d9..e4c3205560 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(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,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:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("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"+"|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.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();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,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;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,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});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,bq);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(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={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:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();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:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});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=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("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))){src=src.substring(cap[0].length);text=escape(cap[1]);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],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){var type=ordered?"ol":"ul";return"<"+type+">\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""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='
    ";return out};Renderer.prototype.image=function(href,title,text){var out=''+text+'":">";return out};Renderer.prototype.text=function(text){return text};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,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);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,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,flags,j;cell="";for(i=0;i/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,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 replace(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}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;iAn error occured:

    "+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};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;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{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); \ No newline at end of file +(function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||a.defaults,this.rules=p.normal,this.options.gfm&&(this.options.tables?this.rules=p.tables:this.rules=p.gfm)}function t(e,t){if(this.options=t||a.defaults,this.links=e,this.rules=u.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=u.breaks:this.rules=u.gfm:this.options.pedantic&&(this.rules=u.pedantic)}function n(e){this.options=e||{}}function r(e){this.tokens=[],this.token=null,this.options=e||a.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+));?/g,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(){}function h(e){for(var t,n,r=1;rAn error occured:

    "+s(c.message+"",!0)+"
    ";throw c}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:o,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:o,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:o,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=l(p.item,"gm")(/bull/g,p.bullet)(),p.list=l(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=l(p.blockquote)("def",p.def)(),p._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",p.html=l(p.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,p._tag)(),p.paragraph=l(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=h({},p),p.gfm=h({},p.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),p.gfm.paragraph=l(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=h({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=p,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,u,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")},u=0;u ?/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,u=0;u1&&o.length>1||(e=i.slice(u+1).join("\n")+e,u=c-1)),s=r||/\n\n(?!\s*$)/.test(h),u!==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")},u=0;u])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:o,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:o,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,u.link=l(u.link)("inside",u._inside)("href",u._href)(),u.reflink=l(u.reflink)("inside",u._inside)(),u.normal=h({},u),u.pedantic=h({},u.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),u.gfm=h({},u.normal,{escape:l(u.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(u.text)("]|","~]|")("|","|https?://|")()}),u.breaks=h({},u.gfm,{br:l(u.br)("{2,}","*")(),text:l(u.gfm.text)("{2,}","*")()}),t.rules=u,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=":"===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],!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""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return""}var l='
    "},n.prototype.image=function(e,t,n){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 Date: Thu, 14 Dec 2017 20:35:04 -0500 Subject: [PATCH 026/308] Fix typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 09f8ec3397..39ef13b99c 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ default with the old behavior moved into `pedantic`. Type: `boolean` Default: `false` -Use "smart" typograhic punctuation for things like quotes and dashes. +Use "smart" typographic punctuation for things like quotes and dashes. ## Access to lexer and parser @@ -297,7 +297,7 @@ $ cat hello.html 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 unnecesarily long time. +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. From 98ac7a43958014832788b9d01580f394c84bfb27 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:42:06 +0200 Subject: [PATCH 027/308] Fixed https://github.com/chjj/marked/issues/465 --- lib/marked.js | 4 ---- test/tests/def_blocks.html | 4 +++- test/tests/toplevel_paragraphs.gfm.text | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 2696019cda..5655e03991 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -39,10 +39,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' diff --git a/test/tests/def_blocks.html b/test/tests/def_blocks.html index 14edc97a41..ec0d11934d 100644 --- a/test/tests/def_blocks.html +++ b/test/tests/def_blocks.html @@ -6,7 +6,8 @@
    -

    hello

    +

    hello +[2]: hello

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

    foo bar +[1]: foo bar

    diff --git a/test/tests/toplevel_paragraphs.gfm.text b/test/tests/toplevel_paragraphs.gfm.text index 66366c07c0..6e7524449b 100644 --- a/test/tests/toplevel_paragraphs.gfm.text +++ b/test/tests/toplevel_paragraphs.gfm.text @@ -30,6 +30,7 @@ hello world how are you hello [world][how] + [how]: /are/you
    hello
    From a477d1d0e285e1b0aed91ea9048bc66e85324b2a 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 028/308] Overwritten the test for a more precise wording. --- test/tests/toplevel_paragraphs.gfm.html | 30 ++++++++++++------------- test/tests/toplevel_paragraphs.gfm.text | 30 ++++++++++++------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/test/tests/toplevel_paragraphs.gfm.html b/test/tests/toplevel_paragraphs.gfm.html index 970c6f19f6..d15bfccef0 100644 --- a/test/tests/toplevel_paragraphs.gfm.html +++ b/test/tests/toplevel_paragraphs.gfm.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/tests/toplevel_paragraphs.gfm.text b/test/tests/toplevel_paragraphs.gfm.text index 6e7524449b..8430b9f86c 100644 --- a/test/tests/toplevel_paragraphs.gfm.text +++ b/test/tests/toplevel_paragraphs.gfm.text @@ -1,33 +1,33 @@ 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 cf8ed1d1e03a5ba3b719ed3de1a7cdc1b7be1d9f Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Fri, 22 Dec 2017 11:05:30 -0600 Subject: [PATCH 029/308] allow test flags to be more than true or false --- test/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index 9c30b9a10a..415e8d6c91 100644 --- a/test/index.js +++ b/test/index.js @@ -101,7 +101,10 @@ main: }); flags.forEach(function(key) { var val = true; - if (key.indexOf('no') === 0) { + if(key.indexOf('=') !== -1) { + val = decodeURIComponent(key.substring(key.indexOf('=') + 1)); + key = key.substring(0, key.indexOf('=')); + } else if (key.indexOf('no') === 0) { key = key.substring(2); val = false; } From 76530ed39482cfbbaf22007f793632b6c09a7620 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Fri, 22 Dec 2017 11:05:49 -0600 Subject: [PATCH 030/308] minify --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index 14089ff6bf..8807beef93 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(){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+));?/g,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 baseUrls[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?baseUrls[" "+e]=e+"/":baseUrls[" "+e]=e.replace(/[^\/]*$/,"")),e=baseUrls[" "+e],"//"===t.slice(0,2)?e.replace(/:[^]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[^]*/,"$1")+t:e+t}function h(){}function a(e){for(var t,n,r=1;rAn error occured:

    "+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=":"===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""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return""}this.options.baseUrl&&!originIndependentUrl.test(e)&&(e=o(this.options.baseUrl,e));var l='
    "},n.prototype.image=function(e,t,n){this.options.baseUrl&&!originIndependentUrl.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+));?/g,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 baseUrls[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?baseUrls[" "+e]=e+"/":baseUrls[" "+e]=e.replace(/[^\/]*$/,"")),e=baseUrls[" "+e],"//"===t.slice(0,2)?e.replace(/:[^]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[^]*/,"$1")+t:e+t}function h(){}function a(e){for(var t,n,r=1;rAn error occured:

    "+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._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=":"===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""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return""}this.options.baseUrl&&!originIndependentUrl.test(e)&&(e=o(this.options.baseUrl,e));var l='
    "},n.prototype.image=function(e,t,n){this.options.baseUrl&&!originIndependentUrl.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 Date: Fri, 22 Dec 2017 22:59:23 -0600 Subject: [PATCH 031/308] sanatize uppercase hexidecimal fixes #925 --- lib/marked.js | 4 ++-- test/tests/uppercase_hex.sanitize.html | 2 ++ test/tests/uppercase_hex.sanitize.text | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 test/tests/uppercase_hex.sanitize.html create mode 100644 test/tests/uppercase_hex.sanitize.text diff --git a/lib/marked.js b/lib/marked.js index 133aa0db5b..45391f8d77 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1096,8 +1096,8 @@ function escape(html, encode) { } function unescape(html) { - // explicitly match decimal, hex, and named HTML entities - return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) { + // 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 ':'; if (n.charAt(0) === '#') { diff --git a/test/tests/uppercase_hex.sanitize.html b/test/tests/uppercase_hex.sanitize.html new file mode 100644 index 0000000000..15b722bfe9 --- /dev/null +++ b/test/tests/uppercase_hex.sanitize.html @@ -0,0 +1,2 @@ +

    lowerlower +upperupper

    diff --git a/test/tests/uppercase_hex.sanitize.text b/test/tests/uppercase_hex.sanitize.text new file mode 100644 index 0000000000..bea65b9b82 --- /dev/null +++ b/test/tests/uppercase_hex.sanitize.text @@ -0,0 +1,2 @@ +lower[click me](javascript:...)lower +upper[click me](javascript:...)upper From cb72584c5d9d32ebfdbb99e35fb9b81af2b79686 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Fri, 22 Dec 2017 23:13:53 -0600 Subject: [PATCH 032/308] escape non-mangled xss fixes #926 --- lib/marked.js | 6 ++++-- test/tests/mangle_xss.sanatize.nomangle.html | 3 +++ test/tests/mangle_xss.sanatize.nomangle.text | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 test/tests/mangle_xss.sanatize.nomangle.html create mode 100644 test/tests/mangle_xss.sanatize.nomangle.text diff --git a/lib/marked.js b/lib/marked.js index 45391f8d77..d231cf02e4 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -574,9 +574,11 @@ InlineLexer.prototype.output = function(src) { if (cap = this.rules.autolink.exec(src)) { src = src.substring(cap[0].length); if (cap[2] === '@') { - text = cap[1].charAt(6) === ':' + text = escape( + cap[1].charAt(6) === ':' ? this.mangle(cap[1].substring(7)) - : this.mangle(cap[1]); + : this.mangle(cap[1]) + ); href = this.mangle('mailto:') + text; } else { text = escape(cap[1]); diff --git a/test/tests/mangle_xss.sanatize.nomangle.html b/test/tests/mangle_xss.sanatize.nomangle.html new file mode 100644 index 0000000000..9f87f09a43 --- /dev/null +++ b/test/tests/mangle_xss.sanatize.nomangle.html @@ -0,0 +1,3 @@ +

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

    + +

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

    diff --git a/test/tests/mangle_xss.sanatize.nomangle.text b/test/tests/mangle_xss.sanatize.nomangle.text new file mode 100644 index 0000000000..c44503da00 --- /dev/null +++ b/test/tests/mangle_xss.sanatize.nomangle.text @@ -0,0 +1,3 @@ +< + + From 43fc870c4e441d14e23cf9e8df30b990dbc36987 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Fri, 22 Dec 2017 23:14:10 -0600 Subject: [PATCH 033/308] minify --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index 8807beef93..e0c8dd0fd5 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(){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+));?/g,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 baseUrls[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?baseUrls[" "+e]=e+"/":baseUrls[" "+e]=e.replace(/[^\/]*$/,"")),e=baseUrls[" "+e],"//"===t.slice(0,2)?e.replace(/:[^]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[^]*/,"$1")+t:e+t}function h(){}function a(e){for(var t,n,r=1;rAn error occured:

    "+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._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=":"===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""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return""}this.options.baseUrl&&!originIndependentUrl.test(e)&&(e=o(this.options.baseUrl,e));var l='
    "},n.prototype.image=function(e,t,n){this.options.baseUrl&&!originIndependentUrl.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 baseUrls[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?baseUrls[" "+e]=e+"/":baseUrls[" "+e]=e.replace(/[^\/]*$/,"")),e=baseUrls[" "+e],"//"===t.slice(0,2)?e.replace(/:[^]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[^]*/,"$1")+t:e+t}function h(){}function a(e){for(var t,n,r=1;rAn error occured:

    "+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._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""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return""}this.options.baseUrl&&!originIndependentUrl.test(e)&&(e=o(this.options.baseUrl,e));var l='
    "},n.prototype.image=function(e,t,n){this.options.baseUrl&&!originIndependentUrl.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 Date: Mon, 25 Dec 2017 17:53:35 -0500 Subject: [PATCH 034/308] Update copyright to 2018 in README Because the new year is upon us --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 657b3a6635..3ec9fdae7e 100644 --- a/README.md +++ b/README.md @@ -393,7 +393,7 @@ all code is your original work. `` ## License -Copyright (c) 2011-2015, Christopher Jeffrey. (MIT License) +Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) See LICENSE for more info. From e0388905c96ff3a31d0c4279e7c5361fe5e3f8de Mon Sep 17 00:00:00 2001 From: Alexander Gromnitsky Date: Tue, 26 Dec 2017 06:01:34 +0200 Subject: [PATCH 035/308] add a test case for links defs & paragraphs --- test/tests/links_reference_style.html | 10 ++++++++++ test/tests/links_reference_style.text | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/test/tests/links_reference_style.html b/test/tests/links_reference_style.html index 51f41871e5..2ec1b41f21 100644 --- a/test/tests/links_reference_style.html +++ b/test/tests/links_reference_style.html @@ -43,6 +43,16 @@

    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 diff --git a/test/tests/links_reference_style.text b/test/tests/links_reference_style.text index 341ec88e3d..39aa93bbae 100644 --- a/test/tests/links_reference_style.text +++ b/test/tests/links_reference_style.text @@ -58,6 +58,16 @@ 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 * * * From 115b65e0825cc115b2c4e6efd18dd05fdfc3d7f1 Mon Sep 17 00:00:00 2001 From: Kara Leary Date: Wed, 27 Dec 2017 12:11:37 -1000 Subject: [PATCH 036/308] declare undeclared variables fix for https://github.com/chjj/marked/issues/990 --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 6f0e87c4c5..3eb1f9dfca 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1144,8 +1144,8 @@ function resolveUrl(base, href) { return base + href; } } -baseUrls = {}; -originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; +var baseUrls = {}; +var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; function noop() {} noop.exec = noop; From d978de4f50d8a30c8fa126a3c12023ad44ae6f1a Mon Sep 17 00:00:00 2001 From: smhg Date: Mon, 1 Jan 2018 14:52:55 +0100 Subject: [PATCH 037/308] support older regex engines --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 6f0e87c4c5..4faefb38d6 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1137,9 +1137,9 @@ function resolveUrl(base, href) { base = baseUrls[' ' + base]; if (href.slice(0, 2) === '//') { - return base.replace(/:[^]*/, ':') + href; + return base.replace(/:[\s\S]*/, ':') + href; } else if (href.charAt(0) === '/') { - return base.replace(/(:\/*[^/]*)[^]*/, '$1') + href; + return base.replace(/(:\/*[^/]*)[\s\S]*/, '$1') + href; } else { return base + href; } From 1ec0bf387f2f4795217c787f49facff5e5cc9ecc Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 2 Jan 2018 15:10:01 +0100 Subject: [PATCH 038/308] 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 8ab79819e4..e6f8804e28 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 13e97eb56b747d67864471608f29aa9147a6a76a 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: Tue, 2 Jan 2018 19:05:01 +0200 Subject: [PATCH 039/308] Fix auto_links secure Related to https://github.com/chjj/marked/pull/814 --- lib/marked.js | 4 ++-- test/tests/auto_links.html | 22 +++++++++++++++----- test/tests/auto_links.text | 21 ++++++++++++++----- test/tests/mangle_xss.sanatize.nomangle.html | 2 +- 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 6f0e87c4c5..bf335fe074 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -445,9 +445,9 @@ Lexer.prototype.token = function(src, top, bq) { var inline = { escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, - autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, + autolink: /^<([^ <>]+(@|:\/)[^ <>]+)>/, url: noop, - tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, + tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/, link: /^!?\[(inside)\]\(href\)/, reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, diff --git a/test/tests/auto_links.html b/test/tests/auto_links.html index f8df9852c7..898fed622d 100644 --- a/test/tests/auto_links.html +++ b/test/tests/auto_links.html @@ -1,18 +1,30 @@

    Link: http://example.com/.

    -

    With an ampersand: http://example.com/?foo=1&bar=2

    +

    With an ampersand: http://example1.com/?foo=1&bar=2

    -

    Blockquoted: http://example.com/

    +

    Blockquoted: http://example3.com/

    -

    Auto-links should not occur here: <http://example.com/>

    +

    Auto-links should not occur here: <http://example4.com/>

    -
    or here: <http://example.com/>
    +
    or here: <http://example5.com/>
     
    + +

    Open angle bracket with link:

    + +

    <http://example6.com

    + +

    With space: < http://example7.com

    + +

    With content: <1 http://example8.com

    + +

    hello world +http://example9.com +

    diff --git a/test/tests/auto_links.text b/test/tests/auto_links.text index f85767b48a..7a017f00ae 100644 --- a/test/tests/auto_links.text +++ b/test/tests/auto_links.text @@ -1,13 +1,24 @@ Link: . -With an ampersand: +With an ampersand: * In a list? -* +* * It should. -> Blockquoted: +> Blockquoted: -Auto-links should not occur here: `` +Auto-links should not occur here: `` - or here: + or here: + +Open angle bracket with link: + +< + +With space: < + +With content: <1 + +hello world + diff --git a/test/tests/mangle_xss.sanatize.nomangle.html b/test/tests/mangle_xss.sanatize.nomangle.html index 9f87f09a43..83a7b355d6 100644 --- a/test/tests/mangle_xss.sanatize.nomangle.html +++ b/test/tests/mangle_xss.sanatize.nomangle.html @@ -1,3 +1,3 @@ -

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

    +

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

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

    From 950e65ec51775151aab1e12fa10d0244375d4b1e Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 2 Jan 2018 11:12:30 -0600 Subject: [PATCH 040/308] add fixed tests to /new --- test/new/def_blocks.html | 4 +- test/new/links.sanitize.html | 5 ++ test/new/links.sanitize.text | 9 +++ test/new/links_reference_style.html | 62 ++++++++++++++ test/new/links_reference_style.text | 81 +++++++++++++++++++ test/new/mangle_xss.sanatize.nomangle.html | 3 + test/new/mangle_xss.sanatize.nomangle.text | 3 + ...=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html | 35 ++++++++ ...=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text | 27 +++++++ test/new/text.smartypants.html | 2 +- test/new/text.smartypants.text | 2 +- test/new/toplevel_paragraphs.gfm.html | 30 +++---- test/new/toplevel_paragraphs.gfm.text | 31 +++---- test/new/uppercase_hex.sanitize.html | 2 + test/new/uppercase_hex.sanitize.text | 2 + 15 files changed, 265 insertions(+), 33 deletions(-) create mode 100644 test/new/links.sanitize.html create mode 100644 test/new/links.sanitize.text create mode 100644 test/new/links_reference_style.html create mode 100644 test/new/links_reference_style.text create mode 100644 test/new/mangle_xss.sanatize.nomangle.html create mode 100644 test/new/mangle_xss.sanatize.nomangle.text create mode 100644 test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html create mode 100644 test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text create mode 100644 test/new/uppercase_hex.sanitize.html create mode 100644 test/new/uppercase_hex.sanitize.text diff --git a/test/new/def_blocks.html b/test/new/def_blocks.html index 14edc97a41..ec0d11934d 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 +[1]: foo bar

    diff --git a/test/new/links.sanitize.html b/test/new/links.sanitize.html new file mode 100644 index 0000000000..58d6f5ea38 --- /dev/null +++ b/test/new/links.sanitize.html @@ -0,0 +1,5 @@ +

    +

    +

    +

    +

    \ No newline at end of file diff --git a/test/new/links.sanitize.text b/test/new/links.sanitize.text new file mode 100644 index 0000000000..ba5d09fed7 --- /dev/null +++ b/test/new/links.sanitize.text @@ -0,0 +1,9 @@ +[URL](javascript:alert) + +[URL](vbscript:alert) + +[URL](javascript:alert(1)) + +[URL](javascript:document;alert(1)) + +[URL](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K) \ No newline at end of file diff --git a/test/new/links_reference_style.html b/test/new/links_reference_style.html new file mode 100644 index 0000000000..2ec1b41f21 --- /dev/null +++ b/test/new/links_reference_style.html @@ -0,0 +1,62 @@ +

    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.text b/test/new/links_reference_style.text new file mode 100644 index 0000000000..39aa93bbae --- /dev/null +++ b/test/new/links_reference_style.text @@ -0,0 +1,81 @@ +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/ diff --git a/test/new/mangle_xss.sanatize.nomangle.html b/test/new/mangle_xss.sanatize.nomangle.html new file mode 100644 index 0000000000..9f87f09a43 --- /dev/null +++ b/test/new/mangle_xss.sanatize.nomangle.html @@ -0,0 +1,3 @@ +

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

    + +

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

    diff --git a/test/new/mangle_xss.sanatize.nomangle.text b/test/new/mangle_xss.sanatize.nomangle.text new file mode 100644 index 0000000000..c44503da00 --- /dev/null +++ b/test/new/mangle_xss.sanatize.nomangle.text @@ -0,0 +1,3 @@ +< + + diff --git a/test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html b/test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html new file mode 100644 index 0000000000..ee7f3bff0e --- /dev/null +++ b/test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html @@ -0,0 +1,35 @@ +

    Absolutization of RFC 3986 URIs

    + +

    Absolute URI

    + +

    section 4.3

    + +

    Network-path reference

    + +

    section 4.2

    + +

    Absolute path

    + +

    section 4.2

    + +

    Relative path

    + +

    section 4.2

    + +

    Dot-relative path

    + +

    section 3.3

    + +

    section 3.3

    + +

    Same-document query

    + +

    section 4.4

    + +

    Same-document fragment

    + +

    section 4.4

    + +

    Empty

    + +

    section 4.2

    diff --git a/test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text b/test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text new file mode 100644 index 0000000000..56f81820b1 --- /dev/null +++ b/test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text @@ -0,0 +1,27 @@ +# Absolutization of RFC 3986 URIs + +## Absolute URI +[![section 4.3](http://example.com/logo)](http://example.com/) + +## Network-path reference +[![section 4.2](//example.com/logo)](//example.com/) + +## Absolute path +[![section 4.2](/path/to/img)](/path/to/content) + +## Relative path +[![section 4.2](img)](content) + +## Dot-relative path +[![section 3.3](./img)](./content) + +[![section 3.3](../img)](../content) + +## Same-document query +[![section 4.4](?type=image)](?) + +## Same-document fragment +[![section 4.4](#img)](#) + +## Empty +[section 4.2]() diff --git a/test/new/text.smartypants.html b/test/new/text.smartypants.html index 22997c4c12..33718eeac9 100644 --- a/test/new/text.smartypants.html +++ b/test/new/text.smartypants.html @@ -1,4 +1,4 @@ -

    Hello world ‘how’ “are” you — today…

    +

    Hello world ‘how’ “are” you – today…

    “It’s a more ‘challenging’ smartypants test…”

    diff --git a/test/new/text.smartypants.text b/test/new/text.smartypants.text index d91c8dc388..24e204643e 100644 --- a/test/new/text.smartypants.text +++ b/test/new/text.smartypants.text @@ -2,5 +2,5 @@ Hello world 'how' "are" you -- today... "It's a more 'challenging' smartypants test..." -'And,' as a bonus -- "one +'And,' as a bonus --- "one multiline" test! diff --git a/test/new/toplevel_paragraphs.gfm.html b/test/new/toplevel_paragraphs.gfm.html index 970c6f19f6..d15bfccef0 100644 --- a/test/new/toplevel_paragraphs.gfm.html +++ b/test/new/toplevel_paragraphs.gfm.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.gfm.text b/test/new/toplevel_paragraphs.gfm.text index 66366c07c0..8430b9f86c 100644 --- a/test/new/toplevel_paragraphs.gfm.text +++ b/test/new/toplevel_paragraphs.gfm.text @@ -1,35 +1,36 @@ 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] + [how]: /are/you
    hello
    diff --git a/test/new/uppercase_hex.sanitize.html b/test/new/uppercase_hex.sanitize.html new file mode 100644 index 0000000000..15b722bfe9 --- /dev/null +++ b/test/new/uppercase_hex.sanitize.html @@ -0,0 +1,2 @@ +

    lowerlower +upperupper

    diff --git a/test/new/uppercase_hex.sanitize.text b/test/new/uppercase_hex.sanitize.text new file mode 100644 index 0000000000..bea65b9b82 --- /dev/null +++ b/test/new/uppercase_hex.sanitize.text @@ -0,0 +1,2 @@ +lower[click me](javascript:...)lower +upper[click me](javascript:...)upper From f31d3fa43fc1b904a95388d909308fb329beb70b Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 2 Jan 2018 11:59:52 -0600 Subject: [PATCH 041/308] change .text to .md --- test/index.js | 16 ++++++++-------- .../{autolink_lines.text => autolink_lines.md} | 0 ...te_list_item.text => blockquote_list_item.md} | 0 ...sitive_refs.text => case_insensitive_refs.md} | 0 test/new/{def_blocks.text => def_blocks.md} | 0 test/new/{double_link.text => double_link.md} | 0 .../{escaped_angles.text => escaped_angles.md} | 0 ...gfm_break.breaks.text => gfm_break.breaks.md} | 0 test/new/{gfm_code.text => gfm_code.md} | 0 ...gfm_code_hr_list.text => gfm_code_hr_list.md} | 0 test/new/{gfm_del.text => gfm_del.md} | 0 test/new/{gfm_em.text => gfm_em.md} | 0 .../{gfm_hashtag.gfm.text => gfm_hashtag.gfm.md} | 0 ...m_hashtag.nogfm.text => gfm_hashtag.nogfm.md} | 0 test/new/{gfm_links.text => gfm_links.md} | 0 test/new/{gfm_tables.text => gfm_tables.md} | 0 .../new/{hr_list_break.text => hr_list_break.md} | 0 ...lazy_blockquotes.text => lazy_blockquotes.md} | 0 .../{links.sanitize.text => links.sanitize.md} | 0 ...rence_style.text => links_reference_style.md} | 0 .../{list_item_text.text => list_item_text.md} | 0 test/new/{loose_lists.text => loose_lists.md} | 0 test/new/{main.text => main.md} | 0 ...ngle.text => mangle_xss.sanatize.nomangle.md} | 0 test/new/{nested_code.text => nested_code.md} | 0 test/new/{nested_em.text => nested_em.md} | 0 ...ed_square_link.text => nested_square_link.md} | 0 test/new/{not_a_link.text => not_a_link.md} | 0 test/new/{ref_paren.text => ref_paren.md} | 0 ...eUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md} | 0 test/new/{same_bullet.text => same_bullet.md} | 0 ...text.smartypants.text => text.smartypants.md} | 0 ...raphs.gfm.text => toplevel_paragraphs.gfm.md} | 0 test/new/{tricky_list.text => tricky_list.md} | 0 ...x.sanitize.text => uppercase_hex.sanitize.md} | 0 ...encoding.text => amps_and_angles_encoding.md} | 0 test/original/{auto_links.text => auto_links.md} | 0 ...ckslash_escapes.text => backslash_escapes.md} | 0 ...ocks.text => blockquotes_with_code_blocks.md} | 0 .../{code_blocks.text => code_blocks.md} | 0 test/original/{code_spans.text => code_spans.md} | 0 ...d_wrapped_paragraphs_with_list_like_lines.md} | 0 ...horizontal_rules.text => horizontal_rules.md} | 0 ...tml_advanced.text => inline_html_advanced.md} | 0 ...tml_comments.text => inline_html_comments.md} | 0 ...ne_html_simple.text => inline_html_simple.md} | 0 ...s_inline_style.text => links_inline_style.md} | 0 ...rence_style.text => links_reference_style.md} | 0 ...erences.text => links_shortcut_references.md} | 0 ...n_titles.text => literal_quotes_in_titles.md} | 0 ...ics.text => markdown_documentation_basics.md} | 0 ...tax.text => markdown_documentation_syntax.md} | 0 ...ed_blockquotes.text => nested_blockquotes.md} | 0 ...lists.text => ordered_and_unordered_lists.md} | 0 ...m_together.text => strong_and_em_together.md} | 0 test/original/{tabs.text => tabs.md} | 0 test/original/{tidyness.text => tidyness.md} | 0 ...encoding.text => amps_and_angles_encoding.md} | 0 test/tests/{auto_links.text => auto_links.md} | 0 .../{autolink_lines.text => autolink_lines.md} | 0 ...ckslash_escapes.text => backslash_escapes.md} | 0 ...te_list_item.text => blockquote_list_item.md} | 0 ...ocks.text => blockquotes_with_code_blocks.md} | 0 ...sitive_refs.text => case_insensitive_refs.md} | 0 test/tests/{code_blocks.text => code_blocks.md} | 0 test/tests/{code_spans.text => code_spans.md} | 0 test/tests/{def_blocks.text => def_blocks.md} | 0 test/tests/{double_link.text => double_link.md} | 0 .../{escaped_angles.text => escaped_angles.md} | 0 ...gfm_break.breaks.text => gfm_break.breaks.md} | 0 test/tests/{gfm_code.text => gfm_code.md} | 0 ...gfm_code_hr_list.text => gfm_code_hr_list.md} | 0 test/tests/{gfm_del.text => gfm_del.md} | 0 test/tests/{gfm_em.text => gfm_em.md} | 0 .../{gfm_hashtag.gfm.text => gfm_hashtag.gfm.md} | 0 ...m_hashtag.nogfm.text => gfm_hashtag.nogfm.md} | 0 test/tests/{gfm_links.text => gfm_links.md} | 0 test/tests/{gfm_tables.text => gfm_tables.md} | 0 ...ped_paragraphs_with_list_like_lines.nogfm.md} | 0 ...horizontal_rules.text => horizontal_rules.md} | 0 .../{hr_list_break.text => hr_list_break.md} | 0 ...tml_advanced.text => inline_html_advanced.md} | 0 ...tml_comments.text => inline_html_comments.md} | 0 ...ne_html_simple.text => inline_html_simple.md} | 0 ...lazy_blockquotes.text => lazy_blockquotes.md} | 0 .../{links.sanitize.text => links.sanitize.md} | 0 ...s_inline_style.text => links_inline_style.md} | 0 ...rence_style.text => links_reference_style.md} | 0 ...erences.text => links_shortcut_references.md} | 0 .../{list_item_text.text => list_item_text.md} | 0 ...n_titles.text => literal_quotes_in_titles.md} | 0 test/tests/{loose_lists.text => loose_lists.md} | 0 test/tests/{main.text => main.md} | 0 ...ngle.text => mangle_xss.sanatize.nomangle.md} | 0 ...ics.text => markdown_documentation_basics.md} | 0 ...tax.text => markdown_documentation_syntax.md} | 0 ...ed_blockquotes.text => nested_blockquotes.md} | 0 test/tests/{nested_code.text => nested_code.md} | 0 test/tests/{nested_em.text => nested_em.md} | 0 ...ed_square_link.text => nested_square_link.md} | 0 test/tests/{not_a_link.text => not_a_link.md} | 0 ...lists.text => ordered_and_unordered_lists.md} | 0 test/tests/{ref_paren.text => ref_paren.md} | 0 ...eUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md} | 0 test/tests/{same_bullet.text => same_bullet.md} | 0 ...m_together.text => strong_and_em_together.md} | 0 test/tests/{tabs.text => tabs.md} | 0 ...text.smartypants.text => text.smartypants.md} | 0 test/tests/{tidyness.text => tidyness.md} | 0 ...raphs.gfm.text => toplevel_paragraphs.gfm.md} | 0 test/tests/{tricky_list.text => tricky_list.md} | 0 ...x.sanitize.text => uppercase_hex.sanitize.md} | 0 112 files changed, 8 insertions(+), 8 deletions(-) rename test/new/{autolink_lines.text => autolink_lines.md} (100%) rename test/new/{blockquote_list_item.text => blockquote_list_item.md} (100%) rename test/new/{case_insensitive_refs.text => case_insensitive_refs.md} (100%) rename test/new/{def_blocks.text => def_blocks.md} (100%) rename test/new/{double_link.text => double_link.md} (100%) rename test/new/{escaped_angles.text => escaped_angles.md} (100%) rename test/new/{gfm_break.breaks.text => gfm_break.breaks.md} (100%) rename test/new/{gfm_code.text => gfm_code.md} (100%) rename test/new/{gfm_code_hr_list.text => gfm_code_hr_list.md} (100%) rename test/new/{gfm_del.text => gfm_del.md} (100%) rename test/new/{gfm_em.text => gfm_em.md} (100%) rename test/new/{gfm_hashtag.gfm.text => gfm_hashtag.gfm.md} (100%) rename test/new/{gfm_hashtag.nogfm.text => gfm_hashtag.nogfm.md} (100%) rename test/new/{gfm_links.text => gfm_links.md} (100%) rename test/new/{gfm_tables.text => gfm_tables.md} (100%) rename test/new/{hr_list_break.text => hr_list_break.md} (100%) rename test/new/{lazy_blockquotes.text => lazy_blockquotes.md} (100%) rename test/new/{links.sanitize.text => links.sanitize.md} (100%) rename test/new/{links_reference_style.text => links_reference_style.md} (100%) rename test/new/{list_item_text.text => list_item_text.md} (100%) rename test/new/{loose_lists.text => loose_lists.md} (100%) rename test/new/{main.text => main.md} (100%) rename test/new/{mangle_xss.sanatize.nomangle.text => mangle_xss.sanatize.nomangle.md} (100%) rename test/new/{nested_code.text => nested_code.md} (100%) rename test/new/{nested_em.text => nested_em.md} (100%) rename test/new/{nested_square_link.text => nested_square_link.md} (100%) rename test/new/{not_a_link.text => not_a_link.md} (100%) rename test/new/{ref_paren.text => ref_paren.md} (100%) rename test/new/{relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text => relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md} (100%) rename test/new/{same_bullet.text => same_bullet.md} (100%) rename test/new/{text.smartypants.text => text.smartypants.md} (100%) rename test/new/{toplevel_paragraphs.gfm.text => toplevel_paragraphs.gfm.md} (100%) rename test/new/{tricky_list.text => tricky_list.md} (100%) rename test/new/{uppercase_hex.sanitize.text => uppercase_hex.sanitize.md} (100%) rename test/original/{amps_and_angles_encoding.text => amps_and_angles_encoding.md} (100%) rename test/original/{auto_links.text => auto_links.md} (100%) rename test/original/{backslash_escapes.text => backslash_escapes.md} (100%) rename test/original/{blockquotes_with_code_blocks.text => blockquotes_with_code_blocks.md} (100%) rename test/original/{code_blocks.text => code_blocks.md} (100%) rename test/original/{code_spans.text => code_spans.md} (100%) rename test/original/{hard_wrapped_paragraphs_with_list_like_lines.text => hard_wrapped_paragraphs_with_list_like_lines.md} (100%) rename test/original/{horizontal_rules.text => horizontal_rules.md} (100%) rename test/original/{inline_html_advanced.text => inline_html_advanced.md} (100%) rename test/original/{inline_html_comments.text => inline_html_comments.md} (100%) rename test/original/{inline_html_simple.text => inline_html_simple.md} (100%) rename test/original/{links_inline_style.text => links_inline_style.md} (100%) rename test/original/{links_reference_style.text => links_reference_style.md} (100%) rename test/original/{links_shortcut_references.text => links_shortcut_references.md} (100%) rename test/original/{literal_quotes_in_titles.text => literal_quotes_in_titles.md} (100%) rename test/original/{markdown_documentation_basics.text => markdown_documentation_basics.md} (100%) rename test/original/{markdown_documentation_syntax.text => markdown_documentation_syntax.md} (100%) rename test/original/{nested_blockquotes.text => nested_blockquotes.md} (100%) rename test/original/{ordered_and_unordered_lists.text => ordered_and_unordered_lists.md} (100%) rename test/original/{strong_and_em_together.text => strong_and_em_together.md} (100%) rename test/original/{tabs.text => tabs.md} (100%) rename test/original/{tidyness.text => tidyness.md} (100%) rename test/tests/{amps_and_angles_encoding.text => amps_and_angles_encoding.md} (100%) rename test/tests/{auto_links.text => auto_links.md} (100%) rename test/tests/{autolink_lines.text => autolink_lines.md} (100%) rename test/tests/{backslash_escapes.text => backslash_escapes.md} (100%) rename test/tests/{blockquote_list_item.text => blockquote_list_item.md} (100%) rename test/tests/{blockquotes_with_code_blocks.text => blockquotes_with_code_blocks.md} (100%) rename test/tests/{case_insensitive_refs.text => case_insensitive_refs.md} (100%) rename test/tests/{code_blocks.text => code_blocks.md} (100%) rename test/tests/{code_spans.text => code_spans.md} (100%) rename test/tests/{def_blocks.text => def_blocks.md} (100%) rename test/tests/{double_link.text => double_link.md} (100%) rename test/tests/{escaped_angles.text => escaped_angles.md} (100%) rename test/tests/{gfm_break.breaks.text => gfm_break.breaks.md} (100%) rename test/tests/{gfm_code.text => gfm_code.md} (100%) rename test/tests/{gfm_code_hr_list.text => gfm_code_hr_list.md} (100%) rename test/tests/{gfm_del.text => gfm_del.md} (100%) rename test/tests/{gfm_em.text => gfm_em.md} (100%) rename test/tests/{gfm_hashtag.gfm.text => gfm_hashtag.gfm.md} (100%) rename test/tests/{gfm_hashtag.nogfm.text => gfm_hashtag.nogfm.md} (100%) rename test/tests/{gfm_links.text => gfm_links.md} (100%) rename test/tests/{gfm_tables.text => gfm_tables.md} (100%) rename test/tests/{hard_wrapped_paragraphs_with_list_like_lines.nogfm.text => hard_wrapped_paragraphs_with_list_like_lines.nogfm.md} (100%) rename test/tests/{horizontal_rules.text => horizontal_rules.md} (100%) rename test/tests/{hr_list_break.text => hr_list_break.md} (100%) rename test/tests/{inline_html_advanced.text => inline_html_advanced.md} (100%) rename test/tests/{inline_html_comments.text => inline_html_comments.md} (100%) rename test/tests/{inline_html_simple.text => inline_html_simple.md} (100%) rename test/tests/{lazy_blockquotes.text => lazy_blockquotes.md} (100%) rename test/tests/{links.sanitize.text => links.sanitize.md} (100%) rename test/tests/{links_inline_style.text => links_inline_style.md} (100%) rename test/tests/{links_reference_style.text => links_reference_style.md} (100%) rename test/tests/{links_shortcut_references.text => links_shortcut_references.md} (100%) rename test/tests/{list_item_text.text => list_item_text.md} (100%) rename test/tests/{literal_quotes_in_titles.text => literal_quotes_in_titles.md} (100%) rename test/tests/{loose_lists.text => loose_lists.md} (100%) rename test/tests/{main.text => main.md} (100%) rename test/tests/{mangle_xss.sanatize.nomangle.text => mangle_xss.sanatize.nomangle.md} (100%) rename test/tests/{markdown_documentation_basics.text => markdown_documentation_basics.md} (100%) rename test/tests/{markdown_documentation_syntax.text => markdown_documentation_syntax.md} (100%) rename test/tests/{nested_blockquotes.text => nested_blockquotes.md} (100%) rename test/tests/{nested_code.text => nested_code.md} (100%) rename test/tests/{nested_em.text => nested_em.md} (100%) rename test/tests/{nested_square_link.text => nested_square_link.md} (100%) rename test/tests/{not_a_link.text => not_a_link.md} (100%) rename test/tests/{ordered_and_unordered_lists.text => ordered_and_unordered_lists.md} (100%) rename test/tests/{ref_paren.text => ref_paren.md} (100%) rename test/tests/{relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text => relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md} (100%) rename test/tests/{same_bullet.text => same_bullet.md} (100%) rename test/tests/{strong_and_em_together.text => strong_and_em_together.md} (100%) rename test/tests/{tabs.text => tabs.md} (100%) rename test/tests/{text.smartypants.text => text.smartypants.md} (100%) rename test/tests/{tidyness.text => tidyness.md} (100%) rename test/tests/{toplevel_paragraphs.gfm.text => toplevel_paragraphs.gfm.md} (100%) rename test/tests/{tricky_list.text => tricky_list.md} (100%) rename test/tests/{uppercase_hex.sanitize.text => uppercase_hex.sanitize.md} (100%) diff --git a/test/index.js b/test/index.js index 415e8d6c91..c6f869dbfa 100644 --- a/test/index.js +++ b/test/index.js @@ -160,10 +160,10 @@ main: console.log('%d/%d tests completed successfully.', complete, len); if (failed) console.log('%d/%d tests failed.', failed, len); - // Tests currently failing. - if (~failures.indexOf('def_blocks.text')) { - failed -= 1; - } + // // Tests currently failing. + // if (~failures.indexOf('def_blocks.text')) { + // failed -= 1; + // } return !failed; } @@ -182,15 +182,15 @@ function bench(name, func) { // comparison to older benchmark times. fs.readdirSync(__dirname + '/new').forEach(function(name) { if (path.extname(name) === '.html') return; - if (name === 'main.text') return; + if (name === 'main.md') return; delete files[name]; }); - files['backslash_escapes.text'] = { + files['backslash_escapes.md'] = { text: 'hello world \\[how](are you) today' }; - files['main.text'].text = files['main.text'].text.replace('* * *\n\n', ''); + files['main.md'].text = files['main.md'].text.replace('* * *\n\n', ''); } var start = Date.now() @@ -342,7 +342,7 @@ function fix(options) { fs.readdirSync(path.resolve(__dirname, 'original')).forEach(function(file) { var nfile = file; if (file.indexOf('hard_wrapped_paragraphs_with_list_like_lines.') === 0) { - nfile = file.replace(/\.(text|html)$/, '.nogfm.$1'); + nfile = file.replace(/([^.]+)$/, 'nogfm.$1'); } fs.writeFileSync(path.resolve(__dirname, 'tests', nfile), fs.readFileSync(path.resolve(__dirname, 'original', file))); diff --git a/test/new/autolink_lines.text b/test/new/autolink_lines.md similarity index 100% rename from test/new/autolink_lines.text rename to test/new/autolink_lines.md diff --git a/test/new/blockquote_list_item.text b/test/new/blockquote_list_item.md similarity index 100% rename from test/new/blockquote_list_item.text rename to test/new/blockquote_list_item.md diff --git a/test/new/case_insensitive_refs.text b/test/new/case_insensitive_refs.md similarity index 100% rename from test/new/case_insensitive_refs.text rename to test/new/case_insensitive_refs.md diff --git a/test/new/def_blocks.text b/test/new/def_blocks.md similarity index 100% rename from test/new/def_blocks.text rename to test/new/def_blocks.md diff --git a/test/new/double_link.text b/test/new/double_link.md similarity index 100% rename from test/new/double_link.text rename to test/new/double_link.md diff --git a/test/new/escaped_angles.text b/test/new/escaped_angles.md similarity index 100% rename from test/new/escaped_angles.text rename to test/new/escaped_angles.md diff --git a/test/new/gfm_break.breaks.text b/test/new/gfm_break.breaks.md similarity index 100% rename from test/new/gfm_break.breaks.text rename to test/new/gfm_break.breaks.md diff --git a/test/new/gfm_code.text b/test/new/gfm_code.md similarity index 100% rename from test/new/gfm_code.text rename to test/new/gfm_code.md diff --git a/test/new/gfm_code_hr_list.text b/test/new/gfm_code_hr_list.md similarity index 100% rename from test/new/gfm_code_hr_list.text rename to test/new/gfm_code_hr_list.md diff --git a/test/new/gfm_del.text b/test/new/gfm_del.md similarity index 100% rename from test/new/gfm_del.text rename to test/new/gfm_del.md diff --git a/test/new/gfm_em.text b/test/new/gfm_em.md similarity index 100% rename from test/new/gfm_em.text rename to test/new/gfm_em.md diff --git a/test/new/gfm_hashtag.gfm.text b/test/new/gfm_hashtag.gfm.md similarity index 100% rename from test/new/gfm_hashtag.gfm.text rename to test/new/gfm_hashtag.gfm.md diff --git a/test/new/gfm_hashtag.nogfm.text b/test/new/gfm_hashtag.nogfm.md similarity index 100% rename from test/new/gfm_hashtag.nogfm.text rename to test/new/gfm_hashtag.nogfm.md diff --git a/test/new/gfm_links.text b/test/new/gfm_links.md similarity index 100% rename from test/new/gfm_links.text rename to test/new/gfm_links.md diff --git a/test/new/gfm_tables.text b/test/new/gfm_tables.md similarity index 100% rename from test/new/gfm_tables.text rename to test/new/gfm_tables.md diff --git a/test/new/hr_list_break.text b/test/new/hr_list_break.md similarity index 100% rename from test/new/hr_list_break.text rename to test/new/hr_list_break.md diff --git a/test/new/lazy_blockquotes.text b/test/new/lazy_blockquotes.md similarity index 100% rename from test/new/lazy_blockquotes.text rename to test/new/lazy_blockquotes.md diff --git a/test/new/links.sanitize.text b/test/new/links.sanitize.md similarity index 100% rename from test/new/links.sanitize.text rename to test/new/links.sanitize.md diff --git a/test/new/links_reference_style.text b/test/new/links_reference_style.md similarity index 100% rename from test/new/links_reference_style.text rename to test/new/links_reference_style.md diff --git a/test/new/list_item_text.text b/test/new/list_item_text.md similarity index 100% rename from test/new/list_item_text.text rename to test/new/list_item_text.md diff --git a/test/new/loose_lists.text b/test/new/loose_lists.md similarity index 100% rename from test/new/loose_lists.text rename to test/new/loose_lists.md diff --git a/test/new/main.text b/test/new/main.md similarity index 100% rename from test/new/main.text rename to test/new/main.md diff --git a/test/new/mangle_xss.sanatize.nomangle.text b/test/new/mangle_xss.sanatize.nomangle.md similarity index 100% rename from test/new/mangle_xss.sanatize.nomangle.text rename to test/new/mangle_xss.sanatize.nomangle.md diff --git a/test/new/nested_code.text b/test/new/nested_code.md similarity index 100% rename from test/new/nested_code.text rename to test/new/nested_code.md diff --git a/test/new/nested_em.text b/test/new/nested_em.md similarity index 100% rename from test/new/nested_em.text rename to test/new/nested_em.md diff --git a/test/new/nested_square_link.text b/test/new/nested_square_link.md similarity index 100% rename from test/new/nested_square_link.text rename to test/new/nested_square_link.md diff --git a/test/new/not_a_link.text b/test/new/not_a_link.md similarity index 100% rename from test/new/not_a_link.text rename to test/new/not_a_link.md diff --git a/test/new/ref_paren.text b/test/new/ref_paren.md similarity index 100% rename from test/new/ref_paren.text rename to test/new/ref_paren.md diff --git a/test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text b/test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md similarity index 100% rename from test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text rename to test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md diff --git a/test/new/same_bullet.text b/test/new/same_bullet.md similarity index 100% rename from test/new/same_bullet.text rename to test/new/same_bullet.md diff --git a/test/new/text.smartypants.text b/test/new/text.smartypants.md similarity index 100% rename from test/new/text.smartypants.text rename to test/new/text.smartypants.md diff --git a/test/new/toplevel_paragraphs.gfm.text b/test/new/toplevel_paragraphs.gfm.md similarity index 100% rename from test/new/toplevel_paragraphs.gfm.text rename to test/new/toplevel_paragraphs.gfm.md diff --git a/test/new/tricky_list.text b/test/new/tricky_list.md similarity index 100% rename from test/new/tricky_list.text rename to test/new/tricky_list.md diff --git a/test/new/uppercase_hex.sanitize.text b/test/new/uppercase_hex.sanitize.md similarity index 100% rename from test/new/uppercase_hex.sanitize.text rename to test/new/uppercase_hex.sanitize.md diff --git a/test/original/amps_and_angles_encoding.text b/test/original/amps_and_angles_encoding.md similarity index 100% rename from test/original/amps_and_angles_encoding.text rename to test/original/amps_and_angles_encoding.md diff --git a/test/original/auto_links.text b/test/original/auto_links.md similarity index 100% rename from test/original/auto_links.text rename to test/original/auto_links.md diff --git a/test/original/backslash_escapes.text b/test/original/backslash_escapes.md similarity index 100% rename from test/original/backslash_escapes.text rename to test/original/backslash_escapes.md diff --git a/test/original/blockquotes_with_code_blocks.text b/test/original/blockquotes_with_code_blocks.md similarity index 100% rename from test/original/blockquotes_with_code_blocks.text rename to test/original/blockquotes_with_code_blocks.md diff --git a/test/original/code_blocks.text b/test/original/code_blocks.md similarity index 100% rename from test/original/code_blocks.text rename to test/original/code_blocks.md diff --git a/test/original/code_spans.text b/test/original/code_spans.md similarity index 100% rename from test/original/code_spans.text rename to test/original/code_spans.md diff --git a/test/original/hard_wrapped_paragraphs_with_list_like_lines.text b/test/original/hard_wrapped_paragraphs_with_list_like_lines.md similarity index 100% rename from test/original/hard_wrapped_paragraphs_with_list_like_lines.text rename to test/original/hard_wrapped_paragraphs_with_list_like_lines.md diff --git a/test/original/horizontal_rules.text b/test/original/horizontal_rules.md similarity index 100% rename from test/original/horizontal_rules.text rename to test/original/horizontal_rules.md diff --git a/test/original/inline_html_advanced.text b/test/original/inline_html_advanced.md similarity index 100% rename from test/original/inline_html_advanced.text rename to test/original/inline_html_advanced.md diff --git a/test/original/inline_html_comments.text b/test/original/inline_html_comments.md similarity index 100% rename from test/original/inline_html_comments.text rename to test/original/inline_html_comments.md diff --git a/test/original/inline_html_simple.text b/test/original/inline_html_simple.md similarity index 100% rename from test/original/inline_html_simple.text rename to test/original/inline_html_simple.md diff --git a/test/original/links_inline_style.text b/test/original/links_inline_style.md similarity index 100% rename from test/original/links_inline_style.text rename to test/original/links_inline_style.md diff --git a/test/original/links_reference_style.text b/test/original/links_reference_style.md similarity index 100% rename from test/original/links_reference_style.text rename to test/original/links_reference_style.md diff --git a/test/original/links_shortcut_references.text b/test/original/links_shortcut_references.md similarity index 100% rename from test/original/links_shortcut_references.text rename to test/original/links_shortcut_references.md diff --git a/test/original/literal_quotes_in_titles.text b/test/original/literal_quotes_in_titles.md similarity index 100% rename from test/original/literal_quotes_in_titles.text rename to test/original/literal_quotes_in_titles.md diff --git a/test/original/markdown_documentation_basics.text b/test/original/markdown_documentation_basics.md similarity index 100% rename from test/original/markdown_documentation_basics.text rename to test/original/markdown_documentation_basics.md diff --git a/test/original/markdown_documentation_syntax.text b/test/original/markdown_documentation_syntax.md similarity index 100% rename from test/original/markdown_documentation_syntax.text rename to test/original/markdown_documentation_syntax.md diff --git a/test/original/nested_blockquotes.text b/test/original/nested_blockquotes.md similarity index 100% rename from test/original/nested_blockquotes.text rename to test/original/nested_blockquotes.md diff --git a/test/original/ordered_and_unordered_lists.text b/test/original/ordered_and_unordered_lists.md similarity index 100% rename from test/original/ordered_and_unordered_lists.text rename to test/original/ordered_and_unordered_lists.md diff --git a/test/original/strong_and_em_together.text b/test/original/strong_and_em_together.md similarity index 100% rename from test/original/strong_and_em_together.text rename to test/original/strong_and_em_together.md diff --git a/test/original/tabs.text b/test/original/tabs.md similarity index 100% rename from test/original/tabs.text rename to test/original/tabs.md diff --git a/test/original/tidyness.text b/test/original/tidyness.md similarity index 100% rename from test/original/tidyness.text rename to test/original/tidyness.md diff --git a/test/tests/amps_and_angles_encoding.text b/test/tests/amps_and_angles_encoding.md similarity index 100% rename from test/tests/amps_and_angles_encoding.text rename to test/tests/amps_and_angles_encoding.md diff --git a/test/tests/auto_links.text b/test/tests/auto_links.md similarity index 100% rename from test/tests/auto_links.text rename to test/tests/auto_links.md diff --git a/test/tests/autolink_lines.text b/test/tests/autolink_lines.md similarity index 100% rename from test/tests/autolink_lines.text rename to test/tests/autolink_lines.md diff --git a/test/tests/backslash_escapes.text b/test/tests/backslash_escapes.md similarity index 100% rename from test/tests/backslash_escapes.text rename to test/tests/backslash_escapes.md diff --git a/test/tests/blockquote_list_item.text b/test/tests/blockquote_list_item.md similarity index 100% rename from test/tests/blockquote_list_item.text rename to test/tests/blockquote_list_item.md diff --git a/test/tests/blockquotes_with_code_blocks.text b/test/tests/blockquotes_with_code_blocks.md similarity index 100% rename from test/tests/blockquotes_with_code_blocks.text rename to test/tests/blockquotes_with_code_blocks.md diff --git a/test/tests/case_insensitive_refs.text b/test/tests/case_insensitive_refs.md similarity index 100% rename from test/tests/case_insensitive_refs.text rename to test/tests/case_insensitive_refs.md diff --git a/test/tests/code_blocks.text b/test/tests/code_blocks.md similarity index 100% rename from test/tests/code_blocks.text rename to test/tests/code_blocks.md diff --git a/test/tests/code_spans.text b/test/tests/code_spans.md similarity index 100% rename from test/tests/code_spans.text rename to test/tests/code_spans.md diff --git a/test/tests/def_blocks.text b/test/tests/def_blocks.md similarity index 100% rename from test/tests/def_blocks.text rename to test/tests/def_blocks.md diff --git a/test/tests/double_link.text b/test/tests/double_link.md similarity index 100% rename from test/tests/double_link.text rename to test/tests/double_link.md diff --git a/test/tests/escaped_angles.text b/test/tests/escaped_angles.md similarity index 100% rename from test/tests/escaped_angles.text rename to test/tests/escaped_angles.md diff --git a/test/tests/gfm_break.breaks.text b/test/tests/gfm_break.breaks.md similarity index 100% rename from test/tests/gfm_break.breaks.text rename to test/tests/gfm_break.breaks.md diff --git a/test/tests/gfm_code.text b/test/tests/gfm_code.md similarity index 100% rename from test/tests/gfm_code.text rename to test/tests/gfm_code.md diff --git a/test/tests/gfm_code_hr_list.text b/test/tests/gfm_code_hr_list.md similarity index 100% rename from test/tests/gfm_code_hr_list.text rename to test/tests/gfm_code_hr_list.md diff --git a/test/tests/gfm_del.text b/test/tests/gfm_del.md similarity index 100% rename from test/tests/gfm_del.text rename to test/tests/gfm_del.md diff --git a/test/tests/gfm_em.text b/test/tests/gfm_em.md similarity index 100% rename from test/tests/gfm_em.text rename to test/tests/gfm_em.md diff --git a/test/tests/gfm_hashtag.gfm.text b/test/tests/gfm_hashtag.gfm.md similarity index 100% rename from test/tests/gfm_hashtag.gfm.text rename to test/tests/gfm_hashtag.gfm.md diff --git a/test/tests/gfm_hashtag.nogfm.text b/test/tests/gfm_hashtag.nogfm.md similarity index 100% rename from test/tests/gfm_hashtag.nogfm.text rename to test/tests/gfm_hashtag.nogfm.md diff --git a/test/tests/gfm_links.text b/test/tests/gfm_links.md similarity index 100% rename from test/tests/gfm_links.text rename to test/tests/gfm_links.md diff --git a/test/tests/gfm_tables.text b/test/tests/gfm_tables.md similarity index 100% rename from test/tests/gfm_tables.text rename to test/tests/gfm_tables.md diff --git a/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.text b/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.md similarity index 100% rename from test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.text rename to test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.md diff --git a/test/tests/horizontal_rules.text b/test/tests/horizontal_rules.md similarity index 100% rename from test/tests/horizontal_rules.text rename to test/tests/horizontal_rules.md diff --git a/test/tests/hr_list_break.text b/test/tests/hr_list_break.md similarity index 100% rename from test/tests/hr_list_break.text rename to test/tests/hr_list_break.md diff --git a/test/tests/inline_html_advanced.text b/test/tests/inline_html_advanced.md similarity index 100% rename from test/tests/inline_html_advanced.text rename to test/tests/inline_html_advanced.md diff --git a/test/tests/inline_html_comments.text b/test/tests/inline_html_comments.md similarity index 100% rename from test/tests/inline_html_comments.text rename to test/tests/inline_html_comments.md diff --git a/test/tests/inline_html_simple.text b/test/tests/inline_html_simple.md similarity index 100% rename from test/tests/inline_html_simple.text rename to test/tests/inline_html_simple.md diff --git a/test/tests/lazy_blockquotes.text b/test/tests/lazy_blockquotes.md similarity index 100% rename from test/tests/lazy_blockquotes.text rename to test/tests/lazy_blockquotes.md diff --git a/test/tests/links.sanitize.text b/test/tests/links.sanitize.md similarity index 100% rename from test/tests/links.sanitize.text rename to test/tests/links.sanitize.md diff --git a/test/tests/links_inline_style.text b/test/tests/links_inline_style.md similarity index 100% rename from test/tests/links_inline_style.text rename to test/tests/links_inline_style.md diff --git a/test/tests/links_reference_style.text b/test/tests/links_reference_style.md similarity index 100% rename from test/tests/links_reference_style.text rename to test/tests/links_reference_style.md diff --git a/test/tests/links_shortcut_references.text b/test/tests/links_shortcut_references.md similarity index 100% rename from test/tests/links_shortcut_references.text rename to test/tests/links_shortcut_references.md diff --git a/test/tests/list_item_text.text b/test/tests/list_item_text.md similarity index 100% rename from test/tests/list_item_text.text rename to test/tests/list_item_text.md diff --git a/test/tests/literal_quotes_in_titles.text b/test/tests/literal_quotes_in_titles.md similarity index 100% rename from test/tests/literal_quotes_in_titles.text rename to test/tests/literal_quotes_in_titles.md diff --git a/test/tests/loose_lists.text b/test/tests/loose_lists.md similarity index 100% rename from test/tests/loose_lists.text rename to test/tests/loose_lists.md diff --git a/test/tests/main.text b/test/tests/main.md similarity index 100% rename from test/tests/main.text rename to test/tests/main.md diff --git a/test/tests/mangle_xss.sanatize.nomangle.text b/test/tests/mangle_xss.sanatize.nomangle.md similarity index 100% rename from test/tests/mangle_xss.sanatize.nomangle.text rename to test/tests/mangle_xss.sanatize.nomangle.md diff --git a/test/tests/markdown_documentation_basics.text b/test/tests/markdown_documentation_basics.md similarity index 100% rename from test/tests/markdown_documentation_basics.text rename to test/tests/markdown_documentation_basics.md diff --git a/test/tests/markdown_documentation_syntax.text b/test/tests/markdown_documentation_syntax.md similarity index 100% rename from test/tests/markdown_documentation_syntax.text rename to test/tests/markdown_documentation_syntax.md diff --git a/test/tests/nested_blockquotes.text b/test/tests/nested_blockquotes.md similarity index 100% rename from test/tests/nested_blockquotes.text rename to test/tests/nested_blockquotes.md diff --git a/test/tests/nested_code.text b/test/tests/nested_code.md similarity index 100% rename from test/tests/nested_code.text rename to test/tests/nested_code.md diff --git a/test/tests/nested_em.text b/test/tests/nested_em.md similarity index 100% rename from test/tests/nested_em.text rename to test/tests/nested_em.md diff --git a/test/tests/nested_square_link.text b/test/tests/nested_square_link.md similarity index 100% rename from test/tests/nested_square_link.text rename to test/tests/nested_square_link.md diff --git a/test/tests/not_a_link.text b/test/tests/not_a_link.md similarity index 100% rename from test/tests/not_a_link.text rename to test/tests/not_a_link.md diff --git a/test/tests/ordered_and_unordered_lists.text b/test/tests/ordered_and_unordered_lists.md similarity index 100% rename from test/tests/ordered_and_unordered_lists.text rename to test/tests/ordered_and_unordered_lists.md diff --git a/test/tests/ref_paren.text b/test/tests/ref_paren.md similarity index 100% rename from test/tests/ref_paren.text rename to test/tests/ref_paren.md diff --git a/test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text b/test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md similarity index 100% rename from test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.text rename to test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md diff --git a/test/tests/same_bullet.text b/test/tests/same_bullet.md similarity index 100% rename from test/tests/same_bullet.text rename to test/tests/same_bullet.md diff --git a/test/tests/strong_and_em_together.text b/test/tests/strong_and_em_together.md similarity index 100% rename from test/tests/strong_and_em_together.text rename to test/tests/strong_and_em_together.md diff --git a/test/tests/tabs.text b/test/tests/tabs.md similarity index 100% rename from test/tests/tabs.text rename to test/tests/tabs.md diff --git a/test/tests/text.smartypants.text b/test/tests/text.smartypants.md similarity index 100% rename from test/tests/text.smartypants.text rename to test/tests/text.smartypants.md diff --git a/test/tests/tidyness.text b/test/tests/tidyness.md similarity index 100% rename from test/tests/tidyness.text rename to test/tests/tidyness.md diff --git a/test/tests/toplevel_paragraphs.gfm.text b/test/tests/toplevel_paragraphs.gfm.md similarity index 100% rename from test/tests/toplevel_paragraphs.gfm.text rename to test/tests/toplevel_paragraphs.gfm.md diff --git a/test/tests/tricky_list.text b/test/tests/tricky_list.md similarity index 100% rename from test/tests/tricky_list.text rename to test/tests/tricky_list.md diff --git a/test/tests/uppercase_hex.sanitize.text b/test/tests/uppercase_hex.sanitize.md similarity index 100% rename from test/tests/uppercase_hex.sanitize.text rename to test/tests/uppercase_hex.sanitize.md From 5d2e796ca2048cd4f36d10d445be9416d95ab240 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 2 Jan 2018 12:07:55 -0600 Subject: [PATCH 042/308] remove invalid failing test check --- test/index.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/index.js b/test/index.js index c6f869dbfa..3a350398f5 100644 --- a/test/index.js +++ b/test/index.js @@ -160,11 +160,6 @@ main: console.log('%d/%d tests completed successfully.', complete, len); if (failed) console.log('%d/%d tests failed.', failed, len); - // // Tests currently failing. - // if (~failures.indexOf('def_blocks.text')) { - // failed -= 1; - // } - return !failed; } From 368952d1016bc403c487a8ac09ec98c3a5c9a7bb Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 2 Jan 2018 13:50:46 -0600 Subject: [PATCH 043/308] add /test/tests to .gitignore --- .gitignore | 1 + test/tests/amps_and_angles_encoding.html | 17 - test/tests/amps_and_angles_encoding.md | 21 - test/tests/auto_links.html | 18 - test/tests/auto_links.md | 13 - test/tests/autolink_lines.html | 3 - test/tests/autolink_lines.md | 2 - test/tests/backslash_escapes.html | 118 --- test/tests/backslash_escapes.md | 120 --- test/tests/blockquote_list_item.html | 3 - test/tests/blockquote_list_item.md | 4 - test/tests/blockquotes_with_code_blocks.html | 15 - test/tests/blockquotes_with_code_blocks.md | 11 - test/tests/case_insensitive_refs.html | 1 - test/tests/case_insensitive_refs.md | 3 - test/tests/code_blocks.html | 18 - test/tests/code_blocks.md | 14 - test/tests/code_spans.html | 6 - test/tests/code_spans.md | 6 - test/tests/def_blocks.html | 30 - test/tests/def_blocks.md | 21 - test/tests/double_link.html | 5 - test/tests/double_link.md | 5 - test/tests/escaped_angles.html | 1 - test/tests/escaped_angles.md | 1 - test/tests/gfm_break.breaks.html | 1 - test/tests/gfm_break.breaks.md | 3 - test/tests/gfm_code.html | 10 - test/tests/gfm_code.md | 27 - test/tests/gfm_code_hr_list.html | 52 - test/tests/gfm_code_hr_list.md | 53 - test/tests/gfm_del.html | 1 - test/tests/gfm_del.md | 1 - test/tests/gfm_em.html | 1 - test/tests/gfm_em.md | 1 - test/tests/gfm_hashtag.gfm.html | 5 - test/tests/gfm_hashtag.gfm.md | 5 - test/tests/gfm_hashtag.nogfm.html | 5 - test/tests/gfm_hashtag.nogfm.md | 5 - test/tests/gfm_links.html | 2 - test/tests/gfm_links.md | 1 - test/tests/gfm_tables.html | 37 - test/tests/gfm_tables.md | 21 - ...paragraphs_with_list_like_lines.nogfm.html | 8 - ...d_paragraphs_with_list_like_lines.nogfm.md | 8 - test/tests/horizontal_rules.html | 71 -- test/tests/horizontal_rules.md | 67 -- test/tests/hr_list_break.html | 10 - test/tests/hr_list_break.md | 6 - test/tests/inline_html_advanced.html | 15 - test/tests/inline_html_advanced.md | 15 - test/tests/inline_html_comments.html | 13 - test/tests/inline_html_comments.md | 13 - test/tests/inline_html_simple.html | 72 -- test/tests/inline_html_simple.md | 69 -- test/tests/lazy_blockquotes.html | 4 - test/tests/lazy_blockquotes.md | 2 - test/tests/links.sanitize.html | 5 - test/tests/links.sanitize.md | 9 - test/tests/links_inline_style.html | 15 - test/tests/links_inline_style.md | 15 - test/tests/links_reference_style.html | 62 -- test/tests/links_reference_style.md | 81 -- test/tests/links_shortcut_references.html | 9 - test/tests/links_shortcut_references.md | 20 - test/tests/list_item_text.html | 1 - test/tests/list_item_text.md | 5 - test/tests/literal_quotes_in_titles.html | 3 - test/tests/literal_quotes_in_titles.md | 7 - test/tests/loose_lists.html | 62 -- test/tests/loose_lists.md | 59 -- test/tests/main.html | 4 - test/tests/main.md | 55 - test/tests/mangle_xss.sanatize.nomangle.html | 3 - test/tests/mangle_xss.sanatize.nomangle.md | 3 - test/tests/markdown_documentation_basics.html | 314 ------ test/tests/markdown_documentation_basics.md | 306 ------ test/tests/markdown_documentation_syntax.html | 942 ------------------ test/tests/markdown_documentation_syntax.md | 888 ----------------- test/tests/nested_blockquotes.html | 9 - test/tests/nested_blockquotes.md | 5 - test/tests/nested_code.html | 1 - test/tests/nested_code.md | 1 - test/tests/nested_em.html | 3 - test/tests/nested_em.md | 3 - test/tests/nested_square_link.html | 1 - test/tests/nested_square_link.md | 1 - test/tests/not_a_link.html | 1 - test/tests/not_a_link.md | 1 - test/tests/ordered_and_unordered_lists.html | 148 --- test/tests/ordered_and_unordered_lists.md | 131 --- test/tests/ref_paren.html | 1 - test/tests/ref_paren.md | 3 - ...=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html | 35 - ...rl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md | 27 - test/tests/same_bullet.html | 5 - test/tests/same_bullet.md | 3 - test/tests/strong_and_em_together.html | 7 - test/tests/strong_and_em_together.md | 7 - test/tests/tabs.html | 25 - test/tests/tabs.md | 21 - test/tests/text.smartypants.html | 6 - test/tests/text.smartypants.md | 6 - test/tests/tidyness.html | 8 - test/tests/tidyness.md | 5 - test/tests/toplevel_paragraphs.gfm.html | 34 - test/tests/toplevel_paragraphs.gfm.md | 38 - test/tests/tricky_list.html | 23 - test/tests/tricky_list.md | 15 - test/tests/uppercase_hex.sanitize.html | 2 - test/tests/uppercase_hex.sanitize.md | 2 - 111 files changed, 1 insertion(+), 4506 deletions(-) delete mode 100644 test/tests/amps_and_angles_encoding.html delete mode 100644 test/tests/amps_and_angles_encoding.md delete mode 100644 test/tests/auto_links.html delete mode 100644 test/tests/auto_links.md delete mode 100644 test/tests/autolink_lines.html delete mode 100644 test/tests/autolink_lines.md delete mode 100644 test/tests/backslash_escapes.html delete mode 100644 test/tests/backslash_escapes.md delete mode 100644 test/tests/blockquote_list_item.html delete mode 100644 test/tests/blockquote_list_item.md delete mode 100644 test/tests/blockquotes_with_code_blocks.html delete mode 100644 test/tests/blockquotes_with_code_blocks.md delete mode 100644 test/tests/case_insensitive_refs.html delete mode 100644 test/tests/case_insensitive_refs.md delete mode 100644 test/tests/code_blocks.html delete mode 100644 test/tests/code_blocks.md delete mode 100644 test/tests/code_spans.html delete mode 100644 test/tests/code_spans.md delete mode 100644 test/tests/def_blocks.html delete mode 100644 test/tests/def_blocks.md delete mode 100644 test/tests/double_link.html delete mode 100644 test/tests/double_link.md delete mode 100644 test/tests/escaped_angles.html delete mode 100644 test/tests/escaped_angles.md delete mode 100644 test/tests/gfm_break.breaks.html delete mode 100644 test/tests/gfm_break.breaks.md delete mode 100644 test/tests/gfm_code.html delete mode 100644 test/tests/gfm_code.md delete mode 100644 test/tests/gfm_code_hr_list.html delete mode 100644 test/tests/gfm_code_hr_list.md delete mode 100644 test/tests/gfm_del.html delete mode 100644 test/tests/gfm_del.md delete mode 100644 test/tests/gfm_em.html delete mode 100644 test/tests/gfm_em.md delete mode 100644 test/tests/gfm_hashtag.gfm.html delete mode 100644 test/tests/gfm_hashtag.gfm.md delete mode 100644 test/tests/gfm_hashtag.nogfm.html delete mode 100644 test/tests/gfm_hashtag.nogfm.md delete mode 100644 test/tests/gfm_links.html delete mode 100644 test/tests/gfm_links.md delete mode 100644 test/tests/gfm_tables.html delete mode 100644 test/tests/gfm_tables.md delete mode 100644 test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.html delete mode 100644 test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.md delete mode 100644 test/tests/horizontal_rules.html delete mode 100644 test/tests/horizontal_rules.md delete mode 100644 test/tests/hr_list_break.html delete mode 100644 test/tests/hr_list_break.md delete mode 100644 test/tests/inline_html_advanced.html delete mode 100644 test/tests/inline_html_advanced.md delete mode 100644 test/tests/inline_html_comments.html delete mode 100644 test/tests/inline_html_comments.md delete mode 100644 test/tests/inline_html_simple.html delete mode 100644 test/tests/inline_html_simple.md delete mode 100644 test/tests/lazy_blockquotes.html delete mode 100644 test/tests/lazy_blockquotes.md delete mode 100644 test/tests/links.sanitize.html delete mode 100644 test/tests/links.sanitize.md delete mode 100644 test/tests/links_inline_style.html delete mode 100644 test/tests/links_inline_style.md delete mode 100644 test/tests/links_reference_style.html delete mode 100644 test/tests/links_reference_style.md delete mode 100644 test/tests/links_shortcut_references.html delete mode 100644 test/tests/links_shortcut_references.md delete mode 100644 test/tests/list_item_text.html delete mode 100644 test/tests/list_item_text.md delete mode 100644 test/tests/literal_quotes_in_titles.html delete mode 100644 test/tests/literal_quotes_in_titles.md delete mode 100644 test/tests/loose_lists.html delete mode 100644 test/tests/loose_lists.md delete mode 100644 test/tests/main.html delete mode 100644 test/tests/main.md delete mode 100644 test/tests/mangle_xss.sanatize.nomangle.html delete mode 100644 test/tests/mangle_xss.sanatize.nomangle.md delete mode 100644 test/tests/markdown_documentation_basics.html delete mode 100644 test/tests/markdown_documentation_basics.md delete mode 100644 test/tests/markdown_documentation_syntax.html delete mode 100644 test/tests/markdown_documentation_syntax.md delete mode 100644 test/tests/nested_blockquotes.html delete mode 100644 test/tests/nested_blockquotes.md delete mode 100644 test/tests/nested_code.html delete mode 100644 test/tests/nested_code.md delete mode 100644 test/tests/nested_em.html delete mode 100644 test/tests/nested_em.md delete mode 100644 test/tests/nested_square_link.html delete mode 100644 test/tests/nested_square_link.md delete mode 100644 test/tests/not_a_link.html delete mode 100644 test/tests/not_a_link.md delete mode 100644 test/tests/ordered_and_unordered_lists.html delete mode 100644 test/tests/ordered_and_unordered_lists.md delete mode 100644 test/tests/ref_paren.html delete mode 100644 test/tests/ref_paren.md delete mode 100644 test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html delete mode 100644 test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md delete mode 100644 test/tests/same_bullet.html delete mode 100644 test/tests/same_bullet.md delete mode 100644 test/tests/strong_and_em_together.html delete mode 100644 test/tests/strong_and_em_together.md delete mode 100644 test/tests/tabs.html delete mode 100644 test/tests/tabs.md delete mode 100644 test/tests/text.smartypants.html delete mode 100644 test/tests/text.smartypants.md delete mode 100644 test/tests/tidyness.html delete mode 100644 test/tests/tidyness.md delete mode 100644 test/tests/toplevel_paragraphs.gfm.html delete mode 100644 test/tests/toplevel_paragraphs.gfm.md delete mode 100644 test/tests/tricky_list.html delete mode 100644 test/tests/tricky_list.md delete mode 100644 test/tests/uppercase_hex.sanitize.html delete mode 100644 test/tests/uppercase_hex.sanitize.md diff --git a/.gitignore b/.gitignore index c2658d7d1b..8f7082c4f5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules/ +test/tests diff --git a/test/tests/amps_and_angles_encoding.html b/test/tests/amps_and_angles_encoding.html deleted file mode 100644 index 93c1db5505..0000000000 --- a/test/tests/amps_and_angles_encoding.html +++ /dev/null @@ -1,17 +0,0 @@ -

    AT&T has an ampersand in their name.

    - -

    AT&T is another way to write it.

    - -

    This & that.

    - -

    4 < 5.

    - -

    6 > 5.

    - -

    Here's a link with an ampersand in the URL.

    - -

    Here's a link with an amersand in the link text: AT&T.

    - -

    Here's an inline link.

    - -

    Here's an inline link.

    diff --git a/test/tests/amps_and_angles_encoding.md b/test/tests/amps_and_angles_encoding.md deleted file mode 100644 index 89ec3ae1d1..0000000000 --- a/test/tests/amps_and_angles_encoding.md +++ /dev/null @@ -1,21 +0,0 @@ -AT&T has an ampersand in their name. - -AT&T is another way to write it. - -This & that. - -4 < 5. - -6 > 5. - -Here's a [link] [1] with an ampersand in the URL. - -Here's a link with an amersand in the link text: [AT&T] [2]. - -Here's an inline [link](/script?foo=1&bar=2). - -Here's an inline [link](). - - -[1]: http://example.com/?foo=1&bar=2 -[2]: http://att.com/ "AT&T" diff --git a/test/tests/auto_links.html b/test/tests/auto_links.html deleted file mode 100644 index f8df9852c7..0000000000 --- a/test/tests/auto_links.html +++ /dev/null @@ -1,18 +0,0 @@ -

    Link: http://example.com/.

    - -

    With an ampersand: http://example.com/?foo=1&bar=2

    - - - -
    -

    Blockquoted: http://example.com/

    -
    - -

    Auto-links should not occur here: <http://example.com/>

    - -
    or here: <http://example.com/>
    -
    diff --git a/test/tests/auto_links.md b/test/tests/auto_links.md deleted file mode 100644 index f85767b48a..0000000000 --- a/test/tests/auto_links.md +++ /dev/null @@ -1,13 +0,0 @@ -Link: . - -With an ampersand: - -* In a list? -* -* It should. - -> Blockquoted: - -Auto-links should not occur here: `` - - or here: diff --git a/test/tests/autolink_lines.html b/test/tests/autolink_lines.html deleted file mode 100644 index aa2bed4d32..0000000000 --- a/test/tests/autolink_lines.html +++ /dev/null @@ -1,3 +0,0 @@ -

    hello world -http://example.com -

    diff --git a/test/tests/autolink_lines.md b/test/tests/autolink_lines.md deleted file mode 100644 index c9b61a2ca3..0000000000 --- a/test/tests/autolink_lines.md +++ /dev/null @@ -1,2 +0,0 @@ -hello world - diff --git a/test/tests/backslash_escapes.html b/test/tests/backslash_escapes.html deleted file mode 100644 index c7f0e5ee2f..0000000000 --- a/test/tests/backslash_escapes.html +++ /dev/null @@ -1,118 +0,0 @@ -

    These should all get escaped:

    - -

    Backslash: \

    - -

    Backtick: `

    - -

    Asterisk: *

    - -

    Underscore: _

    - -

    Left brace: {

    - -

    Right brace: }

    - -

    Left bracket: [

    - -

    Right bracket: ]

    - -

    Left paren: (

    - -

    Right paren: )

    - -

    Greater-than: >

    - -

    Hash: #

    - -

    Period: .

    - -

    Bang: !

    - -

    Plus: +

    - -

    Minus: -

    - -

    These should not, because they occur within a code block:

    - -
    Backslash: \\
    -
    -Backtick: \`
    -
    -Asterisk: \*
    -
    -Underscore: \_
    -
    -Left brace: \{
    -
    -Right brace: \}
    -
    -Left bracket: \[
    -
    -Right bracket: \]
    -
    -Left paren: \(
    -
    -Right paren: \)
    -
    -Greater-than: \>
    -
    -Hash: \#
    -
    -Period: \.
    -
    -Bang: \!
    -
    -Plus: \+
    -
    -Minus: \-
    -
    - -

    Nor should these, which occur in code spans:

    - -

    Backslash: \\

    - -

    Backtick: \`

    - -

    Asterisk: \*

    - -

    Underscore: \_

    - -

    Left brace: \{

    - -

    Right brace: \}

    - -

    Left bracket: \[

    - -

    Right bracket: \]

    - -

    Left paren: \(

    - -

    Right paren: \)

    - -

    Greater-than: \>

    - -

    Hash: \#

    - -

    Period: \.

    - -

    Bang: \!

    - -

    Plus: \+

    - -

    Minus: \-

    - - -

    These should get escaped, even though they're matching pairs for -other Markdown constructs:

    - -

    *asterisks*

    - -

    _underscores_

    - -

    `backticks`

    - -

    This is a code span with a literal backslash-backtick sequence: \`

    - -

    This is a tag with unescaped backticks bar.

    - -

    This is a tag with backslashes bar.

    diff --git a/test/tests/backslash_escapes.md b/test/tests/backslash_escapes.md deleted file mode 100644 index 5b014cb33d..0000000000 --- a/test/tests/backslash_escapes.md +++ /dev/null @@ -1,120 +0,0 @@ -These should all get escaped: - -Backslash: \\ - -Backtick: \` - -Asterisk: \* - -Underscore: \_ - -Left brace: \{ - -Right brace: \} - -Left bracket: \[ - -Right bracket: \] - -Left paren: \( - -Right paren: \) - -Greater-than: \> - -Hash: \# - -Period: \. - -Bang: \! - -Plus: \+ - -Minus: \- - - - -These should not, because they occur within a code block: - - Backslash: \\ - - Backtick: \` - - Asterisk: \* - - Underscore: \_ - - Left brace: \{ - - Right brace: \} - - Left bracket: \[ - - Right bracket: \] - - Left paren: \( - - Right paren: \) - - Greater-than: \> - - Hash: \# - - Period: \. - - Bang: \! - - Plus: \+ - - Minus: \- - - -Nor should these, which occur in code spans: - -Backslash: `\\` - -Backtick: `` \` `` - -Asterisk: `\*` - -Underscore: `\_` - -Left brace: `\{` - -Right brace: `\}` - -Left bracket: `\[` - -Right bracket: `\]` - -Left paren: `\(` - -Right paren: `\)` - -Greater-than: `\>` - -Hash: `\#` - -Period: `\.` - -Bang: `\!` - -Plus: `\+` - -Minus: `\-` - - -These should get escaped, even though they're matching pairs for -other Markdown constructs: - -\*asterisks\* - -\_underscores\_ - -\`backticks\` - -This is a code span with a literal backslash-backtick sequence: `` \` `` - -This is a tag with unescaped backticks bar. - -This is a tag with backslashes bar. diff --git a/test/tests/blockquote_list_item.html b/test/tests/blockquote_list_item.html deleted file mode 100644 index 83cf0bddf0..0000000000 --- a/test/tests/blockquote_list_item.html +++ /dev/null @@ -1,3 +0,0 @@ -

    This fails in markdown.pl and upskirt:

    - -
    • hello

      world

    diff --git a/test/tests/blockquote_list_item.md b/test/tests/blockquote_list_item.md deleted file mode 100644 index 19e938294a..0000000000 --- a/test/tests/blockquote_list_item.md +++ /dev/null @@ -1,4 +0,0 @@ -This fails in markdown.pl and upskirt: - -* hello - > world diff --git a/test/tests/blockquotes_with_code_blocks.html b/test/tests/blockquotes_with_code_blocks.html deleted file mode 100644 index 38ee5f097d..0000000000 --- a/test/tests/blockquotes_with_code_blocks.html +++ /dev/null @@ -1,15 +0,0 @@ -
    -

    Example:

    - -
    sub status {
    -    print "working";
    -}
    -
    - -

    Or:

    - -
    sub status {
    -    return "working";
    -}
    -
    -
    diff --git a/test/tests/blockquotes_with_code_blocks.md b/test/tests/blockquotes_with_code_blocks.md deleted file mode 100644 index c31d171049..0000000000 --- a/test/tests/blockquotes_with_code_blocks.md +++ /dev/null @@ -1,11 +0,0 @@ -> Example: -> -> sub status { -> print "working"; -> } -> -> Or: -> -> sub status { -> return "working"; -> } diff --git a/test/tests/case_insensitive_refs.html b/test/tests/case_insensitive_refs.html deleted file mode 100644 index c54388ea5c..0000000000 --- a/test/tests/case_insensitive_refs.html +++ /dev/null @@ -1 +0,0 @@ -

    hi

    diff --git a/test/tests/case_insensitive_refs.md b/test/tests/case_insensitive_refs.md deleted file mode 100644 index 598915a8a8..0000000000 --- a/test/tests/case_insensitive_refs.md +++ /dev/null @@ -1,3 +0,0 @@ -[hi] - -[HI]: /url diff --git a/test/tests/code_blocks.html b/test/tests/code_blocks.html deleted file mode 100644 index 32703f5cb4..0000000000 --- a/test/tests/code_blocks.html +++ /dev/null @@ -1,18 +0,0 @@ -
    code block on the first line
    -
    - -

    Regular text.

    - -
    code block indented by spaces
    -
    - -

    Regular text.

    - -
    the lines in this block  
    -all contain trailing spaces  
    -
    - -

    Regular Text.

    - -
    code block on the last line
    -
    diff --git a/test/tests/code_blocks.md b/test/tests/code_blocks.md deleted file mode 100644 index 01f9a733b6..0000000000 --- a/test/tests/code_blocks.md +++ /dev/null @@ -1,14 +0,0 @@ - code block on the first line - -Regular text. - - code block indented by spaces - -Regular text. - - the lines in this block - all contain trailing spaces - -Regular Text. - - code block on the last line diff --git a/test/tests/code_spans.html b/test/tests/code_spans.html deleted file mode 100644 index 860e97c9f2..0000000000 --- a/test/tests/code_spans.html +++ /dev/null @@ -1,6 +0,0 @@ -

    <test a=" content of attribute ">

    - -

    Fix for backticks within HTML tag: like this

    - -

    Here's how you put `backticks` in a code span.

    - diff --git a/test/tests/code_spans.md b/test/tests/code_spans.md deleted file mode 100644 index 750a1973df..0000000000 --- a/test/tests/code_spans.md +++ /dev/null @@ -1,6 +0,0 @@ -`` - -Fix for backticks within HTML tag: like this - -Here's how you put `` `backticks` `` in a code span. - diff --git a/test/tests/def_blocks.html b/test/tests/def_blocks.html deleted file mode 100644 index ec0d11934d..0000000000 --- a/test/tests/def_blocks.html +++ /dev/null @@ -1,30 +0,0 @@ -
    -

    hello -[1]: hello

    -
    - -
    - -
    -

    hello -[2]: hello

    -
    - - -
      -
    • hello
    • -
    • [3]: hello
    • -
    - - -
      -
    • hello
    • -
    - - -
    -

    foo -bar -[1]: foo -bar

    -
    diff --git a/test/tests/def_blocks.md b/test/tests/def_blocks.md deleted file mode 100644 index 4d16292987..0000000000 --- a/test/tests/def_blocks.md +++ /dev/null @@ -1,21 +0,0 @@ -> hello -> [1]: hello - -* * * - -> hello -[2]: hello - - -* hello -* [3]: hello - - -* hello -[4]: hello - - -> foo -> bar -[1]: foo -> bar diff --git a/test/tests/double_link.html b/test/tests/double_link.html deleted file mode 100644 index ff68395a3a..0000000000 --- a/test/tests/double_link.html +++ /dev/null @@ -1,5 +0,0 @@ -

    Already linked: http://example.com/.

    - -

    Already linked: http://example.com/.

    - -

    Already linked: http://example.com/.

    diff --git a/test/tests/double_link.md b/test/tests/double_link.md deleted file mode 100644 index 50216736c1..0000000000 --- a/test/tests/double_link.md +++ /dev/null @@ -1,5 +0,0 @@ -

    Already linked: http://example.com/.

    - -Already linked: [http://example.com/](http://example.com/). - -Already linked: **http://example.com/**. diff --git a/test/tests/escaped_angles.html b/test/tests/escaped_angles.html deleted file mode 100644 index 7cf47c49ee..0000000000 --- a/test/tests/escaped_angles.html +++ /dev/null @@ -1 +0,0 @@ -

    >

    diff --git a/test/tests/escaped_angles.md b/test/tests/escaped_angles.md deleted file mode 100644 index db7422f13f..0000000000 --- a/test/tests/escaped_angles.md +++ /dev/null @@ -1 +0,0 @@ -\> diff --git a/test/tests/gfm_break.breaks.html b/test/tests/gfm_break.breaks.html deleted file mode 100644 index 398ba018ce..0000000000 --- a/test/tests/gfm_break.breaks.html +++ /dev/null @@ -1 +0,0 @@ -

    Look at the
    pretty line
    breaks.

    diff --git a/test/tests/gfm_break.breaks.md b/test/tests/gfm_break.breaks.md deleted file mode 100644 index 71097d23bc..0000000000 --- a/test/tests/gfm_break.breaks.md +++ /dev/null @@ -1,3 +0,0 @@ -Look at the -pretty line -breaks. diff --git a/test/tests/gfm_code.html b/test/tests/gfm_code.html deleted file mode 100644 index 872ece776a..0000000000 --- a/test/tests/gfm_code.html +++ /dev/null @@ -1,10 +0,0 @@ -
    var a = 'hello';
    -console.log(a + ' world');
    -
    echo "hello, ${WORLD}"
    -
    Q: What do you call a tall person who sells stolen goods?
    -
    A longfence!
    -

    How about an empty code block?

    -
    -

    How about a code block with only an empty line?

    -
    
    -
    diff --git a/test/tests/gfm_code.md b/test/tests/gfm_code.md deleted file mode 100644 index ca46c1fed1..0000000000 --- a/test/tests/gfm_code.md +++ /dev/null @@ -1,27 +0,0 @@ -``` js -var a = 'hello'; -console.log(a + ' world'); -``` - -~~~bash -echo "hello, ${WORLD}" -~~~ - -```````longfence -Q: What do you call a tall person who sells stolen goods? -``````` - -~~~~~~~~~~ ManyTildes -A longfence! -~~~~~~~~~~ - -How about an empty code block? - -```js -``` - -How about a code block with only an empty line? - -```js - -``` diff --git a/test/tests/gfm_code_hr_list.html b/test/tests/gfm_code_hr_list.html deleted file mode 100644 index 9fbd0fb9dd..0000000000 --- a/test/tests/gfm_code_hr_list.html +++ /dev/null @@ -1,52 +0,0 @@ -

    foo

    -
      -
    1. bar:

      -
      -
        -
      • one
          -
        • two
            -
          • three
          • -
          • four
          • -
          • five
          • -
          -
        • -
        -
      • -
      -
      -
    2. -
    3. foo:

      -
       line 1
      - line 2
      -
    4. -
    5. foo:

      -
        -
      1. foo bar bar:

        -
         some code here
        -
        -
      2. -
      3. foo bar bar:

        -
         foo
        - ---
        - bar
        - ---
        - foo
        - bar
        -
      4. -
      5. foo bar bar:

        -
         ---
        - foo
        - foo
        - ---
        - bar
        -
      6. -
      7. foo bar bar:

        -
         foo
        - ---
        - bar
        -
      8. -
      9. foo

        -
      10. -
      -
    6. -
    diff --git a/test/tests/gfm_code_hr_list.md b/test/tests/gfm_code_hr_list.md deleted file mode 100644 index 0eba40598f..0000000000 --- a/test/tests/gfm_code_hr_list.md +++ /dev/null @@ -1,53 +0,0 @@ -## foo - -1. bar: - - > - one - - two - - three - - four - - five - -1. foo: - - ``` - line 1 - line 2 - ``` - -1. foo: - - 1. foo `bar` bar: - - ``` erb - some code here - ``` - - 2. foo `bar` bar: - - ``` erb - foo - --- - bar - --- - foo - bar - ``` - - 3. foo `bar` bar: - - ``` html - --- - foo - foo - --- - bar - ``` - - 4. foo `bar` bar: - - foo - --- - bar - - 5. foo diff --git a/test/tests/gfm_del.html b/test/tests/gfm_del.html deleted file mode 100644 index 95e9ec74be..0000000000 --- a/test/tests/gfm_del.html +++ /dev/null @@ -1 +0,0 @@ -

    hello hi world

    diff --git a/test/tests/gfm_del.md b/test/tests/gfm_del.md deleted file mode 100644 index d29ca77d41..0000000000 --- a/test/tests/gfm_del.md +++ /dev/null @@ -1 +0,0 @@ -hello ~~hi~~ world diff --git a/test/tests/gfm_em.html b/test/tests/gfm_em.html deleted file mode 100644 index 8fac3466aa..0000000000 --- a/test/tests/gfm_em.html +++ /dev/null @@ -1 +0,0 @@ -

    These words should_not_be_emphasized.

    diff --git a/test/tests/gfm_em.md b/test/tests/gfm_em.md deleted file mode 100644 index 6319874b90..0000000000 --- a/test/tests/gfm_em.md +++ /dev/null @@ -1 +0,0 @@ -These words should_not_be_emphasized. diff --git a/test/tests/gfm_hashtag.gfm.html b/test/tests/gfm_hashtag.gfm.html deleted file mode 100644 index 6f9e43f52d..0000000000 --- a/test/tests/gfm_hashtag.gfm.html +++ /dev/null @@ -1,5 +0,0 @@ -

    #header

    - -

    header1

    - -

    header2

    diff --git a/test/tests/gfm_hashtag.gfm.md b/test/tests/gfm_hashtag.gfm.md deleted file mode 100644 index 7656ecfd7c..0000000000 --- a/test/tests/gfm_hashtag.gfm.md +++ /dev/null @@ -1,5 +0,0 @@ -#header - -# header1 - -# header2 diff --git a/test/tests/gfm_hashtag.nogfm.html b/test/tests/gfm_hashtag.nogfm.html deleted file mode 100644 index ecd95d692e..0000000000 --- a/test/tests/gfm_hashtag.nogfm.html +++ /dev/null @@ -1,5 +0,0 @@ -

    header

    - -

    header1

    - -

    header2

    diff --git a/test/tests/gfm_hashtag.nogfm.md b/test/tests/gfm_hashtag.nogfm.md deleted file mode 100644 index 7656ecfd7c..0000000000 --- a/test/tests/gfm_hashtag.nogfm.md +++ /dev/null @@ -1,5 +0,0 @@ -#header - -# header1 - -# header2 diff --git a/test/tests/gfm_links.html b/test/tests/gfm_links.html deleted file mode 100644 index 4f62ae1de6..0000000000 --- a/test/tests/gfm_links.html +++ /dev/null @@ -1,2 +0,0 @@ -

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

    diff --git a/test/tests/gfm_links.md b/test/tests/gfm_links.md deleted file mode 100644 index c1336661a9..0000000000 --- a/test/tests/gfm_links.md +++ /dev/null @@ -1 +0,0 @@ -This should be a link: http://example.com/hello-world. diff --git a/test/tests/gfm_tables.html b/test/tests/gfm_tables.html deleted file mode 100644 index 70bec827e3..0000000000 --- a/test/tests/gfm_tables.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - -
    Heading 1Heading 2
    Cell 1Cell 2
    Cell 3Cell 4
    - - - - - - - - -
    Header 1Header 2Header 3Header 4
    Cell 1Cell 2Cell 3Cell 4
    Cell 5Cell 6Cell 7Cell 8
    -
    Test code
    - - - - - - - - -
    Header 1Header 2
    Cell 1Cell 2
    Cell 3Cell 4
    - - - - - - - - -
    Header 1Header 2Header 3Header 4
    Cell 1Cell 2Cell 3Cell 4
    Cell 5Cell 6Cell 7Cell 8
    diff --git a/test/tests/gfm_tables.md b/test/tests/gfm_tables.md deleted file mode 100644 index 5fd6321c1d..0000000000 --- a/test/tests/gfm_tables.md +++ /dev/null @@ -1,21 +0,0 @@ -| Heading 1 | Heading 2 -| --------- | --------- -| Cell 1 | Cell 2 -| Cell 3 | Cell 4 - -| Header 1 | Header 2 | Header 3 | Header 4 | -| :------: | -------: | :------- | -------- | -| Cell 1 | Cell 2 | Cell 3 | Cell 4 | -| Cell 5 | Cell 6 | Cell 7 | Cell 8 | - - Test code - -Header 1 | Header 2 --------- | -------- -Cell 1 | Cell 2 -Cell 3 | Cell 4 - -Header 1|Header 2|Header 3|Header 4 -:-------|:------:|-------:|-------- -Cell 1 |Cell 2 |Cell 3 |Cell 4 -*Cell 5*|Cell 6 |Cell 7 |Cell 8 diff --git a/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.html b/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.html deleted file mode 100644 index 53662fc1b5..0000000000 --- a/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.html +++ /dev/null @@ -1,8 +0,0 @@ -

    In Markdown 1.0.0 and earlier. Version -8. This line turns into a list item. -Because a hard-wrapped line in the -middle of a paragraph looked like a -list item.

    - -

    Here's one with a bullet. -* criminey.

    diff --git a/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.md b/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.md deleted file mode 100644 index f8a5b27bf4..0000000000 --- a/test/tests/hard_wrapped_paragraphs_with_list_like_lines.nogfm.md +++ /dev/null @@ -1,8 +0,0 @@ -In Markdown 1.0.0 and earlier. Version -8. This line turns into a list item. -Because a hard-wrapped line in the -middle of a paragraph looked like a -list item. - -Here's one with a bullet. -* criminey. diff --git a/test/tests/horizontal_rules.html b/test/tests/horizontal_rules.html deleted file mode 100644 index e60d4ba253..0000000000 --- a/test/tests/horizontal_rules.html +++ /dev/null @@ -1,71 +0,0 @@ -

    Dashes:

    - -
    - -
    - -
    - -
    - -
    ---
    -
    - -
    - -
    - -
    - -
    - -
    - - -
    -
    - -

    Asterisks:

    - -
    - -
    - -
    - -
    - -
    ***
    -
    - -
    - -
    - -
    - -
    - -
    * * *
    -
    - -

    Underscores:

    - -
    - -
    - -
    - -
    - -
    ___
    -
    - -
    - -
    - -
    - -
    - -
    _ _ _
    -
    diff --git a/test/tests/horizontal_rules.md b/test/tests/horizontal_rules.md deleted file mode 100644 index 1594bda27b..0000000000 --- a/test/tests/horizontal_rules.md +++ /dev/null @@ -1,67 +0,0 @@ -Dashes: - ---- - - --- - - --- - - --- - - --- - -- - - - - - - - - - - - - - - - - - - - - - - - - -Asterisks: - -*** - - *** - - *** - - *** - - *** - -* * * - - * * * - - * * * - - * * * - - * * * - - -Underscores: - -___ - - ___ - - ___ - - ___ - - ___ - -_ _ _ - - _ _ _ - - _ _ _ - - _ _ _ - - _ _ _ diff --git a/test/tests/hr_list_break.html b/test/tests/hr_list_break.html deleted file mode 100644 index bd3ad1f7cc..0000000000 --- a/test/tests/hr_list_break.html +++ /dev/null @@ -1,10 +0,0 @@ -
      -
    • hello -world
    • -
    • how -are
    • -
    - -
    - -

    you today?

    diff --git a/test/tests/hr_list_break.md b/test/tests/hr_list_break.md deleted file mode 100644 index 036fe47943..0000000000 --- a/test/tests/hr_list_break.md +++ /dev/null @@ -1,6 +0,0 @@ -* hello -world -* how -are -* * * -you today? diff --git a/test/tests/inline_html_advanced.html b/test/tests/inline_html_advanced.html deleted file mode 100644 index 3af9cafb1a..0000000000 --- a/test/tests/inline_html_advanced.html +++ /dev/null @@ -1,15 +0,0 @@ -

    Simple block on one line:

    - -
    foo
    - -

    And nested without indentation:

    - -
    -
    -
    -foo -
    -
    -
    -
    bar
    -
    diff --git a/test/tests/inline_html_advanced.md b/test/tests/inline_html_advanced.md deleted file mode 100644 index 86b7206d2a..0000000000 --- a/test/tests/inline_html_advanced.md +++ /dev/null @@ -1,15 +0,0 @@ -Simple block on one line: - -
    foo
    - -And nested without indentation: - -
    -
    -
    -foo -
    -
    -
    -
    bar
    -
    diff --git a/test/tests/inline_html_comments.html b/test/tests/inline_html_comments.html deleted file mode 100644 index 3f167a1610..0000000000 --- a/test/tests/inline_html_comments.html +++ /dev/null @@ -1,13 +0,0 @@ -

    Paragraph one.

    - - - - - -

    Paragraph two.

    - - - -

    The end.

    diff --git a/test/tests/inline_html_comments.md b/test/tests/inline_html_comments.md deleted file mode 100644 index 41d830d038..0000000000 --- a/test/tests/inline_html_comments.md +++ /dev/null @@ -1,13 +0,0 @@ -Paragraph one. - - - - - -Paragraph two. - - - -The end. diff --git a/test/tests/inline_html_simple.html b/test/tests/inline_html_simple.html deleted file mode 100644 index 35c827ddb7..0000000000 --- a/test/tests/inline_html_simple.html +++ /dev/null @@ -1,72 +0,0 @@ -

    Here's a simple block:

    - -
    - foo -
    - -

    This should be a code block, though:

    - -
    <div>
    -    foo
    -</div>
    -
    - -

    As should this:

    - -
    <div>foo</div>
    -
    - -

    Now, nested:

    - -
    -
    -
    - foo -
    -
    -
    - -

    This should just be an HTML comment:

    - - - -

    Multiline:

    - - - -

    Code block:

    - -
    <!-- Comment -->
    -
    - -

    Just plain comment, with trailing spaces on the line:

    - - - -

    Code:

    - -
    <hr>
    -
    - -

    Hr's:

    - -
    - -
    - -
    - -
    - -
    - -
    - -
    - -
    - -
    diff --git a/test/tests/inline_html_simple.md b/test/tests/inline_html_simple.md deleted file mode 100644 index df49d7bf97..0000000000 --- a/test/tests/inline_html_simple.md +++ /dev/null @@ -1,69 +0,0 @@ -Here's a simple block: - -
    - foo -
    - -This should be a code block, though: - -
    - foo -
    - -As should this: - -
    foo
    - -Now, nested: - -
    -
    -
    - foo -
    -
    -
    - -This should just be an HTML comment: - - - -Multiline: - - - -Code block: - - - -Just plain comment, with trailing spaces on the line: - - - -Code: - -
    - -Hr's: - -
    - -
    - -
    - -
    - -
    - -
    - -
    - -
    - -
    - diff --git a/test/tests/lazy_blockquotes.html b/test/tests/lazy_blockquotes.html deleted file mode 100644 index a701d42af9..0000000000 --- a/test/tests/lazy_blockquotes.html +++ /dev/null @@ -1,4 +0,0 @@ -
    -

    hi there -bud

    -
    diff --git a/test/tests/lazy_blockquotes.md b/test/tests/lazy_blockquotes.md deleted file mode 100644 index c0e0b15496..0000000000 --- a/test/tests/lazy_blockquotes.md +++ /dev/null @@ -1,2 +0,0 @@ -> hi there -bud diff --git a/test/tests/links.sanitize.html b/test/tests/links.sanitize.html deleted file mode 100644 index 58d6f5ea38..0000000000 --- a/test/tests/links.sanitize.html +++ /dev/null @@ -1,5 +0,0 @@ -

    -

    -

    -

    -

    \ No newline at end of file diff --git a/test/tests/links.sanitize.md b/test/tests/links.sanitize.md deleted file mode 100644 index ba5d09fed7..0000000000 --- a/test/tests/links.sanitize.md +++ /dev/null @@ -1,9 +0,0 @@ -[URL](javascript:alert) - -[URL](vbscript:alert) - -[URL](javascript:alert(1)) - -[URL](javascript:document;alert(1)) - -[URL](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K) \ No newline at end of file diff --git a/test/tests/links_inline_style.html b/test/tests/links_inline_style.html deleted file mode 100644 index 09df236ed7..0000000000 --- a/test/tests/links_inline_style.html +++ /dev/null @@ -1,15 +0,0 @@ -

    Just a URL.

    - -

    URL and title.

    - -

    URL and title.

    - -

    URL and title.

    - -

    URL and title.

    - -

    URL and title.

    - -

    URL and title.

    - -

    Empty.

    diff --git a/test/tests/links_inline_style.md b/test/tests/links_inline_style.md deleted file mode 100644 index 8c8eb4902e..0000000000 --- a/test/tests/links_inline_style.md +++ /dev/null @@ -1,15 +0,0 @@ -Just a [URL](/url/). - -[URL and title](/url/ "title"). - -[URL and title](/url/ "title preceded by two spaces"). - -[URL and title](/url/ "title preceded by a tab"). - -[URL and title](/url/ "title has spaces afterward" ). - -[URL and title]( /url/has space ). - -[URL and title]( /url/has space/ "url has space and title"). - -[Empty](). diff --git a/test/tests/links_reference_style.html b/test/tests/links_reference_style.html deleted file mode 100644 index 2ec1b41f21..0000000000 --- a/test/tests/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/tests/links_reference_style.md b/test/tests/links_reference_style.md deleted file mode 100644 index 39aa93bbae..0000000000 --- a/test/tests/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/ diff --git a/test/tests/links_shortcut_references.html b/test/tests/links_shortcut_references.html deleted file mode 100644 index bf81e939f5..0000000000 --- a/test/tests/links_shortcut_references.html +++ /dev/null @@ -1,9 +0,0 @@ -

    This is the simple case.

    - -

    This one has a line -break.

    - -

    This one has a line -break with a line-ending space.

    - -

    this and the other

    diff --git a/test/tests/links_shortcut_references.md b/test/tests/links_shortcut_references.md deleted file mode 100644 index 8c44c98fee..0000000000 --- a/test/tests/links_shortcut_references.md +++ /dev/null @@ -1,20 +0,0 @@ -This is the [simple case]. - -[simple case]: /simple - - - -This one has a [line -break]. - -This one has a [line -break] with a line-ending space. - -[line break]: /foo - - -[this] [that] and the [other] - -[this]: /this -[that]: /that -[other]: /other diff --git a/test/tests/list_item_text.html b/test/tests/list_item_text.html deleted file mode 100644 index 142df366ef..0000000000 --- a/test/tests/list_item_text.html +++ /dev/null @@ -1 +0,0 @@ -
    • item1

      • item2

      text

    diff --git a/test/tests/list_item_text.md b/test/tests/list_item_text.md deleted file mode 100644 index a8f81b1404..0000000000 --- a/test/tests/list_item_text.md +++ /dev/null @@ -1,5 +0,0 @@ - * item1 - - * item2 - - text diff --git a/test/tests/literal_quotes_in_titles.html b/test/tests/literal_quotes_in_titles.html deleted file mode 100644 index 611c1ac61f..0000000000 --- a/test/tests/literal_quotes_in_titles.html +++ /dev/null @@ -1,3 +0,0 @@ -

    Foo bar.

    - -

    Foo bar.

    diff --git a/test/tests/literal_quotes_in_titles.md b/test/tests/literal_quotes_in_titles.md deleted file mode 100644 index 29d0e4235b..0000000000 --- a/test/tests/literal_quotes_in_titles.md +++ /dev/null @@ -1,7 +0,0 @@ -Foo [bar][]. - -Foo [bar](/url/ "Title with "quotes" inside"). - - - [bar]: /url/ "Title with "quotes" inside" - diff --git a/test/tests/loose_lists.html b/test/tests/loose_lists.html deleted file mode 100644 index c1bd82a26a..0000000000 --- a/test/tests/loose_lists.html +++ /dev/null @@ -1,62 +0,0 @@ -
      -
    • hello -world

      - -

      how -are

    • -
    • you
    • -
    - - - -

    better behavior:

    - -
    • hello

      • world -how

        are -you

      • today

    • hi
    - - - -
      -
    • hello

    • -
    • world

    • -
    • hi
    • -
    - - - -
      -
    • hello
    • -
    • world

    • -
    • hi

    • -
    - - - -
      -
    • hello
    • -
    • world

      - -

      how

    • -
    • hi
    • -
    - - - -
      -
    • hello
    • -
    • world
    • -
    • how

      - -

      are

    • -
    - - - -
      -
    • hello
    • -
    • world

    • -
    • how

      - -

      are

    • -
    diff --git a/test/tests/loose_lists.md b/test/tests/loose_lists.md deleted file mode 100644 index cb360a15d7..0000000000 --- a/test/tests/loose_lists.md +++ /dev/null @@ -1,59 +0,0 @@ -* hello - world - - how - are -* you - - - -better behavior: - -* hello - * world - how - - are - you - - * today -* hi - - - -* hello - -* world -* hi - - - -* hello -* world - -* hi - - - -* hello -* world - - how -* hi - - - -* hello -* world -* how - - are - - - -* hello -* world - -* how - - are diff --git a/test/tests/main.html b/test/tests/main.html deleted file mode 100644 index 8f78c4d30e..0000000000 --- a/test/tests/main.html +++ /dev/null @@ -1,4 +0,0 @@ -

    A heading

    Just a note, I've found that I can't test my markdown parser vs others. For example, both markdown.js and showdown code blocks in lists wrong. They're also completely inconsistent with regards to paragraphs in list items.

    A link. Not anymore.

    • List Item 1

    • List Item 2

      • New List Item 1 Hi, this is a list item.
      • New List Item 2 Another item
        Code goes here.
        -Lots of it...
      • New List Item 3 The last item
    • List Item 3 The final item.

    • List Item 4 The real final item.

    Paragraph.

    • bq Item 1
    • bq Item 2
      • New bq Item 1
      • New bq Item 2 Text here

    Another blockquote! I really need to get more creative with mockup text.. markdown.js breaks here again

    Another Heading

    Hello world. Here is a link. And an image alt.

    Code goes here.
    -Lots of it...
    diff --git a/test/tests/main.md b/test/tests/main.md deleted file mode 100644 index 58e17a6a76..0000000000 --- a/test/tests/main.md +++ /dev/null @@ -1,55 +0,0 @@ -[test]: http://google.com/ "Google" - -# A heading - -Just a note, I've found that I can't test my markdown parser vs others. -For example, both markdown.js and showdown code blocks in lists wrong. They're -also completely [inconsistent][test] with regards to paragraphs in list items. - -A link. Not anymore. - - - -* List Item 1 - -* List Item 2 - * New List Item 1 - Hi, this is a list item. - * New List Item 2 - Another item - Code goes here. - Lots of it... - * New List Item 3 - The last item - -* List Item 3 -The final item. - -* List Item 4 -The real final item. - -Paragraph. - -> * bq Item 1 -> * bq Item 2 -> * New bq Item 1 -> * New bq Item 2 -> Text here - -* * * - -> Another blockquote! -> I really need to get -> more creative with -> mockup text.. -> markdown.js breaks here again - -Another Heading -------------- - -Hello *world*. Here is a [link](//hello). -And an image ![alt](src). - - Code goes here. - Lots of it... diff --git a/test/tests/mangle_xss.sanatize.nomangle.html b/test/tests/mangle_xss.sanatize.nomangle.html deleted file mode 100644 index 9f87f09a43..0000000000 --- a/test/tests/mangle_xss.sanatize.nomangle.html +++ /dev/null @@ -1,3 +0,0 @@ -

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

    - -

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

    diff --git a/test/tests/mangle_xss.sanatize.nomangle.md b/test/tests/mangle_xss.sanatize.nomangle.md deleted file mode 100644 index c44503da00..0000000000 --- a/test/tests/mangle_xss.sanatize.nomangle.md +++ /dev/null @@ -1,3 +0,0 @@ -< - - diff --git a/test/tests/markdown_documentation_basics.html b/test/tests/markdown_documentation_basics.html deleted file mode 100644 index aadbce2bb8..0000000000 --- a/test/tests/markdown_documentation_basics.html +++ /dev/null @@ -1,314 +0,0 @@ -

    Markdown: Basics

    - - - -

    Getting the Gist of Markdown's Formatting Syntax

    - -

    This page offers a brief overview of what it's like to use Markdown. -The syntax page provides complete, detailed documentation for -every feature, but Markdown should be very easy to pick up simply by -looking at a few examples of it in action. The examples on this page -are written in a before/after style, showing example syntax and the -HTML output produced by Markdown.

    - -

    It's also helpful to simply try Markdown out; the Dingus is a -web application that allows you type your own Markdown-formatted text -and translate it to XHTML.

    - -

    Note: This document is itself written using Markdown; you -can see the source for it by adding '.text' to the URL.

    - -

    Paragraphs, Headers, Blockquotes

    - -

    A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs.

    - -

    Markdown offers two styles of headers: Setext and atx. -Setext-style headers for <h1> and <h2> are created by -"underlining" with equal signs (=) and hyphens (-), respectively. -To create an atx-style header, you put 1-6 hash marks (#) at the -beginning of the line -- the number of hashes equals the resulting -HTML header level.

    - -

    Blockquotes are indicated using email-style '>' angle brackets.

    - -

    Markdown:

    - -
    A First Level Header
    -====================
    -
    -A Second Level Header
    ----------------------
    -
    -Now is the time for all good men to come to
    -the aid of their country. This is just a
    -regular paragraph.
    -
    -The quick brown fox jumped over the lazy
    -dog's back.
    -
    -### Header 3
    -
    -> This is a blockquote.
    -> 
    -> This is the second paragraph in the blockquote.
    ->
    -> ## This is an H2 in a blockquote
    -
    - -

    Output:

    - -
    <h1>A First Level Header</h1>
    -
    -<h2>A Second Level Header</h2>
    -
    -<p>Now is the time for all good men to come to
    -the aid of their country. This is just a
    -regular paragraph.</p>
    -
    -<p>The quick brown fox jumped over the lazy
    -dog's back.</p>
    -
    -<h3>Header 3</h3>
    -
    -<blockquote>
    -    <p>This is a blockquote.</p>
    -
    -    <p>This is the second paragraph in the blockquote.</p>
    -
    -    <h2>This is an H2 in a blockquote</h2>
    -</blockquote>
    -
    - -

    Phrase Emphasis

    - -

    Markdown uses asterisks and underscores to indicate spans of emphasis.

    - -

    Markdown:

    - -
    Some of these words *are emphasized*.
    -Some of these words _are emphasized also_.
    -
    -Use two asterisks for **strong emphasis**.
    -Or, if you prefer, __use two underscores instead__.
    -
    - -

    Output:

    - -
    <p>Some of these words <em>are emphasized</em>.
    -Some of these words <em>are emphasized also</em>.</p>
    -
    -<p>Use two asterisks for <strong>strong emphasis</strong>.
    -Or, if you prefer, <strong>use two underscores instead</strong>.</p>
    -
    - -

    Lists

    - -

    Unordered (bulleted) lists use asterisks, pluses, and hyphens (*, -+, and -) as list markers. These three markers are -interchangable; this:

    - -
    *   Candy.
    -*   Gum.
    -*   Booze.
    -
    - -

    this:

    - -
    +   Candy.
    -+   Gum.
    -+   Booze.
    -
    - -

    and this:

    - -
    -   Candy.
    --   Gum.
    --   Booze.
    -
    - -

    all produce the same output:

    - -
    <ul>
    -<li>Candy.</li>
    -<li>Gum.</li>
    -<li>Booze.</li>
    -</ul>
    -
    - -

    Ordered (numbered) lists use regular numbers, followed by periods, as -list markers:

    - -
    1.  Red
    -2.  Green
    -3.  Blue
    -
    - -

    Output:

    - -
    <ol>
    -<li>Red</li>
    -<li>Green</li>
    -<li>Blue</li>
    -</ol>
    -
    - -

    If you put blank lines between items, you'll get <p> tags for the -list item text. You can create multi-paragraph list items by indenting -the paragraphs by 4 spaces or 1 tab:

    - -
    *   A list item.
    -
    -    With multiple paragraphs.
    -
    -*   Another item in the list.
    -
    - -

    Output:

    - -
    <ul>
    -<li><p>A list item.</p>
    -<p>With multiple paragraphs.</p></li>
    -<li><p>Another item in the list.</p></li>
    -</ul>
    -
    - - - -

    Markdown supports two styles for creating links: inline and -reference. With both styles, you use square brackets to delimit the -text you want to turn into a link.

    - -

    Inline-style links use parentheses immediately after the link text. -For example:

    - -
    This is an [example link](http://example.com/).
    -
    - -

    Output:

    - -
    <p>This is an <a href="http://example.com/">
    -example link</a>.</p>
    -
    - -

    Optionally, you may include a title attribute in the parentheses:

    - -
    This is an [example link](http://example.com/ "With a Title").
    -
    - -

    Output:

    - -
    <p>This is an <a href="http://example.com/" title="With a Title">
    -example link</a>.</p>
    -
    - -

    Reference-style links allow you to refer to your links by names, which -you define elsewhere in your document:

    - -
    I get 10 times more traffic from [Google][1] than from
    -[Yahoo][2] or [MSN][3].
    -
    -[1]: http://google.com/        "Google"
    -[2]: http://search.yahoo.com/  "Yahoo Search"
    -[3]: http://search.msn.com/    "MSN Search"
    -
    - -

    Output:

    - -
    <p>I get 10 times more traffic from <a href="http://google.com/"
    -title="Google">Google</a> than from <a href="http://search.yahoo.com/"
    -title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
    -title="MSN Search">MSN</a>.</p>
    -
    - -

    The title attribute is optional. Link names may contain letters, -numbers and spaces, but are not case sensitive:

    - -
    I start my morning with a cup of coffee and
    -[The New York Times][NY Times].
    -
    -[ny times]: http://www.nytimes.com/
    -
    - -

    Output:

    - -
    <p>I start my morning with a cup of coffee and
    -<a href="http://www.nytimes.com/">The New York Times</a>.</p>
    -
    - -

    Images

    - -

    Image syntax is very much like link syntax.

    - -

    Inline (titles are optional):

    - -
    ![alt text](/path/to/img.jpg "Title")
    -
    - -

    Reference-style:

    - -
    ![alt text][id]
    -
    -[id]: /path/to/img.jpg "Title"
    -
    - -

    Both of the above examples produce the same output:

    - -
    <img src="/path/to/img.jpg" alt="alt text" title="Title" />
    -
    - -

    Code

    - -

    In a regular paragraph, you can create code span by wrapping text in -backtick quotes. Any ampersands (&) and angle brackets (< or ->) will automatically be translated into HTML entities. This makes -it easy to use Markdown to write about HTML example code:

    - -
    I strongly recommend against using any `<blink>` tags.
    -
    -I wish SmartyPants used named entities like `&mdash;`
    -instead of decimal-encoded entites like `&#8212;`.
    -
    - -

    Output:

    - -
    <p>I strongly recommend against using any
    -<code>&lt;blink&gt;</code> tags.</p>
    -
    -<p>I wish SmartyPants used named entities like
    -<code>&amp;mdash;</code> instead of decimal-encoded
    -entites like <code>&amp;#8212;</code>.</p>
    -
    - -

    To specify an entire block of pre-formatted code, indent every line of -the block by 4 spaces or 1 tab. Just like with code spans, &, <, -and > characters will be escaped automatically.

    - -

    Markdown:

    - -
    If you want your page to validate under XHTML 1.0 Strict,
    -you've got to put paragraph tags in your blockquotes:
    -
    -    <blockquote>
    -        <p>For example.</p>
    -    </blockquote>
    -
    - -

    Output:

    - -
    <p>If you want your page to validate under XHTML 1.0 Strict,
    -you've got to put paragraph tags in your blockquotes:</p>
    -
    -<pre><code>&lt;blockquote&gt;
    -    &lt;p&gt;For example.&lt;/p&gt;
    -&lt;/blockquote&gt;
    -</code></pre>
    -
    diff --git a/test/tests/markdown_documentation_basics.md b/test/tests/markdown_documentation_basics.md deleted file mode 100644 index 486055ca7f..0000000000 --- a/test/tests/markdown_documentation_basics.md +++ /dev/null @@ -1,306 +0,0 @@ -Markdown: Basics -================ - - - - -Getting the Gist of Markdown's Formatting Syntax ------------------------------------------------- - -This page offers a brief overview of what it's like to use Markdown. -The [syntax page] [s] provides complete, detailed documentation for -every feature, but Markdown should be very easy to pick up simply by -looking at a few examples of it in action. The examples on this page -are written in a before/after style, showing example syntax and the -HTML output produced by Markdown. - -It's also helpful to simply try Markdown out; the [Dingus] [d] is a -web application that allows you type your own Markdown-formatted text -and translate it to XHTML. - -**Note:** This document is itself written using Markdown; you -can [see the source for it by adding '.text' to the URL] [src]. - - [s]: /projects/markdown/syntax "Markdown Syntax" - [d]: /projects/markdown/dingus "Markdown Dingus" - [src]: /projects/markdown/basics.text - - -## Paragraphs, Headers, Blockquotes ## - -A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs. - -Markdown offers two styles of headers: *Setext* and *atx*. -Setext-style headers for `

    ` and `

    ` are created by -"underlining" with equal signs (`=`) and hyphens (`-`), respectively. -To create an atx-style header, you put 1-6 hash marks (`#`) at the -beginning of the line -- the number of hashes equals the resulting -HTML header level. - -Blockquotes are indicated using email-style '`>`' angle brackets. - -Markdown: - - A First Level Header - ==================== - - A Second Level Header - --------------------- - - Now is the time for all good men to come to - the aid of their country. This is just a - regular paragraph. - - The quick brown fox jumped over the lazy - dog's back. - - ### Header 3 - - > This is a blockquote. - > - > This is the second paragraph in the blockquote. - > - > ## This is an H2 in a blockquote - - -Output: - -

    A First Level Header

    - -

    A Second Level Header

    - -

    Now is the time for all good men to come to - the aid of their country. This is just a - regular paragraph.

    - -

    The quick brown fox jumped over the lazy - dog's back.

    - -

    Header 3

    - -
    -

    This is a blockquote.

    - -

    This is the second paragraph in the blockquote.

    - -

    This is an H2 in a blockquote

    -
    - - - -### Phrase Emphasis ### - -Markdown uses asterisks and underscores to indicate spans of emphasis. - -Markdown: - - Some of these words *are emphasized*. - Some of these words _are emphasized also_. - - Use two asterisks for **strong emphasis**. - Or, if you prefer, __use two underscores instead__. - -Output: - -

    Some of these words are emphasized. - Some of these words are emphasized also.

    - -

    Use two asterisks for strong emphasis. - Or, if you prefer, use two underscores instead.

    - - - -## Lists ## - -Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, -`+`, and `-`) as list markers. These three markers are -interchangable; this: - - * Candy. - * Gum. - * Booze. - -this: - - + Candy. - + Gum. - + Booze. - -and this: - - - Candy. - - Gum. - - Booze. - -all produce the same output: - -
      -
    • Candy.
    • -
    • Gum.
    • -
    • Booze.
    • -
    - -Ordered (numbered) lists use regular numbers, followed by periods, as -list markers: - - 1. Red - 2. Green - 3. Blue - -Output: - -
      -
    1. Red
    2. -
    3. Green
    4. -
    5. Blue
    6. -
    - -If you put blank lines between items, you'll get `

    ` tags for the -list item text. You can create multi-paragraph list items by indenting -the paragraphs by 4 spaces or 1 tab: - - * A list item. - - With multiple paragraphs. - - * Another item in the list. - -Output: - -

      -
    • A list item.

      -

      With multiple paragraphs.

    • -
    • Another item in the list.

    • -
    - - - -### Links ### - -Markdown supports two styles for creating links: *inline* and -*reference*. With both styles, you use square brackets to delimit the -text you want to turn into a link. - -Inline-style links use parentheses immediately after the link text. -For example: - - This is an [example link](http://example.com/). - -Output: - -

    This is an - example link.

    - -Optionally, you may include a title attribute in the parentheses: - - This is an [example link](http://example.com/ "With a Title"). - -Output: - -

    This is an - example link.

    - -Reference-style links allow you to refer to your links by names, which -you define elsewhere in your document: - - I get 10 times more traffic from [Google][1] than from - [Yahoo][2] or [MSN][3]. - - [1]: http://google.com/ "Google" - [2]: http://search.yahoo.com/ "Yahoo Search" - [3]: http://search.msn.com/ "MSN Search" - -Output: - -

    I get 10 times more traffic from Google than from Yahoo or MSN.

    - -The title attribute is optional. Link names may contain letters, -numbers and spaces, but are *not* case sensitive: - - I start my morning with a cup of coffee and - [The New York Times][NY Times]. - - [ny times]: http://www.nytimes.com/ - -Output: - -

    I start my morning with a cup of coffee and - The New York Times.

    - - -### Images ### - -Image syntax is very much like link syntax. - -Inline (titles are optional): - - ![alt text](/path/to/img.jpg "Title") - -Reference-style: - - ![alt text][id] - - [id]: /path/to/img.jpg "Title" - -Both of the above examples produce the same output: - - alt text - - - -### Code ### - -In a regular paragraph, you can create code span by wrapping text in -backtick quotes. Any ampersands (`&`) and angle brackets (`<` or -`>`) will automatically be translated into HTML entities. This makes -it easy to use Markdown to write about HTML example code: - - I strongly recommend against using any `` tags. - - I wish SmartyPants used named entities like `—` - instead of decimal-encoded entites like `—`. - -Output: - -

    I strongly recommend against using any - <blink> tags.

    - -

    I wish SmartyPants used named entities like - &mdash; instead of decimal-encoded - entites like &#8212;.

    - - -To specify an entire block of pre-formatted code, indent every line of -the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`, -and `>` characters will be escaped automatically. - -Markdown: - - If you want your page to validate under XHTML 1.0 Strict, - you've got to put paragraph tags in your blockquotes: - -
    -

    For example.

    -
    - -Output: - -

    If you want your page to validate under XHTML 1.0 Strict, - you've got to put paragraph tags in your blockquotes:

    - -
    <blockquote>
    -        <p>For example.</p>
    -    </blockquote>
    -    
    diff --git a/test/tests/markdown_documentation_syntax.html b/test/tests/markdown_documentation_syntax.html deleted file mode 100644 index 40e083711a..0000000000 --- a/test/tests/markdown_documentation_syntax.html +++ /dev/null @@ -1,942 +0,0 @@ -

    Markdown: Syntax

    - - - - - -

    Note: This document is itself written using Markdown; you -can see the source for it by adding '.text' to the URL.

    - -
    - -

    Overview

    - -

    Philosophy

    - -

    Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

    - -

    Readability, however, is emphasized above all else. 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. While -Markdown's syntax has been influenced by several existing text-to-HTML -filters -- including Setext, atx, Textile, reStructuredText, -Grutatext, and EtText -- the single biggest source of -inspiration for Markdown's syntax is the format of plain text email.

    - -

    To this end, Markdown's syntax is comprised entirely of punctuation -characters, which punctuation characters have been carefully chosen so -as to look like what they mean. E.g., asterisks around a word actually -look like *emphasis*. Markdown lists look like, well, lists. Even -blockquotes look like quoted passages of text, assuming you've ever -used email.

    - -

    Inline HTML

    - -

    Markdown's syntax is intended for one purpose: to be used as a -format for writing for the web.

    - -

    Markdown is not a replacement for HTML, or even close to it. Its -syntax is very small, corresponding only to a very small subset of -HTML tags. The idea is not to create a syntax that makes it easier -to insert HTML tags. In my opinion, HTML tags are already easy to -insert. The idea for Markdown is to make it easy to read, write, and -edit prose. HTML is a publishing format; Markdown is a writing -format. Thus, Markdown's formatting syntax only addresses issues that -can be conveyed in plain text.

    - -

    For any markup that is not covered by Markdown's syntax, you simply -use HTML itself. There's no need to preface it or delimit it to -indicate that you're switching from Markdown to HTML; you just use -the tags.

    - -

    The only restrictions are that block-level HTML elements -- e.g. <div>, -<table>, <pre>, <p>, etc. -- must be separated from surrounding -content by blank lines, and the start and end tags of the block should -not be indented with tabs or spaces. Markdown is smart enough not -to add extra (unwanted) <p> tags around HTML block-level tags.

    - -

    For example, to add an HTML table to a Markdown article:

    - -
    This is a regular paragraph.
    -
    -<table>
    -    <tr>
    -        <td>Foo</td>
    -    </tr>
    -</table>
    -
    -This is another regular paragraph.
    -
    - -

    Note that Markdown formatting syntax is not processed within block-level -HTML tags. E.g., you can't use Markdown-style *emphasis* inside an -HTML block.

    - -

    Span-level HTML tags -- e.g. <span>, <cite>, or <del> -- can be -used anywhere in a Markdown paragraph, list item, or header. If you -want, you can even use HTML tags instead of Markdown formatting; e.g. if -you'd prefer to use HTML <a> or <img> tags instead of Markdown's -link or image syntax, go right ahead.

    - -

    Unlike block-level HTML tags, Markdown syntax is processed within -span-level tags.

    - -

    Automatic Escaping for Special Characters

    - -

    In HTML, there are two characters that demand special treatment: < -and &. Left angle brackets are used to start tags; ampersands are -used to denote HTML entities. If you want to use them as literal -characters, you must escape them as entities, e.g. &lt;, and -&amp;.

    - -

    Ampersands in particular are bedeviling for web writers. If you want to -write about 'AT&T', you need to write 'AT&amp;T'. You even need to -escape ampersands within URLs. Thus, if you want to link to:

    - -
    http://images.google.com/images?num=30&q=larry+bird
    -
    - -

    you need to encode the URL as:

    - -
    http://images.google.com/images?num=30&amp;q=larry+bird
    -
    - -

    in your anchor tag href attribute. Needless to say, this is easy to -forget, and is probably the single most common source of HTML validation -errors in otherwise well-marked-up web sites.

    - -

    Markdown allows you to use these characters naturally, taking care of -all the necessary escaping for you. If you use an ampersand as part of -an HTML entity, it remains unchanged; otherwise it will be translated -into &amp;.

    - -

    So, if you want to include a copyright symbol in your article, you can write:

    - -
    &copy;
    -
    - -

    and Markdown will leave it alone. But if you write:

    - -
    AT&T
    -
    - -

    Markdown will translate it to:

    - -
    AT&amp;T
    -
    - -

    Similarly, because Markdown supports inline HTML, if you use -angle brackets as delimiters for HTML tags, Markdown will treat them as -such. But if you write:

    - -
    4 < 5
    -
    - -

    Markdown will translate it to:

    - -
    4 &lt; 5
    -
    - -

    However, inside Markdown code spans and blocks, angle brackets and -ampersands are always encoded automatically. This makes it easy to use -Markdown to write about HTML code. (As opposed to raw HTML, which is a -terrible format for writing about HTML syntax, because every single < -and & in your example code needs to be escaped.)

    - -
    - -

    Block Elements

    - -

    Paragraphs and Line Breaks

    - -

    A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing but spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs.

    - -

    The implication of the "one or more consecutive lines of text" rule is -that Markdown supports "hard-wrapped" text paragraphs. This differs -significantly from most other text-to-HTML formatters (including Movable -Type's "Convert Line Breaks" option) which translate every line break -character in a paragraph into a <br /> tag.

    - -

    When you do want to insert a <br /> break tag using Markdown, you -end a line with two or more spaces, then type return.

    - -

    Yes, this takes a tad more effort to create a <br />, but a simplistic -"every line break is a <br />" rule wouldn't work for Markdown. -Markdown's email-style blockquoting and multi-paragraph list items -work best -- and look better -- when you format them with hard breaks.

    - - - -

    Markdown supports two styles of headers, Setext and atx.

    - -

    Setext-style headers are "underlined" using equal signs (for first-level -headers) and dashes (for second-level headers). For example:

    - -
    This is an H1
    -=============
    -
    -This is an H2
    --------------
    -
    - -

    Any number of underlining ='s or -'s will work.

    - -

    Atx-style headers use 1-6 hash characters at the start of the line, -corresponding to header levels 1-6. For example:

    - -
    # This is an H1
    -
    -## This is an H2
    -
    -###### This is an H6
    -
    - -

    Optionally, you may "close" atx-style headers. This is purely -cosmetic -- you can use this if you think it looks better. The -closing hashes don't even need to match the number of hashes -used to open the header. (The number of opening hashes -determines the header level.) :

    - -
    # This is an H1 #
    -
    -## This is an H2 ##
    -
    -### This is an H3 ######
    -
    - -

    Blockquotes

    - -

    Markdown uses email-style > characters for blockquoting. If you're -familiar with quoting passages of text in an email message, then you -know how to create a blockquote in Markdown. It looks best if you hard -wrap the text and put a > before every line:

    - -
    > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
    -> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
    -> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
    -> 
    -> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
    -> id sem consectetuer libero luctus adipiscing.
    -
    - -

    Markdown allows you to be lazy and only put the > before the first -line of a hard-wrapped paragraph:

    - -
    > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
    -consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
    -Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
    -
    -> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
    -id sem consectetuer libero luctus adipiscing.
    -
    - -

    Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by -adding additional levels of >:

    - -
    > This is the first level of quoting.
    ->
    -> > This is nested blockquote.
    ->
    -> Back to the first level.
    -
    - -

    Blockquotes can contain other Markdown elements, including headers, lists, -and code blocks:

    - -
    > ## This is a header.
    -> 
    -> 1.   This is the first list item.
    -> 2.   This is the second list item.
    -> 
    -> Here's some example code:
    -> 
    ->     return shell_exec("echo $input | $markdown_script");
    -
    - -

    Any decent text editor should make email-style quoting easy. For -example, with BBEdit, you can make a selection and choose Increase -Quote Level from the Text menu.

    - -

    Lists

    - -

    Markdown supports ordered (numbered) and unordered (bulleted) lists.

    - -

    Unordered lists use asterisks, pluses, and hyphens -- interchangably --- as list markers:

    - -
    *   Red
    -*   Green
    -*   Blue
    -
    - -

    is equivalent to:

    - -
    +   Red
    -+   Green
    -+   Blue
    -
    - -

    and:

    - -
    -   Red
    --   Green
    --   Blue
    -
    - -

    Ordered lists use numbers followed by periods:

    - -
    1.  Bird
    -2.  McHale
    -3.  Parish
    -
    - -

    It's important to note that the actual numbers you use to mark the -list have no effect on the HTML output Markdown produces. The HTML -Markdown produces from the above list is:

    - -
    <ol>
    -<li>Bird</li>
    -<li>McHale</li>
    -<li>Parish</li>
    -</ol>
    -
    - -

    If you instead wrote the list in Markdown like this:

    - -
    1.  Bird
    -1.  McHale
    -1.  Parish
    -
    - -

    or even:

    - -
    3. Bird
    -1. McHale
    -8. Parish
    -
    - -

    you'd get the exact same HTML output. The point is, if you want to, -you can use ordinal numbers in your ordered Markdown lists, so that -the numbers in your source match the numbers in your published HTML. -But if you want to be lazy, you don't have to.

    - -

    If you do use lazy list numbering, however, you should still start the -list with the number 1. At some point in the future, Markdown may support -starting ordered lists at an arbitrary number.

    - -

    List markers typically start at the left margin, but may be indented by -up to three spaces. List markers must be followed by one or more spaces -or a tab.

    - -

    To make lists look nice, you can wrap items with hanging indents:

    - -
    *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    -    Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
    -    viverra nec, fringilla in, laoreet vitae, risus.
    -*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
    -    Suspendisse id sem consectetuer libero luctus adipiscing.
    -
    - -

    But if you want to be lazy, you don't have to:

    - -
    *   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
    -Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
    -viverra nec, fringilla in, laoreet vitae, risus.
    -*   Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
    -Suspendisse id sem consectetuer libero luctus adipiscing.
    -
    - -

    If list items are separated by blank lines, Markdown will wrap the -items in <p> tags in the HTML output. For example, this input:

    - -
    *   Bird
    -*   Magic
    -
    - -

    will turn into:

    - -
    <ul>
    -<li>Bird</li>
    -<li>Magic</li>
    -</ul>
    -
    - -

    But this:

    - -
    *   Bird
    -
    -*   Magic
    -
    - -

    will turn into:

    - -
    <ul>
    -<li><p>Bird</p></li>
    -<li><p>Magic</p></li>
    -</ul>
    -
    - -

    List items may consist of multiple paragraphs. Each subsequent -paragraph in a list item must be intended by either 4 spaces -or one tab:

    - -
    1.  This is a list item with two paragraphs. Lorem ipsum dolor
    -    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    -    mi posuere lectus.
    -
    -    Vestibulum enim wisi, viverra nec, fringilla in, laoreet
    -    vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
    -    sit amet velit.
    -
    -2.  Suspendisse id sem consectetuer libero luctus adipiscing.
    -
    - -

    It looks nice if you indent every line of the subsequent -paragraphs, but here again, Markdown will allow you to be -lazy:

    - -
    *   This is a list item with two paragraphs.
    -
    -    This is the second paragraph in the list item. You're
    -only required to indent the first line. Lorem ipsum dolor
    -sit amet, consectetuer adipiscing elit.
    -
    -*   Another item in the same list.
    -
    - -

    To put a blockquote within a list item, the blockquote's > -delimiters need to be indented:

    - -
    *   A list item with a blockquote:
    -
    -    > This is a blockquote
    -    > inside a list item.
    -
    - -

    To put a code block within a list item, the code block needs -to be indented twice -- 8 spaces or two tabs:

    - -
    *   A list item with a code block:
    -
    -        <code goes here>
    -
    - -

    It's worth noting that it's possible to trigger an ordered list by -accident, by writing something like this:

    - -
    1986. What a great season.
    -
    - -

    In other words, a number-period-space sequence at the beginning of a -line. To avoid this, you can backslash-escape the period:

    - -
    1986\. What a great season.
    -
    - -

    Code Blocks

    - -

    Pre-formatted code blocks are used for writing about programming or -markup source code. Rather than forming normal paragraphs, the lines -of a code block are interpreted literally. Markdown wraps a code block -in both <pre> and <code> tags.

    - -

    To produce a code block in Markdown, simply indent every line of the -block by at least 4 spaces or 1 tab. For example, given this input:

    - -
    This is a normal paragraph:
    -
    -    This is a code block.
    -
    - -

    Markdown will generate:

    - -
    <p>This is a normal paragraph:</p>
    -
    -<pre><code>This is a code block.
    -</code></pre>
    -
    - -

    One level of indentation -- 4 spaces or 1 tab -- is removed from each -line of the code block. For example, this:

    - -
    Here is an example of AppleScript:
    -
    -    tell application "Foo"
    -        beep
    -    end tell
    -
    - -

    will turn into:

    - -
    <p>Here is an example of AppleScript:</p>
    -
    -<pre><code>tell application "Foo"
    -    beep
    -end tell
    -</code></pre>
    -
    - -

    A code block continues until it reaches a line that is not indented -(or the end of the article).

    - -

    Within a code block, ampersands (&) and angle brackets (< and >) -are automatically converted into HTML entities. This makes it very -easy to include example HTML source code using Markdown -- just paste -it and indent it, and Markdown will handle the hassle of encoding the -ampersands and angle brackets. For example, this:

    - -
        <div class="footer">
    -        &copy; 2004 Foo Corporation
    -    </div>
    -
    - -

    will turn into:

    - -
    <pre><code>&lt;div class="footer"&gt;
    -    &amp;copy; 2004 Foo Corporation
    -&lt;/div&gt;
    -</code></pre>
    -
    - -

    Regular Markdown syntax is not processed within code blocks. E.g., -asterisks are just literal asterisks within a code block. This means -it's also easy to use Markdown to write about Markdown's own syntax.

    - -

    Horizontal Rules

    - -

    You can produce a horizontal rule tag (<hr>) by placing three or -more hyphens, asterisks, or underscores on a line by themselves. If you -wish, you may use spaces between the hyphens or asterisks. Each of the -following lines will produce a horizontal rule:

    - -
    * * *
    -
    -***
    -
    -*****
    -
    -- - -
    -
    ----------------------------------------
    -
    -_ _ _
    -
    - -
    - -

    Span Elements

    - - - -

    Markdown supports two style of links: inline and reference.

    - -

    In both styles, the link text is delimited by [square brackets].

    - -

    To create an inline link, use a set of regular parentheses immediately -after the link text's closing square bracket. Inside the parentheses, -put the URL where you want the link to point, along with an optional -title for the link, surrounded in quotes. For example:

    - -
    This is [an example](http://example.com/ "Title") inline link.
    -
    -[This link](http://example.net/) has no title attribute.
    -
    - -

    Will produce:

    - -
    <p>This is <a href="http://example.com/" title="Title">
    -an example</a> inline link.</p>
    -
    -<p><a href="http://example.net/">This link</a> has no
    -title attribute.</p>
    -
    - -

    If you're referring to a local resource on the same server, you can -use relative paths:

    - -
    See my [About](/about/) page for details.
    -
    - -

    Reference-style links use a second set of square brackets, inside -which you place a label of your choosing to identify the link:

    - -
    This is [an example][id] reference-style link.
    -
    - -

    You can optionally use a space to separate the sets of brackets:

    - -
    This is [an example] [id] reference-style link.
    -
    - -

    Then, anywhere in the document, you define your link label like this, -on a line by itself:

    - -
    [id]: http://example.com/  "Optional Title Here"
    -
    - -

    That is:

    - -
      -
    • Square brackets containing the link identifier (optionally -indented from the left margin using up to three spaces);
    • -
    • followed by a colon;
    • -
    • followed by one or more spaces (or tabs);
    • -
    • followed by the URL for the link;
    • -
    • optionally followed by a title attribute for the link, enclosed -in double or single quotes.
    • -
    - -

    The link URL may, optionally, be surrounded by angle brackets:

    - -
    [id]: <http://example.com/>  "Optional Title Here"
    -
    - -

    You can put the title attribute on the next line and use extra spaces -or tabs for padding, which tends to look better with longer URLs:

    - -
    [id]: http://example.com/longish/path/to/resource/here
    -    "Optional Title Here"
    -
    - -

    Link definitions are only used for creating links during Markdown -processing, and are stripped from your document in the HTML output.

    - -

    Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are not case sensitive. E.g. these two links:

    - -
    [link text][a]
    -[link text][A]
    -
    - -

    are equivalent.

    - -

    The implicit link name shortcut allows you to omit the name of the -link, in which case the link text itself is used as the name. -Just use an empty set of square brackets -- e.g., to link the word -"Google" to the google.com web site, you could simply write:

    - -
    [Google][]
    -
    - -

    And then define the link:

    - -
    [Google]: http://google.com/
    -
    - -

    Because link names may contain spaces, this shortcut even works for -multiple words in the link text:

    - -
    Visit [Daring Fireball][] for more information.
    -
    - -

    And then define the link:

    - -
    [Daring Fireball]: http://daringfireball.net/
    -
    - -

    Link definitions can be placed anywhere in your Markdown document. I -tend to put them immediately after each paragraph in which they're -used, but if you want, you can put them all at the end of your -document, sort of like footnotes.

    - -

    Here's an example of reference links in action:

    - -
    I get 10 times more traffic from [Google] [1] than from
    -[Yahoo] [2] or [MSN] [3].
    -
    -  [1]: http://google.com/        "Google"
    -  [2]: http://search.yahoo.com/  "Yahoo Search"
    -  [3]: http://search.msn.com/    "MSN Search"
    -
    - -

    Using the implicit link name shortcut, you could instead write:

    - -
    I get 10 times more traffic from [Google][] than from
    -[Yahoo][] or [MSN][].
    -
    -  [google]: http://google.com/        "Google"
    -  [yahoo]:  http://search.yahoo.com/  "Yahoo Search"
    -  [msn]:    http://search.msn.com/    "MSN Search"
    -
    - -

    Both of the above examples will produce the following HTML output:

    - -
    <p>I get 10 times more traffic from <a href="http://google.com/"
    -title="Google">Google</a> than from
    -<a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a>
    -or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
    -
    - -

    For comparison, here is the same paragraph written using -Markdown's inline link style:

    - -
    I get 10 times more traffic from [Google](http://google.com/ "Google")
    -than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
    -[MSN](http://search.msn.com/ "MSN Search").
    -
    - -

    The point of reference-style links is not that they're easier to -write. The point is that with reference-style links, your document -source is vastly more readable. Compare the above examples: using -reference-style links, the paragraph itself is only 81 characters -long; with inline-style links, it's 176 characters; and as raw HTML, -it's 234 characters. In the raw HTML, there's more markup than there -is text.

    - -

    With Markdown's reference-style links, a source document much more -closely resembles the final output, as rendered in a browser. By -allowing you to move the markup-related metadata out of the paragraph, -you can add links without interrupting the narrative flow of your -prose.

    - -

    Emphasis

    - -

    Markdown treats asterisks (*) and underscores (_) as indicators of -emphasis. Text wrapped with one * or _ will be wrapped with an -HTML <em> tag; double *'s or _'s will be wrapped with an HTML -<strong> tag. E.g., this input:

    - -
    *single asterisks*
    -
    -_single underscores_
    -
    -**double asterisks**
    -
    -__double underscores__
    -
    - -

    will produce:

    - -
    <em>single asterisks</em>
    -
    -<em>single underscores</em>
    -
    -<strong>double asterisks</strong>
    -
    -<strong>double underscores</strong>
    -
    - -

    You can use whichever style you prefer; the lone restriction is that -the same character must be used to open and close an emphasis span.

    - -

    Emphasis can be used in the middle of a word:

    - -
    un*fucking*believable
    -
    - -

    But if you surround an * or _ with spaces, it'll be treated as a -literal asterisk or underscore.

    - -

    To produce a literal asterisk or underscore at a position where it -would otherwise be used as an emphasis delimiter, you can backslash -escape it:

    - -
    \*this text is surrounded by literal asterisks\*
    -
    - -

    Code

    - -

    To indicate a span of code, wrap it with backtick quotes (`). -Unlike a pre-formatted code block, a code span indicates code within a -normal paragraph. For example:

    - -
    Use the `printf()` function.
    -
    - -

    will produce:

    - -
    <p>Use the <code>printf()</code> function.</p>
    -
    - -

    To include a literal backtick character within a code span, you can use -multiple backticks as the opening and closing delimiters:

    - -
    ``There is a literal backtick (`) here.``
    -
    - -

    which will produce this:

    - -
    <p><code>There is a literal backtick (`) here.</code></p>
    -
    - -

    The backtick delimiters surrounding a code span may include spaces -- -one after the opening, one before the closing. This allows you to place -literal backtick characters at the beginning or end of a code span:

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

    will produce:

    - -
    <p>A single backtick in a code span: <code>`</code></p>
    -
    -<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
    -
    - -

    With a code span, ampersands and angle brackets are encoded as HTML -entities automatically, which makes it easy to include example HTML -tags. Markdown will turn this:

    - -
    Please don't use any `<blink>` tags.
    -
    - -

    into:

    - -
    <p>Please don't use any <code>&lt;blink&gt;</code> tags.</p>
    -
    - -

    You can write this:

    - -
    `&#8212;` is the decimal-encoded equivalent of `&mdash;`.
    -
    - -

    to produce:

    - -
    <p><code>&amp;#8212;</code> is the decimal-encoded
    -equivalent of <code>&amp;mdash;</code>.</p>
    -
    - -

    Images

    - -

    Admittedly, it's fairly difficult to devise a "natural" syntax for -placing images into a plain text document format.

    - -

    Markdown uses an image syntax that is intended to resemble the syntax -for links, allowing for two styles: inline and reference.

    - -

    Inline image syntax looks like this:

    - -
    ![Alt text](/path/to/img.jpg)
    -
    -![Alt text](/path/to/img.jpg "Optional title")
    -
    - -

    That is:

    - -
      -
    • An exclamation mark: !;
    • -
    • followed by a set of square brackets, containing the alt -attribute text for the image;
    • -
    • followed by a set of parentheses, containing the URL or path to -the image, and an optional title attribute enclosed in double -or single quotes.
    • -
    - -

    Reference-style image syntax looks like this:

    - -
    ![Alt text][id]
    -
    - -

    Where "id" is the name of a defined image reference. Image references -are defined using syntax identical to link references:

    - -
    [id]: url/to/image  "Optional title attribute"
    -
    - -

    As of this writing, Markdown has no syntax for specifying the -dimensions of an image; if this is important to you, you can simply -use regular HTML <img> tags.

    - -
    - -

    Miscellaneous

    - - - -

    Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:

    - -
    <http://example.com/>
    -
    - -

    Markdown will turn this into:

    - -
    <a href="http://example.com/">http://example.com/</a>
    -
    - -

    Automatic links for email addresses work similarly, except that -Markdown will also perform a bit of randomized decimal and hex -entity-encoding to help obscure your address from address-harvesting -spambots. For example, Markdown will turn this:

    - -
    <address@example.com>
    -
    - -

    into something like this:

    - -
    <a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65;
    -&#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;
    -&#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61;
    -&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a>
    -
    - -

    which will render in a browser as a clickable link to "address@example.com".

    - -

    (This sort of entity-encoding trick will indeed fool many, if not -most, address-harvesting bots, but it definitely won't fool all of -them. It's better than nothing, but an address published in this way -will probably eventually start receiving spam.)

    - -

    Backslash Escapes

    - -

    Markdown allows you to use backslash escapes to generate literal -characters which would otherwise have special meaning in Markdown's -formatting syntax. For example, if you wanted to surround a word with -literal asterisks (instead of an HTML <em> tag), you can backslashes -before the asterisks, like this:

    - -
    \*literal asterisks\*
    -
    - -

    Markdown provides backslash escapes for the following characters:

    - -
    \   backslash
    -`   backtick
    -*   asterisk
    -_   underscore
    -{}  curly braces
    -[]  square brackets
    -()  parentheses
    -#   hash mark
    -+   plus sign
    --   minus sign (hyphen)
    -.   dot
    -!   exclamation mark
    -
    diff --git a/test/tests/markdown_documentation_syntax.md b/test/tests/markdown_documentation_syntax.md deleted file mode 100644 index 79287abc9f..0000000000 --- a/test/tests/markdown_documentation_syntax.md +++ /dev/null @@ -1,888 +0,0 @@ -Markdown: Syntax -================ - - - - -* [Overview](#overview) - * [Philosophy](#philosophy) - * [Inline HTML](#html) - * [Automatic Escaping for Special Characters](#autoescape) -* [Block Elements](#block) - * [Paragraphs and Line Breaks](#p) - * [Headers](#header) - * [Blockquotes](#blockquote) - * [Lists](#list) - * [Code Blocks](#precode) - * [Horizontal Rules](#hr) -* [Span Elements](#span) - * [Links](#link) - * [Emphasis](#em) - * [Code](#code) - * [Images](#img) -* [Miscellaneous](#misc) - * [Backslash Escapes](#backslash) - * [Automatic Links](#autolink) - - -**Note:** This document is itself written using Markdown; you -can [see the source for it by adding '.text' to the URL][src]. - - [src]: /projects/markdown/syntax.text - -* * * - -

    Overview

    - -

    Philosophy

    - -Markdown is intended to be as easy-to-read and easy-to-write as is feasible. - -Readability, however, is emphasized above all else. 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. While -Markdown's syntax has been influenced by several existing text-to-HTML -filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4], -[Grutatext] [5], and [EtText] [6] -- the single biggest source of -inspiration for Markdown's syntax is the format of plain text email. - - [1]: http://docutils.sourceforge.net/mirror/setext.html - [2]: http://www.aaronsw.com/2002/atx/ - [3]: http://textism.com/tools/textile/ - [4]: http://docutils.sourceforge.net/rst.html - [5]: http://www.triptico.com/software/grutatxt.html - [6]: http://ettext.taint.org/doc/ - -To this end, Markdown's syntax is comprised entirely of punctuation -characters, which punctuation characters have been carefully chosen so -as to look like what they mean. E.g., asterisks around a word actually -look like \*emphasis\*. Markdown lists look like, well, lists. Even -blockquotes look like quoted passages of text, assuming you've ever -used email. - - - -

    Inline HTML

    - -Markdown's syntax is intended for one purpose: to be used as a -format for *writing* for the web. - -Markdown is not a replacement for HTML, or even close to it. Its -syntax is very small, corresponding only to a very small subset of -HTML tags. The idea is *not* to create a syntax that makes it easier -to insert HTML tags. In my opinion, HTML tags are already easy to -insert. The idea for Markdown is to make it easy to read, write, and -edit prose. HTML is a *publishing* format; Markdown is a *writing* -format. Thus, Markdown's formatting syntax only addresses issues that -can be conveyed in plain text. - -For any markup that is not covered by Markdown's syntax, you simply -use HTML itself. There's no need to preface it or delimit it to -indicate that you're switching from Markdown to HTML; you just use -the tags. - -The only restrictions are that block-level HTML elements -- e.g. `
    `, -``, `
    `, `

    `, etc. -- must be separated from surrounding -content by blank lines, and the start and end tags of the block should -not be indented with tabs or spaces. Markdown is smart enough not -to add extra (unwanted) `

    ` tags around HTML block-level tags. - -For example, to add an HTML table to a Markdown article: - - This is a regular paragraph. - -

    - - - -
    Foo
    - - This is another regular paragraph. - -Note that Markdown formatting syntax is not processed within block-level -HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an -HTML block. - -Span-level HTML tags -- e.g. ``, ``, or `` -- can be -used anywhere in a Markdown paragraph, list item, or header. If you -want, you can even use HTML tags instead of Markdown formatting; e.g. if -you'd prefer to use HTML `` or `` tags instead of Markdown's -link or image syntax, go right ahead. - -Unlike block-level HTML tags, Markdown syntax *is* processed within -span-level tags. - - -

    Automatic Escaping for Special Characters

    - -In HTML, there are two characters that demand special treatment: `<` -and `&`. Left angle brackets are used to start tags; ampersands are -used to denote HTML entities. If you want to use them as literal -characters, you must escape them as entities, e.g. `<`, and -`&`. - -Ampersands in particular are bedeviling for web writers. If you want to -write about 'AT&T', you need to write '`AT&T`'. You even need to -escape ampersands within URLs. Thus, if you want to link to: - - http://images.google.com/images?num=30&q=larry+bird - -you need to encode the URL as: - - http://images.google.com/images?num=30&q=larry+bird - -in your anchor tag `href` attribute. Needless to say, this is easy to -forget, and is probably the single most common source of HTML validation -errors in otherwise well-marked-up web sites. - -Markdown allows you to use these characters naturally, taking care of -all the necessary escaping for you. If you use an ampersand as part of -an HTML entity, it remains unchanged; otherwise it will be translated -into `&`. - -So, if you want to include a copyright symbol in your article, you can write: - - © - -and Markdown will leave it alone. But if you write: - - AT&T - -Markdown will translate it to: - - AT&T - -Similarly, because Markdown supports [inline HTML](#html), if you use -angle brackets as delimiters for HTML tags, Markdown will treat them as -such. But if you write: - - 4 < 5 - -Markdown will translate it to: - - 4 < 5 - -However, inside Markdown code spans and blocks, angle brackets and -ampersands are *always* encoded automatically. This makes it easy to use -Markdown to write about HTML code. (As opposed to raw HTML, which is a -terrible format for writing about HTML syntax, because every single `<` -and `&` in your example code needs to be escaped.) - - -* * * - - -

    Block Elements

    - - -

    Paragraphs and Line Breaks

    - -A paragraph is simply one or more consecutive lines of text, separated -by one or more blank lines. (A blank line is any line that looks like a -blank line -- a line containing nothing but spaces or tabs is considered -blank.) Normal paragraphs should not be intended with spaces or tabs. - -The implication of the "one or more consecutive lines of text" rule is -that Markdown supports "hard-wrapped" text paragraphs. This differs -significantly from most other text-to-HTML formatters (including Movable -Type's "Convert Line Breaks" option) which translate every line break -character in a paragraph into a `
    ` tag. - -When you *do* want to insert a `
    ` break tag using Markdown, you -end a line with two or more spaces, then type return. - -Yes, this takes a tad more effort to create a `
    `, but a simplistic -"every line break is a `
    `" rule wouldn't work for Markdown. -Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] -work best -- and look better -- when you format them with hard breaks. - - [bq]: #blockquote - [l]: #list - - - - - -Markdown supports two styles of headers, [Setext] [1] and [atx] [2]. - -Setext-style headers are "underlined" using equal signs (for first-level -headers) and dashes (for second-level headers). For example: - - This is an H1 - ============= - - This is an H2 - ------------- - -Any number of underlining `=`'s or `-`'s will work. - -Atx-style headers use 1-6 hash characters at the start of the line, -corresponding to header levels 1-6. For example: - - # This is an H1 - - ## This is an H2 - - ###### This is an H6 - -Optionally, you may "close" atx-style headers. This is purely -cosmetic -- you can use this if you think it looks better. The -closing hashes don't even need to match the number of hashes -used to open the header. (The number of opening hashes -determines the header level.) : - - # This is an H1 # - - ## This is an H2 ## - - ### This is an H3 ###### - - -

    Blockquotes

    - -Markdown uses email-style `>` characters for blockquoting. If you're -familiar with quoting passages of text in an email message, then you -know how to create a blockquote in Markdown. It looks best if you hard -wrap the text and put a `>` before every line: - - > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, - > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. - > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. - > - > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse - > id sem consectetuer libero luctus adipiscing. - -Markdown allows you to be lazy and only put the `>` before the first -line of a hard-wrapped paragraph: - - > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, - consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. - Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. - - > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse - id sem consectetuer libero luctus adipiscing. - -Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by -adding additional levels of `>`: - - > This is the first level of quoting. - > - > > This is nested blockquote. - > - > Back to the first level. - -Blockquotes can contain other Markdown elements, including headers, lists, -and code blocks: - - > ## This is a header. - > - > 1. This is the first list item. - > 2. This is the second list item. - > - > Here's some example code: - > - > return shell_exec("echo $input | $markdown_script"); - -Any decent text editor should make email-style quoting easy. For -example, with BBEdit, you can make a selection and choose Increase -Quote Level from the Text menu. - - -

    Lists

    - -Markdown supports ordered (numbered) and unordered (bulleted) lists. - -Unordered lists use asterisks, pluses, and hyphens -- interchangably --- as list markers: - - * Red - * Green - * Blue - -is equivalent to: - - + Red - + Green - + Blue - -and: - - - Red - - Green - - Blue - -Ordered lists use numbers followed by periods: - - 1. Bird - 2. McHale - 3. Parish - -It's important to note that the actual numbers you use to mark the -list have no effect on the HTML output Markdown produces. The HTML -Markdown produces from the above list is: - -
      -
    1. Bird
    2. -
    3. McHale
    4. -
    5. Parish
    6. -
    - -If you instead wrote the list in Markdown like this: - - 1. Bird - 1. McHale - 1. Parish - -or even: - - 3. Bird - 1. McHale - 8. Parish - -you'd get the exact same HTML output. The point is, if you want to, -you can use ordinal numbers in your ordered Markdown lists, so that -the numbers in your source match the numbers in your published HTML. -But if you want to be lazy, you don't have to. - -If you do use lazy list numbering, however, you should still start the -list with the number 1. At some point in the future, Markdown may support -starting ordered lists at an arbitrary number. - -List markers typically start at the left margin, but may be indented by -up to three spaces. List markers must be followed by one or more spaces -or a tab. - -To make lists look nice, you can wrap items with hanging indents: - - * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, - viverra nec, fringilla in, laoreet vitae, risus. - * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. - Suspendisse id sem consectetuer libero luctus adipiscing. - -But if you want to be lazy, you don't have to: - - * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, - viverra nec, fringilla in, laoreet vitae, risus. - * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. - Suspendisse id sem consectetuer libero luctus adipiscing. - -If list items are separated by blank lines, Markdown will wrap the -items in `

    ` tags in the HTML output. For example, this input: - - * Bird - * Magic - -will turn into: - -

      -
    • Bird
    • -
    • Magic
    • -
    - -But this: - - * Bird - - * Magic - -will turn into: - -
      -
    • Bird

    • -
    • Magic

    • -
    - -List items may consist of multiple paragraphs. Each subsequent -paragraph in a list item must be intended by either 4 spaces -or one tab: - - 1. This is a list item with two paragraphs. Lorem ipsum dolor - sit amet, consectetuer adipiscing elit. Aliquam hendrerit - mi posuere lectus. - - Vestibulum enim wisi, viverra nec, fringilla in, laoreet - vitae, risus. Donec sit amet nisl. Aliquam semper ipsum - sit amet velit. - - 2. Suspendisse id sem consectetuer libero luctus adipiscing. - -It looks nice if you indent every line of the subsequent -paragraphs, but here again, Markdown will allow you to be -lazy: - - * This is a list item with two paragraphs. - - This is the second paragraph in the list item. You're - only required to indent the first line. Lorem ipsum dolor - sit amet, consectetuer adipiscing elit. - - * Another item in the same list. - -To put a blockquote within a list item, the blockquote's `>` -delimiters need to be indented: - - * A list item with a blockquote: - - > This is a blockquote - > inside a list item. - -To put a code block within a list item, the code block needs -to be indented *twice* -- 8 spaces or two tabs: - - * A list item with a code block: - - - - -It's worth noting that it's possible to trigger an ordered list by -accident, by writing something like this: - - 1986. What a great season. - -In other words, a *number-period-space* sequence at the beginning of a -line. To avoid this, you can backslash-escape the period: - - 1986\. What a great season. - - - -

    Code Blocks

    - -Pre-formatted code blocks are used for writing about programming or -markup source code. Rather than forming normal paragraphs, the lines -of a code block are interpreted literally. Markdown wraps a code block -in both `
    ` and `` tags.
    -
    -To produce a code block in Markdown, simply indent every line of the
    -block by at least 4 spaces or 1 tab. For example, given this input:
    -
    -    This is a normal paragraph:
    -
    -        This is a code block.
    -
    -Markdown will generate:
    -
    -    

    This is a normal paragraph:

    - -
    This is a code block.
    -    
    - -One level of indentation -- 4 spaces or 1 tab -- is removed from each -line of the code block. For example, this: - - Here is an example of AppleScript: - - tell application "Foo" - beep - end tell - -will turn into: - -

    Here is an example of AppleScript:

    - -
    tell application "Foo"
    -        beep
    -    end tell
    -    
    - -A code block continues until it reaches a line that is not indented -(or the end of the article). - -Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) -are automatically converted into HTML entities. This makes it very -easy to include example HTML source code using Markdown -- just paste -it and indent it, and Markdown will handle the hassle of encoding the -ampersands and angle brackets. For example, this: - - - -will turn into: - -
    <div class="footer">
    -        &copy; 2004 Foo Corporation
    -    </div>
    -    
    - -Regular Markdown syntax is not processed within code blocks. E.g., -asterisks are just literal asterisks within a code block. This means -it's also easy to use Markdown to write about Markdown's own syntax. - - - -

    Horizontal Rules

    - -You can produce a horizontal rule tag (`
    `) by placing three or -more hyphens, asterisks, or underscores on a line by themselves. If you -wish, you may use spaces between the hyphens or asterisks. Each of the -following lines will produce a horizontal rule: - - * * * - - *** - - ***** - - - - - - - --------------------------------------- - - _ _ _ - - -* * * - -

    Span Elements

    - - - -Markdown supports two style of links: *inline* and *reference*. - -In both styles, the link text is delimited by [square brackets]. - -To create an inline link, use a set of regular parentheses immediately -after the link text's closing square bracket. Inside the parentheses, -put the URL where you want the link to point, along with an *optional* -title for the link, surrounded in quotes. For example: - - This is [an example](http://example.com/ "Title") inline link. - - [This link](http://example.net/) has no title attribute. - -Will produce: - -

    This is - an example inline link.

    - -

    This link has no - title attribute.

    - -If you're referring to a local resource on the same server, you can -use relative paths: - - See my [About](/about/) page for details. - -Reference-style links use a second set of square brackets, inside -which you place a label of your choosing to identify the link: - - This is [an example][id] reference-style link. - -You can optionally use a space to separate the sets of brackets: - - This is [an example] [id] reference-style link. - -Then, anywhere in the document, you define your link label like this, -on a line by itself: - - [id]: http://example.com/ "Optional Title Here" - -That is: - -* Square brackets containing the link identifier (optionally - indented from the left margin using up to three spaces); -* followed by a colon; -* followed by one or more spaces (or tabs); -* followed by the URL for the link; -* optionally followed by a title attribute for the link, enclosed - in double or single quotes. - -The link URL may, optionally, be surrounded by angle brackets: - - [id]: "Optional Title Here" - -You can put the title attribute on the next line and use extra spaces -or tabs for padding, which tends to look better with longer URLs: - - [id]: http://example.com/longish/path/to/resource/here - "Optional Title Here" - -Link definitions are only used for creating links during Markdown -processing, and are stripped from your document in the HTML output. - -Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: - - [link text][a] - [link text][A] - -are equivalent. - -The *implicit link name* shortcut allows you to omit the name of the -link, in which case the link text itself is used as the name. -Just use an empty set of square brackets -- e.g., to link the word -"Google" to the google.com web site, you could simply write: - - [Google][] - -And then define the link: - - [Google]: http://google.com/ - -Because link names may contain spaces, this shortcut even works for -multiple words in the link text: - - Visit [Daring Fireball][] for more information. - -And then define the link: - - [Daring Fireball]: http://daringfireball.net/ - -Link definitions can be placed anywhere in your Markdown document. I -tend to put them immediately after each paragraph in which they're -used, but if you want, you can put them all at the end of your -document, sort of like footnotes. - -Here's an example of reference links in action: - - I get 10 times more traffic from [Google] [1] than from - [Yahoo] [2] or [MSN] [3]. - - [1]: http://google.com/ "Google" - [2]: http://search.yahoo.com/ "Yahoo Search" - [3]: http://search.msn.com/ "MSN Search" - -Using the implicit link name shortcut, you could instead write: - - I get 10 times more traffic from [Google][] than from - [Yahoo][] or [MSN][]. - - [google]: http://google.com/ "Google" - [yahoo]: http://search.yahoo.com/ "Yahoo Search" - [msn]: http://search.msn.com/ "MSN Search" - -Both of the above examples will produce the following HTML output: - -

    I get 10 times more traffic from Google than from - Yahoo - or MSN.

    - -For comparison, here is the same paragraph written using -Markdown's inline link style: - - I get 10 times more traffic from [Google](http://google.com/ "Google") - than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or - [MSN](http://search.msn.com/ "MSN Search"). - -The point of reference-style links is not that they're easier to -write. The point is that with reference-style links, your document -source is vastly more readable. Compare the above examples: using -reference-style links, the paragraph itself is only 81 characters -long; with inline-style links, it's 176 characters; and as raw HTML, -it's 234 characters. In the raw HTML, there's more markup than there -is text. - -With Markdown's reference-style links, a source document much more -closely resembles the final output, as rendered in a browser. By -allowing you to move the markup-related metadata out of the paragraph, -you can add links without interrupting the narrative flow of your -prose. - - -

    Emphasis

    - -Markdown treats asterisks (`*`) and underscores (`_`) as indicators of -emphasis. Text wrapped with one `*` or `_` will be wrapped with an -HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML -`` tag. E.g., this input: - - *single asterisks* - - _single underscores_ - - **double asterisks** - - __double underscores__ - -will produce: - - single asterisks - - single underscores - - double asterisks - - double underscores - -You can use whichever style you prefer; the lone restriction is that -the same character must be used to open and close an emphasis span. - -Emphasis can be used in the middle of a word: - - un*fucking*believable - -But if you surround an `*` or `_` with spaces, it'll be treated as a -literal asterisk or underscore. - -To produce a literal asterisk or underscore at a position where it -would otherwise be used as an emphasis delimiter, you can backslash -escape it: - - \*this text is surrounded by literal asterisks\* - - - -

    Code

    - -To indicate a span of code, wrap it with backtick quotes (`` ` ``). -Unlike a pre-formatted code block, a code span indicates code within a -normal paragraph. For example: - - Use the `printf()` function. - -will produce: - -

    Use the printf() function.

    - -To include a literal backtick character within a code span, you can use -multiple backticks as the opening and closing delimiters: - - ``There is a literal backtick (`) here.`` - -which will produce this: - -

    There is a literal backtick (`) here.

    - -The backtick delimiters surrounding a code span may include spaces -- -one after the opening, one before the closing. This allows you to place -literal backtick characters at the beginning or end of a code span: - - A single backtick in a code span: `` ` `` - - A backtick-delimited string in a code span: `` `foo` `` - -will produce: - -

    A single backtick in a code span: `

    - -

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

    - -With a code span, ampersands and angle brackets are encoded as HTML -entities automatically, which makes it easy to include example HTML -tags. Markdown will turn this: - - Please don't use any `` tags. - -into: - -

    Please don't use any <blink> tags.

    - -You can write this: - - `—` is the decimal-encoded equivalent of `—`. - -to produce: - -

    &#8212; is the decimal-encoded - equivalent of &mdash;.

    - - - -

    Images

    - -Admittedly, it's fairly difficult to devise a "natural" syntax for -placing images into a plain text document format. - -Markdown uses an image syntax that is intended to resemble the syntax -for links, allowing for two styles: *inline* and *reference*. - -Inline image syntax looks like this: - - ![Alt text](/path/to/img.jpg) - - ![Alt text](/path/to/img.jpg "Optional title") - -That is: - -* An exclamation mark: `!`; -* followed by a set of square brackets, containing the `alt` - attribute text for the image; -* followed by a set of parentheses, containing the URL or path to - the image, and an optional `title` attribute enclosed in double - or single quotes. - -Reference-style image syntax looks like this: - - ![Alt text][id] - -Where "id" is the name of a defined image reference. Image references -are defined using syntax identical to link references: - - [id]: url/to/image "Optional title attribute" - -As of this writing, Markdown has no syntax for specifying the -dimensions of an image; if this is important to you, you can simply -use regular HTML `` tags. - - -* * * - - -

    Miscellaneous

    - - - -Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: - - - -Markdown will turn this into: - - http://example.com/ - -Automatic links for email addresses work similarly, except that -Markdown will also perform a bit of randomized decimal and hex -entity-encoding to help obscure your address from address-harvesting -spambots. For example, Markdown will turn this: - - - -into something like this: - - address@exa - mple.com - -which will render in a browser as a clickable link to "address@example.com". - -(This sort of entity-encoding trick will indeed fool many, if not -most, address-harvesting bots, but it definitely won't fool all of -them. It's better than nothing, but an address published in this way -will probably eventually start receiving spam.) - - - -

    Backslash Escapes

    - -Markdown allows you to use backslash escapes to generate literal -characters which would otherwise have special meaning in Markdown's -formatting syntax. For example, if you wanted to surround a word with -literal asterisks (instead of an HTML `` tag), you can backslashes -before the asterisks, like this: - - \*literal asterisks\* - -Markdown provides backslash escapes for the following characters: - - \ backslash - ` backtick - * asterisk - _ underscore - {} curly braces - [] square brackets - () parentheses - # hash mark - + plus sign - - minus sign (hyphen) - . dot - ! exclamation mark - diff --git a/test/tests/nested_blockquotes.html b/test/tests/nested_blockquotes.html deleted file mode 100644 index d8ec7f8e03..0000000000 --- a/test/tests/nested_blockquotes.html +++ /dev/null @@ -1,9 +0,0 @@ -
    -

    foo

    - -
    -

    bar

    -
    - -

    foo

    -
    diff --git a/test/tests/nested_blockquotes.md b/test/tests/nested_blockquotes.md deleted file mode 100644 index ed3c624ffb..0000000000 --- a/test/tests/nested_blockquotes.md +++ /dev/null @@ -1,5 +0,0 @@ -> foo -> -> > bar -> -> foo diff --git a/test/tests/nested_code.html b/test/tests/nested_code.html deleted file mode 100644 index c370592015..0000000000 --- a/test/tests/nested_code.html +++ /dev/null @@ -1 +0,0 @@ -

    hi ther `` ok ```

    diff --git a/test/tests/nested_code.md b/test/tests/nested_code.md deleted file mode 100644 index 910e3d4628..0000000000 --- a/test/tests/nested_code.md +++ /dev/null @@ -1 +0,0 @@ -````` hi ther `` ok ``` ````` diff --git a/test/tests/nested_em.html b/test/tests/nested_em.html deleted file mode 100644 index 3ab4ec89cd..0000000000 --- a/test/tests/nested_em.html +++ /dev/null @@ -1,3 +0,0 @@ -

    test test test

    - -

    test test test

    diff --git a/test/tests/nested_em.md b/test/tests/nested_em.md deleted file mode 100644 index 550d0eb998..0000000000 --- a/test/tests/nested_em.md +++ /dev/null @@ -1,3 +0,0 @@ -*test **test** test* - -_test __test__ test_ diff --git a/test/tests/nested_square_link.html b/test/tests/nested_square_link.html deleted file mode 100644 index c8b7940831..0000000000 --- a/test/tests/nested_square_link.html +++ /dev/null @@ -1 +0,0 @@ -

    the ] character

    diff --git a/test/tests/nested_square_link.md b/test/tests/nested_square_link.md deleted file mode 100644 index 82226ed5f6..0000000000 --- a/test/tests/nested_square_link.md +++ /dev/null @@ -1 +0,0 @@ -[the `]` character](/url) diff --git a/test/tests/not_a_link.html b/test/tests/not_a_link.html deleted file mode 100644 index a01685d241..0000000000 --- a/test/tests/not_a_link.html +++ /dev/null @@ -1 +0,0 @@ -

    [test](not a link)

    diff --git a/test/tests/not_a_link.md b/test/tests/not_a_link.md deleted file mode 100644 index 26f60437df..0000000000 --- a/test/tests/not_a_link.md +++ /dev/null @@ -1 +0,0 @@ -\[test](not a link) diff --git a/test/tests/ordered_and_unordered_lists.html b/test/tests/ordered_and_unordered_lists.html deleted file mode 100644 index 3ab61229ae..0000000000 --- a/test/tests/ordered_and_unordered_lists.html +++ /dev/null @@ -1,148 +0,0 @@ -

    Unordered

    - -

    Asterisks tight:

    - -
      -
    • asterisk 1
    • -
    • asterisk 2
    • -
    • asterisk 3
    • -
    - -

    Asterisks loose:

    - -
      -
    • asterisk 1

    • -
    • asterisk 2

    • -
    • asterisk 3

    • -
    - -
    - -

    Pluses tight:

    - -
      -
    • Plus 1
    • -
    • Plus 2
    • -
    • Plus 3
    • -
    - -

    Pluses loose:

    - -
      -
    • Plus 1

    • -
    • Plus 2

    • -
    • Plus 3

    • -
    - -
    - -

    Minuses tight:

    - -
      -
    • Minus 1
    • -
    • Minus 2
    • -
    • Minus 3
    • -
    - -

    Minuses loose:

    - -
      -
    • Minus 1

    • -
    • Minus 2

    • -
    • Minus 3

    • -
    - -

    Ordered

    - -

    Tight:

    - -
      -
    1. First
    2. -
    3. Second
    4. -
    5. Third
    6. -
    - -

    and:

    - -
      -
    1. One
    2. -
    3. Two
    4. -
    5. Three
    6. -
    - -

    Loose using tabs:

    - -
      -
    1. First

    2. -
    3. Second

    4. -
    5. Third

    6. -
    - -

    and using spaces:

    - -
      -
    1. One

    2. -
    3. Two

    4. -
    5. Three

    6. -
    - -

    Multiple paragraphs:

    - -
      -
    1. Item 1, graf one.

      - -

      Item 2. graf two. The quick brown fox jumped over the lazy dog's -back.

    2. -
    3. Item 2.

    4. -
    5. Item 3.

    6. -
    - -

    Nested

    - -
      -
    • Tab -
        -
      • Tab -
          -
        • Tab
        • -
      • -
    • -
    - -

    Here's another:

    - -
      -
    1. First
    2. -
    3. Second: -
        -
      • Fee
      • -
      • Fie
      • -
      • Foe
      • -
    4. -
    5. Third
    6. -
    - -

    Same thing but with paragraphs:

    - -
      -
    1. First

    2. -
    3. Second:

      - -
        -
      • Fee
      • -
      • Fie
      • -
      • Foe
      • -
    4. -
    5. Third

    6. -
    - - -

    This was an error in Markdown 1.0.1:

    - -
      -
    • this

      - -
      • sub
      - -

      that

    • -
    diff --git a/test/tests/ordered_and_unordered_lists.md b/test/tests/ordered_and_unordered_lists.md deleted file mode 100644 index 7f3b49777f..0000000000 --- a/test/tests/ordered_and_unordered_lists.md +++ /dev/null @@ -1,131 +0,0 @@ -## Unordered - -Asterisks tight: - -* asterisk 1 -* asterisk 2 -* asterisk 3 - - -Asterisks loose: - -* asterisk 1 - -* asterisk 2 - -* asterisk 3 - -* * * - -Pluses tight: - -+ Plus 1 -+ Plus 2 -+ Plus 3 - - -Pluses loose: - -+ Plus 1 - -+ Plus 2 - -+ Plus 3 - -* * * - - -Minuses tight: - -- Minus 1 -- Minus 2 -- Minus 3 - - -Minuses loose: - -- Minus 1 - -- Minus 2 - -- Minus 3 - - -## Ordered - -Tight: - -1. First -2. Second -3. Third - -and: - -1. One -2. Two -3. Three - - -Loose using tabs: - -1. First - -2. Second - -3. Third - -and using spaces: - -1. One - -2. Two - -3. Three - -Multiple paragraphs: - -1. Item 1, graf one. - - Item 2. graf two. The quick brown fox jumped over the lazy dog's - back. - -2. Item 2. - -3. Item 3. - - - -## Nested - -* Tab - * Tab - * Tab - -Here's another: - -1. First -2. Second: - * Fee - * Fie - * Foe -3. Third - -Same thing but with paragraphs: - -1. First - -2. Second: - * Fee - * Fie - * Foe - -3. Third - - -This was an error in Markdown 1.0.1: - -* this - - * sub - - that diff --git a/test/tests/ref_paren.html b/test/tests/ref_paren.html deleted file mode 100644 index cff6977fb5..0000000000 --- a/test/tests/ref_paren.html +++ /dev/null @@ -1 +0,0 @@ -

    hi

    diff --git a/test/tests/ref_paren.md b/test/tests/ref_paren.md deleted file mode 100644 index aa97c91ae4..0000000000 --- a/test/tests/ref_paren.md +++ /dev/null @@ -1,3 +0,0 @@ -[hi] - -[hi]: /url (there) diff --git a/test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html b/test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html deleted file mode 100644 index ee7f3bff0e..0000000000 --- a/test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html +++ /dev/null @@ -1,35 +0,0 @@ -

    Absolutization of RFC 3986 URIs

    - -

    Absolute URI

    - -

    section 4.3

    - -

    Network-path reference

    - -

    section 4.2

    - -

    Absolute path

    - -

    section 4.2

    - -

    Relative path

    - -

    section 4.2

    - -

    Dot-relative path

    - -

    section 3.3

    - -

    section 3.3

    - -

    Same-document query

    - -

    section 4.4

    - -

    Same-document fragment

    - -

    section 4.4

    - -

    Empty

    - -

    section 4.2

    diff --git a/test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md b/test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md deleted file mode 100644 index 56f81820b1..0000000000 --- a/test/tests/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md +++ /dev/null @@ -1,27 +0,0 @@ -# Absolutization of RFC 3986 URIs - -## Absolute URI -[![section 4.3](http://example.com/logo)](http://example.com/) - -## Network-path reference -[![section 4.2](//example.com/logo)](//example.com/) - -## Absolute path -[![section 4.2](/path/to/img)](/path/to/content) - -## Relative path -[![section 4.2](img)](content) - -## Dot-relative path -[![section 3.3](./img)](./content) - -[![section 3.3](../img)](../content) - -## Same-document query -[![section 4.4](?type=image)](?) - -## Same-document fragment -[![section 4.4](#img)](#) - -## Empty -[section 4.2]() diff --git a/test/tests/same_bullet.html b/test/tests/same_bullet.html deleted file mode 100644 index 9220741c00..0000000000 --- a/test/tests/same_bullet.html +++ /dev/null @@ -1,5 +0,0 @@ -
      -
    • test
    • -
    • test
    • -
    • test
    • -
    diff --git a/test/tests/same_bullet.md b/test/tests/same_bullet.md deleted file mode 100644 index 27a89675ab..0000000000 --- a/test/tests/same_bullet.md +++ /dev/null @@ -1,3 +0,0 @@ -* test -+ test -- test diff --git a/test/tests/strong_and_em_together.html b/test/tests/strong_and_em_together.html deleted file mode 100644 index 71ec78c709..0000000000 --- a/test/tests/strong_and_em_together.html +++ /dev/null @@ -1,7 +0,0 @@ -

    This is strong and em.

    - -

    So is this word.

    - -

    This is strong and em.

    - -

    So is this word.

    diff --git a/test/tests/strong_and_em_together.md b/test/tests/strong_and_em_together.md deleted file mode 100644 index 95ee690dbe..0000000000 --- a/test/tests/strong_and_em_together.md +++ /dev/null @@ -1,7 +0,0 @@ -***This is strong and em.*** - -So is ***this*** word. - -___This is strong and em.___ - -So is ___this___ word. diff --git a/test/tests/tabs.html b/test/tests/tabs.html deleted file mode 100644 index 3301ba803b..0000000000 --- a/test/tests/tabs.html +++ /dev/null @@ -1,25 +0,0 @@ -
      -
    • this is a list item -indented with tabs

    • -
    • this is a list item -indented with spaces

    • -
    - -

    Code:

    - -
    this code block is indented by one tab
    -
    - -

    And:

    - -
        this code block is indented by two tabs
    -
    - -

    And:

    - -
    +   this is an example list item
    -    indented with tabs
    -
    -+   this is an example list item
    -    indented with spaces
    -
    diff --git a/test/tests/tabs.md b/test/tests/tabs.md deleted file mode 100644 index 589d1136e1..0000000000 --- a/test/tests/tabs.md +++ /dev/null @@ -1,21 +0,0 @@ -+ this is a list item - indented with tabs - -+ this is a list item - indented with spaces - -Code: - - this code block is indented by one tab - -And: - - this code block is indented by two tabs - -And: - - + this is an example list item - indented with tabs - - + this is an example list item - indented with spaces diff --git a/test/tests/text.smartypants.html b/test/tests/text.smartypants.html deleted file mode 100644 index 33718eeac9..0000000000 --- a/test/tests/text.smartypants.html +++ /dev/null @@ -1,6 +0,0 @@ -

    Hello world ‘how’ “are” you – today…

    - -

    “It’s a more ‘challenging’ smartypants test…”

    - -

    ‘And,’ as a bonus — “one -multiline” test!

    diff --git a/test/tests/text.smartypants.md b/test/tests/text.smartypants.md deleted file mode 100644 index 24e204643e..0000000000 --- a/test/tests/text.smartypants.md +++ /dev/null @@ -1,6 +0,0 @@ -Hello world 'how' "are" you -- today... - -"It's a more 'challenging' smartypants test..." - -'And,' as a bonus --- "one -multiline" test! diff --git a/test/tests/tidyness.html b/test/tests/tidyness.html deleted file mode 100644 index f2a8ce70f5..0000000000 --- a/test/tests/tidyness.html +++ /dev/null @@ -1,8 +0,0 @@ -
    -

    A list within a blockquote:

    -
      -
    • asterisk 1
    • -
    • asterisk 2
    • -
    • asterisk 3
    • -
    -
    diff --git a/test/tests/tidyness.md b/test/tests/tidyness.md deleted file mode 100644 index 5f18b8da21..0000000000 --- a/test/tests/tidyness.md +++ /dev/null @@ -1,5 +0,0 @@ -> A list within a blockquote: -> -> * asterisk 1 -> * asterisk 2 -> * asterisk 3 diff --git a/test/tests/toplevel_paragraphs.gfm.html b/test/tests/toplevel_paragraphs.gfm.html deleted file mode 100644 index d15bfccef0..0000000000 --- a/test/tests/toplevel_paragraphs.gfm.html +++ /dev/null @@ -1,34 +0,0 @@ -

    hello world - text after spaces - text after spaces

    - -

    paragraph before code

    -
    text inside block code
    - -

    paragraph before hr

    -
    - -

    paragraph before head with hash

    -

    how are you

    - -

    paragraph before head with equals

    -

    how are you

    - -

    paragraph before blockquote

    -

    text for blockquote

    - -

    paragraph before list

    -
    • text inside list
    - -

    paragraph before div

    -
    text inside div
    - -

    paragraph with span -text inside span

    - -

    hello world -

    - -
    hello
    - -

    hello

    diff --git a/test/tests/toplevel_paragraphs.gfm.md b/test/tests/toplevel_paragraphs.gfm.md deleted file mode 100644 index 8430b9f86c..0000000000 --- a/test/tests/toplevel_paragraphs.gfm.md +++ /dev/null @@ -1,38 +0,0 @@ -hello world - text after spaces - text after spaces - -paragraph before code -``` -text inside block code -``` - -paragraph before hr -* * * - -paragraph before head with hash -# how are you - -paragraph before head with equals -how are you -=========== - -paragraph before blockquote -> text for blockquote - -paragraph before list -* text inside list - -paragraph before div -
    text inside div
    - -paragraph with span -text inside span - -hello [world][how] - -[how]: /are/you - -
    hello
    - -hello diff --git a/test/tests/tricky_list.html b/test/tests/tricky_list.html deleted file mode 100644 index 764a3352be..0000000000 --- a/test/tests/tricky_list.html +++ /dev/null @@ -1,23 +0,0 @@ -

    hello world

    - -
      -
    • hello world
    • -
    - -

    hello world

    - -
      -
    • hello world
    • -
    - -

    hello world

    - -
      -
    • Hello world
    • -
    - -

    hello world

    - -
      -
    • hello world
    • -
    diff --git a/test/tests/tricky_list.md b/test/tests/tricky_list.md deleted file mode 100644 index 9aa76ceb9f..0000000000 --- a/test/tests/tricky_list.md +++ /dev/null @@ -1,15 +0,0 @@ -**hello** _world_ - -* hello world - -**hello** _world_ - -* hello world - -**hello** _world_ - -* Hello world - -**hello** _world_ - -* hello world diff --git a/test/tests/uppercase_hex.sanitize.html b/test/tests/uppercase_hex.sanitize.html deleted file mode 100644 index 15b722bfe9..0000000000 --- a/test/tests/uppercase_hex.sanitize.html +++ /dev/null @@ -1,2 +0,0 @@ -

    lowerlower -upperupper

    diff --git a/test/tests/uppercase_hex.sanitize.md b/test/tests/uppercase_hex.sanitize.md deleted file mode 100644 index bea65b9b82..0000000000 --- a/test/tests/uppercase_hex.sanitize.md +++ /dev/null @@ -1,2 +0,0 @@ -lower[click me](javascript:...)lower -upper[click me](javascript:...)upper From 31005193a7b67fcfe87533a259c0254d3dc05a22 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 2 Jan 2018 13:53:05 -0600 Subject: [PATCH 044/308] always "fix" tests before testing --- test/index.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/test/index.js b/test/index.js index 3a350398f5..142582f28f 100644 --- a/test/index.js +++ b/test/index.js @@ -101,7 +101,7 @@ main: }); flags.forEach(function(key) { var val = true; - if(key.indexOf('=') !== -1) { + if (key.indexOf('=') !== -1) { val = decodeURIComponent(key.substring(key.indexOf('=') + 1)); key = key.substring(0, key.indexOf('=')); } else if (key.indexOf('no') === 0) { @@ -117,7 +117,7 @@ main: try { text = engine(file.text).replace(/\s/g, ''); html = file.html.replace(/\s/g, ''); - } catch(e) { + } catch (e) { console.log('%s failed.', filename); throw e; } @@ -319,7 +319,7 @@ function time(options) { * conformance. */ -function fix(options) { +function fix() { ['tests', 'original', 'new'].forEach(function(dir) { try { fs.mkdirSync(path.resolve(__dirname, dir), 0755); @@ -449,7 +449,13 @@ function parseArg(argv) { case '-f': case '--fix': case 'fix': - options.fix = true; + if (options.fix !== false) { + options.fix = true; + } + break; + case '--no-fix': + case 'no-fix': + options.fix = false; break; case '-b': case '--bench': @@ -465,7 +471,7 @@ function parseArg(argv) { break; default: if (arg.indexOf('--') === 0) { - opt = camelize(arg.replace(/^--(no-)?/, '')); + var opt = camelize(arg.replace(/^--(no-)?/, '')); if (!marked.defaults.hasOwnProperty(opt)) { continue; } @@ -506,8 +512,12 @@ function camelize(text) { function main(argv) { var opt = parseArg(); + if (opt.fix !== false) { + fix(); + } + if (opt.fix) { - return fix(opt); + return; } if (opt.bench) { From 951f2c391696f3937b2895c86eae01e1b52ef8ac Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Tue, 2 Jan 2018 13:57:24 -0600 Subject: [PATCH 045/308] change folder name to compiled_tests --- .gitignore | 2 +- test/index.js | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 8f7082c4f5..14a781d96f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ node_modules/ -test/tests +test/compiled_tests diff --git a/test/index.js b/test/index.js index 142582f28f..9b2469bfb4 100644 --- a/test/index.js +++ b/test/index.js @@ -19,7 +19,7 @@ var fs = require('fs') */ function load() { - var dir = __dirname + '/tests' + var dir = __dirname + '/compiled_tests' , files = {} , list , file @@ -320,7 +320,7 @@ function time(options) { */ function fix() { - ['tests', 'original', 'new'].forEach(function(dir) { + ['compiled_tests', 'original', 'new'].forEach(function(dir) { try { fs.mkdirSync(path.resolve(__dirname, dir), 0755); } catch (e) { @@ -329,8 +329,8 @@ function fix() { }); // rm -rf tests - fs.readdirSync(path.resolve(__dirname, 'tests')).forEach(function(file) { - fs.unlinkSync(path.resolve(__dirname, 'tests', file)); + fs.readdirSync(path.resolve(__dirname, 'compiled_tests')).forEach(function(file) { + fs.unlinkSync(path.resolve(__dirname, 'compiled_tests', file)); }); // cp -r original tests @@ -339,12 +339,12 @@ function fix() { if (file.indexOf('hard_wrapped_paragraphs_with_list_like_lines.') === 0) { nfile = file.replace(/([^.]+)$/, 'nogfm.$1'); } - fs.writeFileSync(path.resolve(__dirname, 'tests', nfile), + fs.writeFileSync(path.resolve(__dirname, 'compiled_tests', nfile), fs.readFileSync(path.resolve(__dirname, 'original', file))); }); // node fix.js - var dir = __dirname + '/tests'; + var dir = __dirname + '/compiled_tests'; fs.readdirSync(dir).filter(function(file) { return path.extname(file) === '.html'; @@ -400,7 +400,7 @@ function fix() { // cp new/* tests/ fs.readdirSync(path.resolve(__dirname, 'new')).forEach(function(file) { - fs.writeFileSync(path.resolve(__dirname, 'tests', file), + fs.writeFileSync(path.resolve(__dirname, 'compiled_tests', file), fs.readFileSync(path.resolve(__dirname, 'new', file))); }); } From 1949dfdf21dc04a3d76c9f79b95895aa6c55631a Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Wed, 3 Jan 2018 01:54:49 +0100 Subject: [PATCH 046/308] handle escaped brackets in link description --- lib/marked.js | 2 +- test/tests/links_inline_style.html | 14 ++++++++++++++ test/tests/links_inline_style.text | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 6f0e87c4c5..3590ae2655 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -459,7 +459,7 @@ var inline = { text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; inline.link = replace(inline.link) diff --git a/test/tests/links_inline_style.html b/test/tests/links_inline_style.html index 09df236ed7..04921aa080 100644 --- a/test/tests/links_inline_style.html +++ b/test/tests/links_inline_style.html @@ -13,3 +13,17 @@

    URL and title.

    Empty.

    + +

    Now some links with special link text.

    + +

    hello [ ok

    + +

    hello [] with balanced brackets

    + +

    hello! [ ] with escaped balanced brackets

    + +

    hello \ with a backslash

    + +

    link w/ escaped back\slash

    + +

    link w/ back\slash\

    \ No newline at end of file diff --git a/test/tests/links_inline_style.text b/test/tests/links_inline_style.text index 8c8eb4902e..6a94265871 100644 --- a/test/tests/links_inline_style.text +++ b/test/tests/links_inline_style.text @@ -13,3 +13,17 @@ Just a [URL](/url/). [URL and title]( /url/has space/ "url has space and title"). [Empty](). + +Now some links with special link text. + +[hello \[ ok](http://abc.com) + +[hello [] with balanced brackets](http://abc.com) + +[hello! \[ \] with escaped balanced brackets](http://abc.com) + +[hello \ with a backslash](http://abc.com) + +[link w/ escaped back\\slash](http://abc.com) + +[link w/ back\\slash\\](http://abc.com) \ No newline at end of file From 9afd4f15fe582930c66cc2781b3fb783376a187a Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 23 Dec 2017 13:04:10 -0500 Subject: [PATCH 047/308] 0.3.10 --- 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 87347086a8..5e3a1238e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "marked", - "version": "0.3.9", + "version": "0.3.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 13a9a88fab..2fe344f3be 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.9", + "version": "0.3.10", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", From 14fca790fca4f18f004ac8f537b07b0a8c5c09bb Mon Sep 17 00:00:00 2001 From: Kara Leary Date: Fri, 5 Jan 2018 06:19:25 -1000 Subject: [PATCH 048/308] add 'use strict' to top of function --- lib/marked.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/marked.js b/lib/marked.js index 3eb1f9dfca..045d17afe3 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -5,6 +5,7 @@ */ ;(function() { +'use strict'; /** * Block-Level Grammar From 94ba508891da6f320d06d4fa8068e54122f6e138 Mon Sep 17 00:00:00 2001 From: Dominik Wilkowski Date: Sat, 6 Jan 2018 11:49:04 +1100 Subject: [PATCH 049/308] Added missing `text` render function to documentation --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 68bb9204f6..88f243e64d 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,7 @@ This code will output the following HTML: - del(*string* text) - link(*string* href, *string* title, *string* text) - image(*string* href, *string* title, *string* text) +- text(*string* text) ### gfm From 9027cc6053cbfbfb50540640899f6e6b88bd50f6 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 5 Jan 2018 23:43:00 -0500 Subject: [PATCH 050/308] 0.3.11 --- 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 5e3a1238e5..13e75d3673 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "marked", - "version": "0.3.10", + "version": "0.3.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2fe344f3be..b58c378c6a 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.10", + "version": "0.3.11", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", From a09441aef62f50e3c35dc7e6db7093454fd19490 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 5 Jan 2018 23:43:05 -0500 Subject: [PATCH 051/308] 0.3.12 --- 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 13e75d3673..c3ce3c2c90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "marked", - "version": "0.3.11", + "version": "0.3.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b58c378c6a..e984ccaaaa 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.11", + "version": "0.3.12", "main": "./lib/marked.js", "bin": "./bin/marked", "man": "./man/marked.1", From 52bfc9c4db6755edc6f59d0857c07ba662d6a05d Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 6 Jan 2018 01:11:16 -0600 Subject: [PATCH 052/308] use front-matter for test options --- package-lock.json | 40 +++++++++++++++++++ package.json | 1 + test/index.js | 36 ++++++++--------- .../{gfm_break.breaks.html => gfm_break.html} | 0 .../new/{gfm_break.breaks.md => gfm_break.md} | 3 ++ ...{gfm_hashtag.gfm.html => gfm_hashtag.html} | 0 .../{gfm_hashtag.gfm.md => gfm_hashtag.md} | 3 ++ test/new/{links.sanitize.html => links.html} | 0 test/new/{links.sanitize.md => links.md} | 5 ++- ...sanatize.nomangle.html => mangle_xss.html} | 0 ...xss.sanatize.nomangle.md => mangle_xss.md} | 4 ++ ..._hashtag.nogfm.html => nogfm_hashtag.html} | 0 ...{gfm_hashtag.nogfm.md => nogfm_hashtag.md} | 3 ++ ...Ecom%2Fbase%2F.html => relative_urls.html} | 0 ...le%2Ecom%2Fbase%2F.md => relative_urls.md} | 3 ++ ...text.smartypants.html => smartypants.html} | 0 .../{text.smartypants.md => smartypants.md} | 3 ++ ...aphs.gfm.html => toplevel_paragraphs.html} | 0 ...ragraphs.gfm.md => toplevel_paragraphs.md} | 3 ++ ...e_hex.sanitize.html => uppercase_hex.html} | 0 ...rcase_hex.sanitize.md => uppercase_hex.md} | 3 ++ 21 files changed, 87 insertions(+), 20 deletions(-) rename test/new/{gfm_break.breaks.html => gfm_break.html} (100%) rename test/new/{gfm_break.breaks.md => gfm_break.md} (60%) rename test/new/{gfm_hashtag.gfm.html => gfm_hashtag.html} (100%) rename test/new/{gfm_hashtag.gfm.md => gfm_hashtag.md} (63%) rename test/new/{links.sanitize.html => links.html} (100%) rename test/new/{links.sanitize.md => links.md} (87%) rename test/new/{mangle_xss.sanatize.nomangle.html => mangle_xss.html} (100%) rename test/new/{mangle_xss.sanatize.nomangle.md => mangle_xss.md} (63%) rename test/new/{gfm_hashtag.nogfm.html => nogfm_hashtag.html} (100%) rename test/new/{gfm_hashtag.nogfm.md => nogfm_hashtag.md} (62%) rename test/new/{relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html => relative_urls.html} (100%) rename test/new/{relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md => relative_urls.md} (92%) rename test/new/{text.smartypants.html => smartypants.html} (100%) rename test/new/{text.smartypants.md => smartypants.md} (83%) rename test/new/{toplevel_paragraphs.gfm.html => toplevel_paragraphs.html} (100%) rename test/new/{toplevel_paragraphs.gfm.md => toplevel_paragraphs.md} (96%) rename test/new/{uppercase_hex.sanitize.html => uppercase_hex.html} (100%) rename test/new/{uppercase_hex.sanitize.md => uppercase_hex.md} (78%) diff --git a/package-lock.json b/package-lock.json index 87347086a8..3b5e916592 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,6 +39,15 @@ "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", "dev": true }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, "arr-diff": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", @@ -308,6 +317,12 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, "execa": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", @@ -472,6 +487,15 @@ "for-in": "1.0.2" } }, + "front-matter": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/front-matter/-/front-matter-2.3.0.tgz", + "integrity": "sha1-cgOviWzjV+4E4qpFFp6pHtf2dQQ=", + "dev": true, + "requires": { + "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", @@ -1014,6 +1038,16 @@ } } }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + } + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -1816,6 +1850,12 @@ "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", diff --git a/package.json b/package.json index 13a9a88fab..99aa5bef5f 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "devDependencies": { "markdown": "*", "showdown": "*", + "front-matter": "^2.3.0", "gulp": "^3.8.11", "gulp-uglify": "^1.1.0", "gulp-concat": "^2.5.2" diff --git a/test/index.js b/test/index.js index 9b2469bfb4..f6cf608bc1 100644 --- a/test/index.js +++ b/test/index.js @@ -12,6 +12,7 @@ var fs = require('fs') , path = require('path') + , fm = require('front-matter') , marked = require('../'); /** @@ -23,6 +24,7 @@ function load() { , files = {} , list , file + , content , i , l; @@ -42,8 +44,12 @@ function load() { for (; i < l; i++) { file = path.join(dir, list[i]); + content = fm(fs.readFileSync(file, 'utf8')); + + files[path.basename(file)] = { - text: fs.readFileSync(file, 'utf8'), + options: content.attributes, + text: content.body, html: fs.readFileSync(file.replace(/[^.]+$/, 'html'), 'utf8') }; } @@ -72,7 +78,7 @@ function runTests(engine, options) { , len = keys.length , filename , file - , flags + , opts , text , html , j @@ -86,30 +92,22 @@ main: for (; i < len; i++) { filename = keys[i]; file = files[filename]; + opts = Object.keys(file.options); if (marked._original) { marked.defaults = marked._original; delete marked._original; } - flags = filename.split('.').slice(1, -1); - if (flags.length) { + if (opts.length) { marked._original = marked.defaults; marked.defaults = {}; Object.keys(marked._original).forEach(function(key) { marked.defaults[key] = marked._original[key]; }); - flags.forEach(function(key) { - var val = true; - if (key.indexOf('=') !== -1) { - val = decodeURIComponent(key.substring(key.indexOf('=') + 1)); - key = key.substring(0, key.indexOf('=')); - } else if (key.indexOf('no') === 0) { - key = key.substring(2); - val = false; - } + opts.forEach(function(key) { if (marked.defaults.hasOwnProperty(key)) { - marked.defaults[key] = val; + marked.defaults[key] = file.options[key]; } }); } @@ -335,12 +333,12 @@ function fix() { // cp -r original tests fs.readdirSync(path.resolve(__dirname, 'original')).forEach(function(file) { - var nfile = file; - if (file.indexOf('hard_wrapped_paragraphs_with_list_like_lines.') === 0) { - nfile = file.replace(/([^.]+)$/, 'nogfm.$1'); + var text = fs.readFileSync(path.resolve(__dirname, 'original', file)); + + if (file.indexOf('hard_wrapped_paragraphs_with_list_like_lines.md') === 0) { + text = "---\ngfm: false\n---\n" + text; } - fs.writeFileSync(path.resolve(__dirname, 'compiled_tests', nfile), - fs.readFileSync(path.resolve(__dirname, 'original', file))); + fs.writeFileSync(path.resolve(__dirname, 'compiled_tests', file), text); }); // node fix.js diff --git a/test/new/gfm_break.breaks.html b/test/new/gfm_break.html similarity index 100% rename from test/new/gfm_break.breaks.html rename to test/new/gfm_break.html diff --git a/test/new/gfm_break.breaks.md b/test/new/gfm_break.md similarity index 60% rename from test/new/gfm_break.breaks.md rename to test/new/gfm_break.md index 71097d23bc..5bf79a2b43 100644 --- a/test/new/gfm_break.breaks.md +++ b/test/new/gfm_break.md @@ -1,3 +1,6 @@ +--- +breaks: true +--- Look at the pretty line breaks. diff --git a/test/new/gfm_hashtag.gfm.html b/test/new/gfm_hashtag.html similarity index 100% rename from test/new/gfm_hashtag.gfm.html rename to test/new/gfm_hashtag.html diff --git a/test/new/gfm_hashtag.gfm.md b/test/new/gfm_hashtag.md similarity index 63% rename from test/new/gfm_hashtag.gfm.md rename to test/new/gfm_hashtag.md index 7656ecfd7c..5eb26bf185 100644 --- a/test/new/gfm_hashtag.gfm.md +++ b/test/new/gfm_hashtag.md @@ -1,3 +1,6 @@ +--- +gfm: true +--- #header # header1 diff --git a/test/new/links.sanitize.html b/test/new/links.html similarity index 100% rename from test/new/links.sanitize.html rename to test/new/links.html diff --git a/test/new/links.sanitize.md b/test/new/links.md similarity index 87% rename from test/new/links.sanitize.md rename to test/new/links.md index ba5d09fed7..1850be4e9f 100644 --- a/test/new/links.sanitize.md +++ b/test/new/links.md @@ -1,3 +1,6 @@ +--- +sanitize: true +--- [URL](javascript:alert) [URL](vbscript:alert) @@ -6,4 +9,4 @@ [URL](javascript:document;alert(1)) -[URL](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K) \ No newline at end of file +[URL](data:text/html;base64,PHNjcmlwdD5hbGVydCgnWFNTJyk8L3NjcmlwdD4K) diff --git a/test/new/mangle_xss.sanatize.nomangle.html b/test/new/mangle_xss.html similarity index 100% rename from test/new/mangle_xss.sanatize.nomangle.html rename to test/new/mangle_xss.html diff --git a/test/new/mangle_xss.sanatize.nomangle.md b/test/new/mangle_xss.md similarity index 63% rename from test/new/mangle_xss.sanatize.nomangle.md rename to test/new/mangle_xss.md index c44503da00..419bd124d7 100644 --- a/test/new/mangle_xss.sanatize.nomangle.md +++ b/test/new/mangle_xss.md @@ -1,3 +1,7 @@ +--- +sanatize: true +mangle: false +--- < diff --git a/test/new/gfm_hashtag.nogfm.html b/test/new/nogfm_hashtag.html similarity index 100% rename from test/new/gfm_hashtag.nogfm.html rename to test/new/nogfm_hashtag.html diff --git a/test/new/gfm_hashtag.nogfm.md b/test/new/nogfm_hashtag.md similarity index 62% rename from test/new/gfm_hashtag.nogfm.md rename to test/new/nogfm_hashtag.md index 7656ecfd7c..4b805db481 100644 --- a/test/new/gfm_hashtag.nogfm.md +++ b/test/new/nogfm_hashtag.md @@ -1,3 +1,6 @@ +--- +gfm: false +--- #header # header1 diff --git a/test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html b/test/new/relative_urls.html similarity index 100% rename from test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.html rename to test/new/relative_urls.html diff --git a/test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md b/test/new/relative_urls.md similarity index 92% rename from test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md rename to test/new/relative_urls.md index 56f81820b1..5ced8915af 100644 --- a/test/new/relative_urls.baseUrl=http%3A%2F%2Fexample%2Ecom%2Fbase%2F.md +++ b/test/new/relative_urls.md @@ -1,3 +1,6 @@ +--- +baseUrl: "http://example.com/base/" +--- # Absolutization of RFC 3986 URIs ## Absolute URI diff --git a/test/new/text.smartypants.html b/test/new/smartypants.html similarity index 100% rename from test/new/text.smartypants.html rename to test/new/smartypants.html diff --git a/test/new/text.smartypants.md b/test/new/smartypants.md similarity index 83% rename from test/new/text.smartypants.md rename to test/new/smartypants.md index 24e204643e..6922554605 100644 --- a/test/new/text.smartypants.md +++ b/test/new/smartypants.md @@ -1,3 +1,6 @@ +--- +smartypants: true +--- Hello world 'how' "are" you -- today... "It's a more 'challenging' smartypants test..." diff --git a/test/new/toplevel_paragraphs.gfm.html b/test/new/toplevel_paragraphs.html similarity index 100% rename from test/new/toplevel_paragraphs.gfm.html rename to test/new/toplevel_paragraphs.html diff --git a/test/new/toplevel_paragraphs.gfm.md b/test/new/toplevel_paragraphs.md similarity index 96% rename from test/new/toplevel_paragraphs.gfm.md rename to test/new/toplevel_paragraphs.md index 8430b9f86c..de29be7557 100644 --- a/test/new/toplevel_paragraphs.gfm.md +++ b/test/new/toplevel_paragraphs.md @@ -1,3 +1,6 @@ +--- +gfm: true +--- hello world text after spaces text after spaces diff --git a/test/new/uppercase_hex.sanitize.html b/test/new/uppercase_hex.html similarity index 100% rename from test/new/uppercase_hex.sanitize.html rename to test/new/uppercase_hex.html diff --git a/test/new/uppercase_hex.sanitize.md b/test/new/uppercase_hex.md similarity index 78% rename from test/new/uppercase_hex.sanitize.md rename to test/new/uppercase_hex.md index bea65b9b82..b4b228ab6a 100644 --- a/test/new/uppercase_hex.sanitize.md +++ b/test/new/uppercase_hex.md @@ -1,2 +1,5 @@ +--- +sanitize: true +--- lower[click me](javascript:...)lower upper[click me](javascript:...)upper From 9e0ec53ebb9fa19b9d7a26640d92ffc70203a917 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 6 Jan 2018 01:16:46 -0600 Subject: [PATCH 053/308] fix bench --- test/index.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/test/index.js b/test/index.js index f6cf608bc1..276251daf0 100644 --- a/test/index.js +++ b/test/index.js @@ -254,24 +254,11 @@ function runBench(options) { } bench('marked (pedantic)', marked); - // robotskirt - try { - bench('robotskirt', (function() { - var rs = require('robotskirt'); - return function(text) { - var parser = rs.Markdown.std(); - return parser.render(text); - }; - })()); - } catch (e) { - console.log('Could not bench robotskirt.'); - } - // showdown try { bench('showdown (reuse converter)', (function() { var Showdown = require('showdown'); - var convert = new Showdown.converter(); + var convert = new Showdown.Converter(); return function(text) { return convert.makeHtml(text); }; @@ -279,7 +266,7 @@ function runBench(options) { bench('showdown (new converter)', (function() { var Showdown = require('showdown'); return function(text) { - var convert = new Showdown.converter(); + var convert = new Showdown.Converter(); return convert.makeHtml(text); }; })()); From e5571beb525396597b7d08c6c20bd7f6dfd802c7 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 6 Jan 2018 01:19:43 -0600 Subject: [PATCH 054/308] linting --- test/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index 276251daf0..42f0a8266a 100644 --- a/test/index.js +++ b/test/index.js @@ -323,7 +323,7 @@ function fix() { var text = fs.readFileSync(path.resolve(__dirname, 'original', file)); if (file.indexOf('hard_wrapped_paragraphs_with_list_like_lines.md') === 0) { - text = "---\ngfm: false\n---\n" + text; + text = '---\ngfm: false\n---\n' + text; } fs.writeFileSync(path.resolve(__dirname, 'compiled_tests', file), text); }); From 03f510d5b719b5869d16e9ba2790062328c6445a Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 6 Jan 2018 01:44:10 -0600 Subject: [PATCH 055/308] add markdown-it to bench --- package-lock.json | 40 ++++++++++++++++++++++++++++++++++++++++ package.json | 1 + test/index.js | 22 +++++++++++++++++++++- 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 3b5e916592..9aa6dcc8c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -311,6 +311,12 @@ "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", @@ -1089,6 +1095,15 @@ "resolve": "1.5.0" } }, + "linkify-it": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.0.3.tgz", + "integrity": "sha1-2UpGSPmxwXnWT6lykSaL22zpQ08=", + "dev": true, + "requires": { + "uc.micro": "1.0.3" + } + }, "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", @@ -1269,6 +1284,25 @@ "nopt": "2.1.2" } }, + "markdown-it": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.0.tgz", + "integrity": "sha512-tNuOCCfunY5v5uhcO2AUMArvKAyKMygX8tfup/JrgnsDqcCATQsAExBq7o5Ml9iMmO82bk6jYNLj6khcrl0JGA==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "entities": "1.1.1", + "linkify-it": "2.0.3", + "mdurl": "1.0.1", + "uc.micro": "1.0.3" + } + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", + "dev": true + }, "mem": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", @@ -1989,6 +2023,12 @@ "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", "dev": true }, + "uc.micro": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.3.tgz", + "integrity": "sha1-ftUNXg+an7ClczeSWfKndFjVAZI=", + "dev": true + }, "uglify-js": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.6.4.tgz", diff --git a/package.json b/package.json index 99aa5bef5f..1102e45861 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "devDependencies": { "markdown": "*", "showdown": "*", + "markdown-it": "*", "front-matter": "^2.3.0", "gulp": "^3.8.11", "gulp-uglify": "^1.1.0", diff --git a/test/index.js b/test/index.js index 42f0a8266a..22e5fd41bc 100644 --- a/test/index.js +++ b/test/index.js @@ -274,12 +274,32 @@ function runBench(options) { console.log('Could not bench showdown.'); } + // markdown-it + try { + bench('markdown-it', (function() { + var MarkdownIt = require('markdown-it'); + var md = new MarkdownIt(); + return function(text) { + return md.render(text); + }; + })()); + } catch (e) { + console.log('Could not bench markdown-it.'); + } + // markdown.js try { - bench('markdown.js', require('markdown').parse); + bench('markdown.js', (function() { + var markdown = require('markdown').markdown; + return function(text) { + return markdown.toHTML(text); + }; + })()); } catch (e) { console.log('Could not bench markdown.js.'); } + + return true; } /** From 26de4f1298c296f61563bb96d648a394ffaf0446 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 6 Jan 2018 01:44:32 -0600 Subject: [PATCH 056/308] fix octal literal --- test/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index 22e5fd41bc..bc33c0dfe9 100644 --- a/test/index.js +++ b/test/index.js @@ -327,7 +327,7 @@ function time(options) { function fix() { ['compiled_tests', 'original', 'new'].forEach(function(dir) { try { - fs.mkdirSync(path.resolve(__dirname, dir), 0755); + fs.mkdirSync(path.resolve(__dirname, dir), 0o755); } catch (e) { ; } From 253d97587a0f9962bc0b21dbe6dc7a6740cccb63 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 6 Jan 2018 01:52:59 -0600 Subject: [PATCH 057/308] update readme with new bench --- README.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 68bb9204f6..ca1b811f04 100644 --- a/README.md +++ b/README.md @@ -325,19 +325,15 @@ node v0.8.x ``` bash $ node test --bench -marked completed in 3411ms. -marked (gfm) completed in 3727ms. -marked (pedantic) completed in 3201ms. -robotskirt completed in 808ms. -showdown (reuse converter) completed in 11954ms. -showdown (new converter) completed in 17774ms. -markdown-js completed in 17191ms. +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. ``` -__Marked is now faster than Discount, which is written in C.__ - -For those feeling skeptical: These benchmarks run the entire markdown test suite 1000 times. The test suite tests every feature. It doesn't cater to specific aspects. - ### Pro level You also have direct access to the lexer and parser if you so desire. From 59846d973316055b2ed4ff61840ee1d23bfa5ec0 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 6 Jan 2018 01:54:16 -0600 Subject: [PATCH 058/308] update texting description --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ca1b811f04..8c9ae42aab 100644 --- a/README.md +++ b/README.md @@ -321,10 +321,10 @@ features][gfmf]. ## Benchmarks -node v0.8.x +node v8.9.4 ``` bash -$ node test --bench +$ npm run bench marked completed in 3408ms. marked (gfm) completed in 3465ms. marked (pedantic) completed in 3032ms. @@ -368,23 +368,23 @@ suite. If you're adding a new feature, be sure to add your own test. 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. `test/tests` houses both types of tests after they have been -combined and moved/generated by running `node test --fix` or `marked --test ---fix`. +markdown.pl tests. -In other words, if you have a test to add, add it to `test/new/` and then -regenerate the tests with `node test --fix`. Commit the result. If your test +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 `.nogfm` to the filename. So, `my-test.text` becomes -`my-test.nogfm.text`. You can do this with any marked option. Say you want -line breaks and smartypants enabled, your filename should be: -`my-test.breaks.smartypants.text`. +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 -cd marked/ -node test +npm run test ``` ### Contribution and License Agreement From b61af2a2c30650511dfa23ae54adbc6d17f9b827 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 6 Jan 2018 10:46:21 -0600 Subject: [PATCH 059/308] clean up --- test/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index bc33c0dfe9..9a79ab27fa 100644 --- a/test/index.js +++ b/test/index.js @@ -342,9 +342,10 @@ function fix() { fs.readdirSync(path.resolve(__dirname, 'original')).forEach(function(file) { var text = fs.readFileSync(path.resolve(__dirname, 'original', file)); - if (file.indexOf('hard_wrapped_paragraphs_with_list_like_lines.md') === 0) { + if (file === 'hard_wrapped_paragraphs_with_list_like_lines.md') { text = '---\ngfm: false\n---\n' + text; } + fs.writeFileSync(path.resolve(__dirname, 'compiled_tests', file), text); }); From 7ee001a88cf401c8bba88c8936dd918b7f2ee43e Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 6 Jan 2018 10:58:38 -0600 Subject: [PATCH 060/308] minify --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index e0c8dd0fd5..9d330d3264 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(){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 baseUrls[" "+e]||(/^[^:]+:\/*[^\/]*$/.test(e)?baseUrls[" "+e]=e+"/":baseUrls[" "+e]=e.replace(/[^\/]*$/,"")),e=baseUrls[" "+e],"//"===t.slice(0,2)?e.replace(/:[^]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^\/]*)[^]*/,"$1")+t:e+t}function h(){}function a(e){for(var t,n,r=1;rAn error occured:

    "+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._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""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return""}this.options.baseUrl&&!originIndependentUrl.test(e)&&(e=o(this.options.baseUrl,e));var l='
    "},n.prototype.image=function(e,t,n){this.options.baseUrl&&!originIndependentUrl.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._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 Date: Sat, 6 Jan 2018 11:56:47 -0600 Subject: [PATCH 061/308] clean up --- README.md | 2 +- test/index.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5450d26f25..8cfec5cc35 100644 --- a/README.md +++ b/README.md @@ -374,7 +374,7 @@ 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 +your `.md` file ``` yml --- diff --git a/test/index.js b/test/index.js index 9a79ab27fa..91916d9883 100644 --- a/test/index.js +++ b/test/index.js @@ -46,7 +46,6 @@ function load() { file = path.join(dir, list[i]); content = fm(fs.readFileSync(file, 'utf8')); - files[path.basename(file)] = { options: content.attributes, text: content.body, @@ -418,6 +417,7 @@ function fix() { function parseArg(argv) { var argv = process.argv.slice(2) , options = {} + , opt = "" , orphans = [] , arg; @@ -477,7 +477,7 @@ function parseArg(argv) { break; default: if (arg.indexOf('--') === 0) { - var opt = camelize(arg.replace(/^--(no-)?/, '')); + opt = camelize(arg.replace(/^--(no-)?/, '')); if (!marked.defaults.hasOwnProperty(opt)) { continue; } @@ -523,6 +523,7 @@ function main(argv) { } if (opt.fix) { + // only run fix return; } From 33b8848964111dd254d230b4502d98f0b5933fc7 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 6 Jan 2018 14:59:21 -0600 Subject: [PATCH 062/308] add error message on bench --- test/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/index.js b/test/index.js index 91916d9883..26f3952296 100644 --- a/test/index.js +++ b/test/index.js @@ -270,7 +270,7 @@ function runBench(options) { }; })()); } catch (e) { - console.log('Could not bench showdown.'); + console.log('Could not bench showdown. (Error: %s)', e.message); } // markdown-it @@ -283,7 +283,7 @@ function runBench(options) { }; })()); } catch (e) { - console.log('Could not bench markdown-it.'); + console.log('Could not bench markdown-it. (Error: %s)', e.message); } // markdown.js @@ -295,7 +295,7 @@ function runBench(options) { }; })()); } catch (e) { - console.log('Could not bench markdown.js.'); + console.log('Could not bench markdown.js. (Error: %s)', e.message); } return true; From bf4022e00d955084c7194df63f9bda1b140393ef Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 6 Jan 2018 21:09:49 -0600 Subject: [PATCH 063/308] sort tests --- test/index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/index.js b/test/index.js index 26f3952296..62b7879620 100644 --- a/test/index.js +++ b/test/index.js @@ -33,11 +33,7 @@ function load() { .filter(function(file) { return path.extname(file) !== '.html'; }) - .sort(function(a, b) { - a = path.basename(a).toLowerCase().charCodeAt(0); - b = path.basename(b).toLowerCase().charCodeAt(0); - return a > b ? 1 : (a < b ? -1 : 0); - }); + .sort(); i = 0; l = list.length; From 774797803594cb94827d8001680eccc79c58a558 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sun, 7 Jan 2018 11:25:24 -0600 Subject: [PATCH 064/308] enable only certain tests --- package-lock.json | 6 +++ package.json | 1 + test/index.js | 121 ++++++++++++++++++++++++++++++---------------- 3 files changed, 85 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0e80c2b576..47df7524bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -598,6 +598,12 @@ } } }, + "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", diff --git a/package.json b/package.json index 83ec18d84d..3a2177996a 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "showdown": "*", "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" diff --git a/test/index.js b/test/index.js index 62b7879620..25af4c713a 100644 --- a/test/index.js +++ b/test/index.js @@ -13,20 +13,32 @@ var fs = require('fs') , path = require('path') , fm = require('front-matter') + , g2r = require('glob-to-regexp') , marked = require('../'); /** * Load Tests */ -function load() { +function load(options) { var dir = __dirname + '/compiled_tests' , files = {} , list , file + , name , content + , regex + , skip + , enabled = options.enabled || [] , i - , l; + , j + , l + , el = enabled.length; + + + for (i = 0; i < el; i++) { + enabled[i] = g2r(enabled[i]); + } list = fs .readdirSync(dir) @@ -35,18 +47,53 @@ function load() { }) .sort(); - i = 0; l = list.length; - for (; i < l; i++) { - file = path.join(dir, list[i]); - content = fm(fs.readFileSync(file, 'utf8')); + for (i = 0; i < l; i++) { + name = path.basename(list[i]); + if (el > 0) { + skip = true; + for (j = 0; j < el; j++) { + if (enabled[j].test(name)) { + skip = false; + break; + } + } + } else { + skip = false; + } + if (!skip) { + file = path.join(dir, list[i]); + content = fm(fs.readFileSync(file, 'utf8')); + + files[name] = { + options: content.attributes, + text: content.body, + html: fs.readFileSync(file.replace(/[^.]+$/, 'html'), 'utf8') + }; + } + } + + if (options.bench || options.time) { + if (!options.enabled || options.enabled.length === 0) { + // Change certain tests to allow + // comparison to older benchmark times. + fs.readdirSync(__dirname + '/new').forEach(function(name) { + if (path.extname(name) === '.html') return; + if (name === 'main.md') return; + delete files[name]; + }); + } - files[path.basename(file)] = { - options: content.attributes, - text: content.body, - html: fs.readFileSync(file.replace(/[^.]+$/, 'html'), 'utf8') - }; + if (files['backslash_escapes.md']) { + files['backslash_escapes.md'] = { + text: 'hello world \\[how](are you) today' + }; + } + + if (files['main.md']) { + files['main.md'].text = files['main.md'].text.replace('* * *\n\n', ''); + } } return files; @@ -64,7 +111,7 @@ function runTests(engine, options) { var engine = engine || marked , options = options || {} - , files = options.files || load() + , files = options.files || load(options) , complete = 0 , failed = 0 , failures = [] @@ -160,27 +207,7 @@ main: * Benchmark a function */ -function bench(name, func) { - var files = bench.files || load(); - - if (!bench.files) { - bench.files = files; - - // Change certain tests to allow - // comparison to older benchmark times. - fs.readdirSync(__dirname + '/new').forEach(function(name) { - if (path.extname(name) === '.html') return; - if (name === 'main.md') return; - delete files[name]; - }); - - files['backslash_escapes.md'] = { - text: 'hello world \\[how](are you) today' - }; - - files['main.md'].text = files['main.md'].text.replace('* * *\n\n', ''); - } - +function bench(name, files, func) { var start = Date.now() , times = 1000 , keys = Object.keys(files) @@ -205,7 +232,8 @@ function bench(name, func) { */ function runBench(options) { - var options = options || {}; + var options = options || {} + , files = load(options); // Non-GFM, Non-pedantic marked.setOptions({ @@ -219,7 +247,7 @@ function runBench(options) { if (options.marked) { marked.setOptions(options.marked); } - bench('marked', marked); + bench('marked', files, marked); // GFM marked.setOptions({ @@ -233,7 +261,7 @@ function runBench(options) { if (options.marked) { marked.setOptions(options.marked); } - bench('marked (gfm)', marked); + bench('marked (gfm)', files, marked); // Pedantic marked.setOptions({ @@ -247,18 +275,18 @@ function runBench(options) { if (options.marked) { marked.setOptions(options.marked); } - bench('marked (pedantic)', marked); + bench('marked (pedantic)', files, marked); // showdown try { - bench('showdown (reuse converter)', (function() { + bench('showdown (reuse converter)', files, (function() { var Showdown = require('showdown'); var convert = new Showdown.Converter(); return function(text) { return convert.makeHtml(text); }; })()); - bench('showdown (new converter)', (function() { + bench('showdown (new converter)', files, (function() { var Showdown = require('showdown'); return function(text) { var convert = new Showdown.Converter(); @@ -271,7 +299,7 @@ function runBench(options) { // markdown-it try { - bench('markdown-it', (function() { + bench('markdown-it', files, (function() { var MarkdownIt = require('markdown-it'); var md = new MarkdownIt(); return function(text) { @@ -284,7 +312,7 @@ function runBench(options) { // markdown.js try { - bench('markdown.js', (function() { + bench('markdown.js', files, (function() { var markdown = require('markdown').markdown; return function(text) { return markdown.toHTML(text); @@ -302,11 +330,14 @@ function runBench(options) { */ function time(options) { - var options = options || {}; + var options = options || {} + , files = load(options); if (options.marked) { marked.setOptions(options.marked); } - bench('marked', marked); + bench('marked', files, marked); + + return true; } /** @@ -471,6 +502,10 @@ function parseArg(argv) { case '--time': options.time = true; break; + case '--': + options.enabled = argv; + argv = []; + break; default: if (arg.indexOf('--') === 0) { opt = camelize(arg.replace(/^--(no-)?/, '')); From f04e1669bd3d0becc6a4bd37d018a2cf1443ae41 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sun, 7 Jan 2018 11:31:16 -0600 Subject: [PATCH 065/308] fix test names --- test/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index 25af4c713a..ad596b8e51 100644 --- a/test/index.js +++ b/test/index.js @@ -50,7 +50,7 @@ function load(options) { l = list.length; for (i = 0; i < l; i++) { - name = path.basename(list[i]); + name = path.basename(list[i], ".md"); if (el > 0) { skip = true; for (j = 0; j < el; j++) { From 51c97590ac3e13a0754f493476fb46b0f7d54414 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sun, 7 Jan 2018 11:54:28 -0600 Subject: [PATCH 066/308] use --glob --- test/index.js | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/test/index.js b/test/index.js index ad596b8e51..c021e2b575 100644 --- a/test/index.js +++ b/test/index.js @@ -29,16 +29,10 @@ function load(options) { , content , regex , skip - , enabled = options.enabled || [] + , glob = g2r(options.glob || "*", { extended: true }) , i , j - , l - , el = enabled.length; - - - for (i = 0; i < el; i++) { - enabled[i] = g2r(enabled[i]); - } + , l; list = fs .readdirSync(dir) @@ -51,18 +45,7 @@ function load(options) { for (i = 0; i < l; i++) { name = path.basename(list[i], ".md"); - if (el > 0) { - skip = true; - for (j = 0; j < el; j++) { - if (enabled[j].test(name)) { - skip = false; - break; - } - } - } else { - skip = false; - } - if (!skip) { + if (glob.test(name)) { file = path.join(dir, list[i]); content = fm(fs.readFileSync(file, 'utf8')); @@ -75,7 +58,7 @@ function load(options) { } if (options.bench || options.time) { - if (!options.enabled || options.enabled.length === 0) { + if (!options.glob) { // Change certain tests to allow // comparison to older benchmark times. fs.readdirSync(__dirname + '/new').forEach(function(name) { @@ -502,9 +485,10 @@ function parseArg(argv) { case '--time': options.time = true; break; - case '--': - options.enabled = argv; - argv = []; + case '-g': + case '--glob': + arg = argv.shift(); + options.glob = arg.replace(/^=/, ''); break; default: if (arg.indexOf('--') === 0) { From 7b6e2ef53d4e7770ed989245e488d23a35a16cd1 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sun, 7 Jan 2018 12:20:06 -0600 Subject: [PATCH 067/308] remove -g flag --- test/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/index.js b/test/index.js index c021e2b575..defd7f3b53 100644 --- a/test/index.js +++ b/test/index.js @@ -485,7 +485,6 @@ function parseArg(argv) { case '--time': options.time = true; break; - case '-g': case '--glob': arg = argv.shift(); options.glob = arg.replace(/^=/, ''); From bff566720d2d0d5ddf997050383603b49175dcc1 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, 8 Jan 2018 19:50:03 +0200 Subject: [PATCH 068/308] Revert https://github.com/chjj/marked/commit/98ac7a43958014832788b9d01580f394c84bfb27 and https://github.com/chjj/marked/commit/a477d1d0e285e1b0aed91ea9048bc66e85324b2a --- lib/marked.js | 4 ++++ test/new/def_blocks.html | 4 +--- test/new/toplevel_paragraphs.html | 30 +++++++++++++++--------------- test/new/toplevel_paragraphs.md | 30 +++++++++++++++--------------- 4 files changed, 35 insertions(+), 33 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 3e660a684e..1e3778900b 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -40,6 +40,10 @@ 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' diff --git a/test/new/def_blocks.html b/test/new/def_blocks.html index ec0d11934d..14edc97a41 100644 --- a/test/new/def_blocks.html +++ b/test/new/def_blocks.html @@ -6,8 +6,7 @@
    -

    hello -[2]: hello

    +

    hello

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

    foo bar -[1]: foo bar

    diff --git a/test/new/toplevel_paragraphs.html b/test/new/toplevel_paragraphs.html index d15bfccef0..970c6f19f6 100644 --- a/test/new/toplevel_paragraphs.html +++ b/test/new/toplevel_paragraphs.html @@ -1,30 +1,30 @@

    hello world - text after spaces - text after spaces

    + how are you + how are you

    -

    paragraph before code

    -
    text inside block code
    +

    hello world

    +
    how are you
    -

    paragraph before hr

    +

    hello world


    -

    paragraph before head with hash

    +

    hello world

    how are you

    -

    paragraph before head with equals

    +

    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 are you

    hello world

    diff --git a/test/new/toplevel_paragraphs.md b/test/new/toplevel_paragraphs.md index de29be7557..2c17c669bf 100644 --- a/test/new/toplevel_paragraphs.md +++ b/test/new/toplevel_paragraphs.md @@ -2,35 +2,35 @@ gfm: true --- hello world - text after spaces - text after spaces + how are you + how are you -paragraph before code +hello world ``` -text inside block code +how are you ``` -paragraph before hr +hello world * * * -paragraph before head with hash +hello world # how are you -paragraph before head with equals +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 are you hello [world][how] From 39621942cbfd05e03dfd21be4e615f85258302fc Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Mon, 8 Jan 2018 19:09:48 -0500 Subject: [PATCH 069/308] Release 0.3.12 --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index 9d330d3264..a97240a82c 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._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,r,s,i="",l="";for(n="",e=0;e Date: Mon, 8 Jan 2018 19:41:33 +0100 Subject: [PATCH 070/308] generate textual manpage --- Makefile | 3 ++ man/marked.1.txt | 96 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 man/marked.1.txt diff --git a/Makefile b/Makefile index d9349f0799..7deead54c1 100644 --- a/Makefile +++ b/Makefile @@ -9,4 +9,7 @@ clean: bench: @node test --bench +man/marked.1.txt: + groff -man -Tascii man/marked.1 | col -b > man/marked.1.txt + .PHONY: clean all diff --git a/man/marked.1.txt b/man/marked.1.txt new file mode 100644 index 0000000000..7f6041927c --- /dev/null +++ b/man/marked.1.txt @@ -0,0 +1,96 @@ +marked(1) marked.js marked(1) + + + +NAME + marked - a javascript markdown parser + + +SYNOPSIS + marked [-o ] [-i ] [--help] [--tokens] [--pedantic] + [--gfm] [--breaks] [--tables] [--sanitize] [--smart-lists] [--lang-pre‐ + fix ] [--no-etc...] [--silent] [filename] + + +DESCRIPTION + marked is a full-featured javascript markdown parser, built for speed. + It also includes multiple GFM features. + + +EXAMPLES + cat in.md | marked > out.html + + echo "hello *world*" | marked + + marked -o out.html in.md --gfm + + marked --output="hello world.html" -i in.md --no-breaks + + +OPTIONS + -o, --output [output] + Specify file output. If none is specified, write to stdout. + + -i, --input [input] + Specify file input, otherwise use last argument as input file. + If no input file is specified, read from stdin. + + -t, --tokens + Output a token stream instead of html. + + --pedantic + Conform to obscure parts of markdown.pl as much as possible. + Don't fix original markdown bugs. + + --gfm Enable github flavored markdown. + + --breaks + Enable GFM line breaks. Only works with the gfm option. + + --tables + Enable GFM tables. Only works with the gfm option. + + --sanitize + Sanitize output. Ignore any HTML input. + + --smart-lists + Use smarter list behavior than the original markdown. + + --lang-prefix [prefix] + Set the prefix for code block classes. + + --mangle + Mangle email addresses. + + --no-sanitize, -no-etc... + The inverse of any of the marked options above. + + --silent + Silence error output. + + -h, --help + Display help information. + + +CONFIGURATION + For configuring and running programmatically. + + Example + + require('marked')('*foo*', { gfm: true }); + + +BUGS + Please report any bugs to https://github.com/chjj/marked. + + +LICENSE + Copyright (c) 2011-2014, Christopher Jeffrey (MIT License). + + +SEE ALSO + markdown(1), node.js(1) + + + +v0.3.1 2014-01-31 marked(1) From 823a080420229229965fba9d82fed4f627eb7d82 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Tue, 9 Jan 2018 01:17:20 +0100 Subject: [PATCH 071/308] print help message when man is unavailable --- bin/marked | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/marked b/bin/marked index 64254fc3eb..df4dcc0f7b 100755 --- a/bin/marked +++ b/bin/marked @@ -23,9 +23,13 @@ function help() { customFds: [0, 1, 2] }; - spawn('man', - [__dirname + '/../man/marked.1'], - options); + spawn('man', [__dirname + '/../man/marked.1'], options) + .on('error', function(err) { + fs.readFile(__dirname + '/../man/marked.1.txt', 'utf8', function(err, data) { + if (err) throw err; + console.log(data); + }); + }); } /** From 2c116247363c1fa46cbdb0ba93ca045dd7e29909 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Fri, 12 Jan 2018 18:02:49 +0100 Subject: [PATCH 072/308] preserve trailing newlines in code fences --- lib/marked.js | 2 +- test/new/gfm_code.html | 6 ++++++ test/new/gfm_code.md | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 39e8435689..8fc72b3a3a 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -76,7 +76,7 @@ block.normal = merge({}, block); */ block.gfm = merge({}, block.normal, { - fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/, + fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/, paragraph: /^/, heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ }); diff --git a/test/new/gfm_code.html b/test/new/gfm_code.html index 872ece776a..438acdf8eb 100644 --- a/test/new/gfm_code.html +++ b/test/new/gfm_code.html @@ -8,3 +8,9 @@

    How about a code block with only an empty line?

    
     
    + +

    With some trailing empty lines:

    +
    ciao
    +
    +
    +
    \ No newline at end of file diff --git a/test/new/gfm_code.md b/test/new/gfm_code.md index ca46c1fed1..126b8e2c75 100644 --- a/test/new/gfm_code.md +++ b/test/new/gfm_code.md @@ -24,4 +24,12 @@ How about a code block with only an empty line? ```js +``` + +With some trailing empty lines: + +``` +ciao + + ``` From b2a07608e102b4e7a164c99b9231b954a1efcec3 Mon Sep 17 00:00:00 2001 From: Federico Soave Date: Sat, 18 Oct 2014 13:04:16 +0200 Subject: [PATCH 073/308] 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 8fc72b3a3a..873427bca6 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 074/308] 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 c370592015..c28a162862 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 910e3d4628..adde417713 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 075/308] 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 8fc72b3a3a..ace6a7f857 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 076/308] 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 ace6a7f857..2134db510c 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 077/308] export TextRenderer for convenience --- lib/marked.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/marked.js b/lib/marked.js index 2134db510c..a901e6126a 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 078/308] 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 2ec1b41f21..e12da3f20a 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 079/308] 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 0000000000..6f0ae49e32 --- /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 0000000000..fa8a4d82ca --- /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 080/308] 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 8fc72b3a3a..336ab069a3 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 a97240a82c..1883d019c5 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 081/308] 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 0000000000..6fd925bafa --- /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 0000000000..6d355a8454 --- /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 082/308] 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 8fc72b3a3a..879298410d 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 083/308] 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 879298410d..e83b2a2953 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 084/308] 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 e83b2a2953..7dfdd4ee4d 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 085/308] 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 7dfdd4ee4d..01e7e00fb9 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 086/308] 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 01e7e00fb9..c311ff8b8d 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 087/308] 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 c311ff8b8d..8279692a6f 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 088/308] 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 6fd925bafa..dec397a75c 100644 --- a/test/new/cm_link_defs.html +++ b/test/new/cm_link_defs.html @@ -39,7 +39,13 @@

    Example 166

    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 6d355a8454..74684f21e5 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 089/308] 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 14edc97a41..5d8de49c04 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 4d16292987..f58fa4d37b 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 090/308] 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 970c6f19f6..d15bfccef0 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 2c17c669bf..de29be7557 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 091/308] 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 8279692a6f..caf62932a4 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 092/308] 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 caf62932a4..cbdd0ecdaa 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 093/308] 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 0000000000..363f4e218a --- /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 0000000000..95a317de44 --- /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 094/308] [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 0000000000..d3620792cf --- /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 073a5ac805..66a9089613 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 095/308] [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 d3620792cf..22caa8ec0b 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 096/308] [lint] refactor replace() with an OOP approach. ESlint is happier. --- lib/marked.js | 104 ++++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 8fc72b3a3a..173fba8943 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.paragraph = replace(block.paragraph) - ('hr', block.hr) - ('heading', block.heading) - ('lheading', block.lheading) - ('blockquote', block.blockquote) - ('tag', '<' + block._tag) - ('def', block.def) - (); +block.html = edit(block.html) + .replace('comment', //) + .replace('closed', /<(tag)[\s\S]+?<\/\1>/) + .replace('closing', /])*?>/) + .replace(/tag/g, block._tag) + .getRegex(); + +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 097/308] [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 173fba8943..537b752841 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 098/308] [lint] add eslint indent rule --- .eslintrc.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.eslintrc.json b/.eslintrc.json index 22caa8ec0b..9d6f8d521b 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 099/308] [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 537b752841..6a025d3042 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 100/308] [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 6a025d3042..ec37bcf804 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 101/308] [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 ec37bcf804..6838fe03be 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 102/308] [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 6838fe03be..0bf8fb266f 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 103/308] [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 9d6f8d521b..c1b8724027 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 104/308] [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 66a9089613..ebeea81c8c 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 105/308] 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 dec397a75c..924500245c 100644 --- a/test/new/cm_link_defs.html +++ b/test/new/cm_link_defs.html @@ -97,7 +97,7 @@

    Example 178

    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 106/308] 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 f1d66ed4f9..4ded485593 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 4f62ae1de6..26f576d6f0 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 c1336661a9..e37645db23 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 107/308] 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 0000000000..e7ae0ee416 --- /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 0000000000..a19d830c9a --- /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 108/308] 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 4ded485593..011753b619 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 109/308] 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 83a7b355d6..3abcb67f44 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 110/308] 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 26f576d6f0..8247a35ca3 100644 --- a/test/new/gfm_links.html +++ b/test/new/gfm_links.html @@ -8,3 +8,72 @@ 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 e37645db23..f66ed15191 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 111/308] 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 8247a35ca3..8752afadf2 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 @@

    Example 607

    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 f66ed15191..f5060aa79c 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 112/308] 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 011753b619..8fec4f5951 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 113/308] 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 8fec4f5951..2d2baca1e8 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 114/308] 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 2d2baca1e8..c8236e95d1 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 115/308] 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 8752afadf2..9058f2f201 100644 --- a/test/new/gfm_links.html +++ b/test/new/gfm_links.html @@ -79,4 +79,5 @@

    Example 607

    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 f5060aa79c..86b9a3eec2 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 116/308] 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 defd7f3b53..491ae6b9c0 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 117/308] 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 f1d66ed4f9..5b41192d66 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 118/308] 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 63d45eb3af..f3243b53d1 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 491ae6b9c0..e3741069f5 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 2dc2ab6565..b84ba925f6 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 1594bda27b..49bbcfad4d 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 119/308] 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 0000000000..ec3f9f7462 --- /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 0000000000..af28f8dd73 --- /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 120/308] 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 f3243b53d1..e5c275141a 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 121/308] 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 81d14163bf..7c48034805 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 ebeea81c8c..6e1aebc2c6 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 122/308] reformat text runner --- test/index.js | 234 ++++++++++++++++++++++++++------------------------ 1 file changed, 120 insertions(+), 114 deletions(-) diff --git a/test/index.js b/test/index.js index e3741069f5..80f97c0e66 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,98 +89,107 @@ 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; + success = testFile(engine, file, filename, i + 1); + if (success) { + succeeded++; + } else { + failed++; + if (options.stop) { + break; + } } + } - 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]; - } - }); - } + console.log('%d/%d tests completed successfully.', succeeded, len); + if (failed) console.log('%d/%d tests failed.', failed, len); - try { - text = engine(file.text).replace(/\s/g, ''); - html = file.html.replace(/\s/g, ''); - } catch (e) { - console.log('%s failed.', filename); - throw e; - } + return !failed; +} + +/** + * Test a file + */ - j = 0; - l = html.length; +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; + } - for (; j < l; j++) { - if (text[j] !== html[j]) { - failed++; - failures.push(filename); + 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]; + } + }); + } - text = text.substring( - Math.max(j - 30, 0), - Math.min(j + 30, text.length)); + try { + text = engine(file.text).replace(/\s/g, ''); + html = file.html.replace(/\s/g, ''); + } catch (e) { + console.log('%s failed.', filename); + throw e; + } - html = html.substring( - Math.max(j - 30, 0), - Math.min(j + 30, html.length)); + l = html.length; - console.log( - '\n#%d. %s failed at offset %d. Near: "%s".\n', - i + 1, filename, j, text); + for (j = 0; j < l; j++) { + if (text[j] !== html[j]) { + failures.push(filename); - console.log('\nGot:\n%s\n', text.trim() || text); - console.log('\nExpected:\n%s\n', html.trim() || html); + text = text.substring( + Math.max(j - 30, 0), + Math.min(j + 30, text.length)); - if (options.stop) { - break main; - } + html = html.substring( + Math.max(j - 30, 0), + Math.min(j + 30, html.length)); - continue main; - } - } + console.log( + '\n#%d. %s failed at offset %d. Near: "%s".\n', + index, filename, j, text); - complete++; - console.log('#%d. %s completed.', i + 1, filename); - } + console.log('\nGot:\n%s\n', text.trim() || text); + console.log('\nExpected:\n%s\n', html.trim() || html); - console.log('%d/%d tests completed successfully.', complete, len); - if (failed) console.log('%d/%d tests failed.', failed, len); + return false; + } + } - return !failed; + console.log('#%d. %s completed.', index, filename); + return true } /** @@ -191,13 +197,13 @@ main: */ 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 123/308] 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 1883d019c5..4e82782c69 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 124/308] set showdown version to * --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f9dff7d80..cab172dd7f 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 125/308] 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 cab172dd7f..95e8f1b509 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 126/308] 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 95e8f1b509..4b262dae5c 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 127/308] 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 4b262dae5c..8868f7f694 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 128/308] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 94ab0b9081..5b7fb71ff4 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 129/308] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 5b7fb71ff4..94ab0b9081 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 130/308] [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 80f97c0e66..5846b0dcb7 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 131/308] lint es5 code only --- .eslintrc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.json b/.eslintrc.json index 788fcfe037..7fae8d3c0e 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 132/308] [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 60d00ce140..4e21f019b4 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 133/308] [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 4e21f019b4..606dab449e 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 134/308] [ci] cache npm packages on travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 606dab449e..b37cbfa5ce 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 135/308] 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 1883d019c5..da806f0fb5 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 073a5ac805..d6529886fc 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 136/308] 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 cebc16a650..0000000000 --- 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 137/308] 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 e3741069f5..efd9f454f7 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 138/308] update package-lock.json --- package-lock.json | 1779 +-------------------------------------------- 1 file changed, 29 insertions(+), 1750 deletions(-) diff --git a/package-lock.json b/package-lock.json index 81d14163bf..eb19ea26e9 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", @@ -1299,97 +212,29 @@ "argparse": "1.0.9", "entities": "1.1.1", "linkify-it": "2.0.3", - "mdurl": "1.0.1", - "uc.micro": "1.0.3" - } - }, - "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", - "dev": true - }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "dev": true, - "requires": { - "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 - } + "mdurl": "1.0.1", + "uc.micro": "1.0.3" } }, - "multipipe": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", - "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", + "dev": true + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "dev": true, "requires": { - "duplexer2": "0.0.2" + "mimic-fn": "1.1.0" } }, - "natives": { + "mimic-fn": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz", - "integrity": "sha1-6f+EFBimsux6SV6TmYT3jxY+bjE=", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", + "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", "dev": true }, "nopt": { @@ -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=", - "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=", + "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": { - "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 139/308] require node>=0.10 in package.json --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 16f887ce69..2d7ef07380 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 140/308] 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 d5d7ee698c..8bd62bb1e1 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 cef9e376fa..54a37bc098 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 34df25741f..994b9a8aa7 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 141/308] [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 8bd62bb1e1..8820a5222f 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 142/308] !fixup 565b4a0e5b --- lib/marked.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index cf3899e5ef..ca8c314397 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 143/308] 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 0000000000..8f2d8c3587 --- /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 144/308] 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 d6529886fc..387619c47e 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 145/308] 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 eb19ea26e9..06f8efaf5e 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 387619c47e..cf32d186f3 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 146/308] 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 06f8efaf5e..79e5885daa 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 cf32d186f3..52d69a4f07 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 147/308] 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 e5c275141a..b6828d9fb8 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 148/308] remove parens --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index b6828d9fb8..69b0e05e8e 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 149/308] 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 a7b812ed61..020db880d3 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 94ab0b9081..e6e769f9d8 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

    + +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. -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. +### 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 150/308] typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e6e769f9d8..9db5cb54b4 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 151/308] 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 79e5885daa..264eb46648 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 52d69a4f07..4b1faf8dec 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 152/308] Publish lifecycle --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b1faf8dec..ee8820bcbd 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 153/308] 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 0000000000..f6789e5245 --- /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 154/308] Updating checklist --- RELEASE.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index f6789e5245..469398c199 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 155/308] 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 469398c199..f7d94bd671 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 156/308] Moving content around a bit --- RELEASE.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index f7d94bd671..c99b1c4f69 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 157/308] Ediitng --- RELEASE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index c99b1c4f69..185405727c 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 158/308] Fix typo --- RELEASE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE.md b/RELEASE.md index 185405727c..4da0981bc4 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 159/308] 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 0000000000..2b3fd9522c --- /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 4da0981bc4..7042562e43 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 160/308] 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 2b3fd9522c..7ac3428787 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 161/308] 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 7ac3428787..d81854e9c0 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 162/308] 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 d81854e9c0..7086a658f3 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) + + ## 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 0000000000..47b7ef38fd --- /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 163/308] [ci] add latest node stable to travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b37cbfa5ce..f4352ddf29 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 164/308] 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 7086a658f3..0393665c97 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 47b7ef38fd..6229a6fe09 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 165/308] 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 0393665c97..7d144dbe68 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 166/308] 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 27fbcc1a13..83a443ba41 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 7d144dbe68..a497e6167a 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 167/308] 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 6229a6fe09..0067d710f1 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 168/308] Add minify commit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ee8820bcbd..1bf7db685b 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 169/308] minify --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index 2628ed4aa4..ac09b88ad8 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 170/308] 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 29c772074e..2a83d94025 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 43eed341e1..fa76b9e1d1 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 171/308] 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 2a83d94025..311e5da5ca 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 fa76b9e1d1..5bebfb312d 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 172/308] 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 a497e6167a..c362b35090 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 0067d710f1..2ff16a7611 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 173/308] 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 2ff16a7611..09b6769a57 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 174/308] 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 c362b35090..fc0c228469 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 175/308] 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 83a443ba41..0ed5a8e6b6 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 09b6769a57..504f01b62d 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 176/308] Initial product vision --- README.md | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 9db5cb54b4..f2fb222639 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 177/308] 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 f2fb222639..8d38d5ec45 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 -``` - -or if you want to use the `marked` CLI tool (not necessary when using npm run-scripts): +**CLI:** `npm install -g marked` -``` bash -npm install -g marked -``` +**In-browser:** `npm install marked --save`

    Usage

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

    I am using markdown.

    -``` +**CLI** -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__.')); +``` bash +$ marked -o hello.html +hello world +^D +$ cat hello.html +

    hello world

    ``` -### 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 0000000000..d8e3caf235 --- /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 178/308] Table alignments --- USAGE_ADVANCED.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/USAGE_ADVANCED.md b/USAGE_ADVANCED.md index d8e3caf235..c12c22c68b 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 179/308] Table alignments --- USAGE_ADVANCED.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/USAGE_ADVANCED.md b/USAGE_ADVANCED.md index c12c22c68b..4917526e24 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 180/308] Table alignment --- USAGE_ADVANCED.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/USAGE_ADVANCED.md b/USAGE_ADVANCED.md index 4917526e24..0d2c53fe59 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 181/308] Highlight consolidated --- USAGE_ADVANCED.md | 56 +++++++---------------------------------------- 1 file changed, 8 insertions(+), 48 deletions(-) diff --git a/USAGE_ADVANCED.md b/USAGE_ADVANCED.md index 0d2c53fe59..506291afca 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 182/308] 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 0000000000..05fe966e8f --- /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 020db880d3..aa60b8b180 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 8d38d5ec45..95dfda31f3 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)); -``` - -``` js -var lexer = new marked.Lexer(options); -var tokens = lexer.lex(text); -console.log(tokens); -console.log(lexer.rules); -``` - -

    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. -``` +|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 | -### Pro level +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. -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. - -### 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:** +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. -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 506291afca..3e4ba294f0 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 0000000000..10c639400a --- /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 183/308] 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 0000000000..f98d639800 --- /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 95dfda31f3..4810b5d19b 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 192/308] Miinor update to AUTHORS --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index f98d639800..8b664059f3 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 193/308] Design principles --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d9344b6a8a..0b5254f77e 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 194/308] Typo --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0b5254f77e..3862294007 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 195/308] Add Chris's GitHub handle --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 8b664059f3..363a852738 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 196/308] Update high-level release checklist --- RELEASE.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index bfe920f4f3..89db478bab 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 197/308] 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 89db478bab..82a45d4bd3 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 198/308] 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 3862294007..f613e3c405 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 bd84c1edef..4509d2eab6 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 199/308] Add security section to README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4509d2eab6..7ce619a503 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 200/308] 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 fc0c228469..12f41fc8af 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 201/308] 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 12f41fc8af..76d86a9865 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 202/308] 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 0ed5a8e6b6..6030908329 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 203/308] 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 f613e3c405..8f05cb4796 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 19afbd9d5e..20bd13ea92 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 204/308] Typos --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f05cb4796..1d9a3d5512 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 205/308] 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 6943187722..eef4c2c1ba 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 206/308] 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 20bd13ea92..6981500fd0 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 207/308] 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 363a852738..22cfcc459b 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. + +## Contributors + +Contributors are users who submit a PR, Issue, or collaborates in making Marked a better product and experience for all the users. -## Contribution credits +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 -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): +## 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 208/308] 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 22cfcc459b..79f54a0b23 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 7ce619a503..73453c640f 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 209/308] What we're good at --- AUTHORS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 79f54a0b23..66d1604014 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 210/308] 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 994b9a8aa7..74d898d929 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 211/308] 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 f4352ddf29..8f089ff869 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 58f8394798..e336f744fa 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 212/308] 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 74d898d929..920bf3e2c8 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 213/308] 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 e336f744fa..9f8c4c1ace 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 214/308] typo --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 66d1604014..90a452fd7a 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 215/308] Expound on publishers responsibilities --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 90a452fd7a..10c8440a45 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 216/308] 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 1d9a3d5512..8e0f81282d 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 217/308] Don't need run --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e0f81282d..90e728cea9 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 218/308] 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 90e728cea9..11c99ea4ab 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 219/308] clean up --- test/index.js | 44 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/test/index.js b/test/index.js index 920bf3e2c8..c2a861c4c2 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 220/308] Update users definition --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 10c8440a45..da12fee2fb 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 221/308] grammar --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index da12fee2fb..b959e1ce6f 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 222/308] 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 5ca95941ec..a6a2bbe6a5 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 0000000000..e69de29bb2 diff --git a/test/new/redos_html_closing.md b/test/new/redos_html_closing.md new file mode 100644 index 0000000000..65bc5f7362 --- /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 0000000000..e69de29bb2 diff --git a/test/new/redos_nolink.md b/test/new/redos_nolink.md new file mode 100644 index 0000000000..a43a156820 --- /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 223/308] 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 c2a861c4c2..b1f50fccfb 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 224/308] 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 76d86a9865..b893892b78 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 504f01b62d..715f2efeb3 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 225/308] 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 11c99ea4ab..83d2548ef6 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 226/308] 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 b959e1ce6f..475ca832ee 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 227/308] 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 475ca832ee..2e7b696c96 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 228/308] 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 715f2efeb3..bf24c608e6 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 229/308] 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 2e7b696c96..297ea32f7b 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 230/308] 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 b893892b78..c8d249d996 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 bf24c608e6..8d417b7edf 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 231/308] Add snyk.io rep --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 297ea32f7b..cacc87bbc8 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 232/308] 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 8d417b7edf..998acf2244 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 233/308] Update min --- marked.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/marked.min.js b/marked.min.js index ac09b88ad8..f6c87ef620 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 234/308] fix broken link --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83d2548ef6..fe38b4b475 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 235/308] Update security section --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 73453c640f..09960f81d9 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 236/308] Add listed owners as well --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 09960f81d9..b6916eda5c 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 237/308] Update contributing --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe38b4b475..2974e2fa6b 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 238/308] Update contributing --- CONTRIBUTING.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2974e2fa6b..577ae5ea7a 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 239/308] 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 cacc87bbc8..f9de51c858 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 240/308] Add Dr. DevOps --- AUTHORS.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index f9de51c858..6a37bb78cd 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 241/308] Add GitHub Guru title --- AUTHORS.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 6a37bb78cd..00f8f470e6 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 242/308] 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 00f8f470e6..907e970427 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 243/308] Typo --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 907e970427..e95f8efcb8 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 244/308] 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 245/308] Adding more authority areas --- AUTHORS.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index e95f8efcb8..ee6461eb46 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 246/308] 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 998acf2244..e297751786 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 247/308] Remove inclusion of submitting PRs --- CONTRIBUTING.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 577ae5ea7a..fe38b4b475 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 248/308] Add @intcreator --- AUTHORS.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index ee6461eb46..f011f8c45e 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 249/308] 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 c8d249d996..0b40698182 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 250/308] 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 f011f8c45e..34d5593470 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 251/308] Expound definition of Curious Contributor --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 34d5593470..8495249695 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 252/308] Adding davisjam --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 8495249695..47f6a57a2d 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 253/308] Add Master of Marked badge --- AUTHORS.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 47f6a57a2d..6db4e2aab0 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 254/308] 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 6db4e2aab0..af6cb2d181 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 255/308] 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 af6cb2d181..09cbf23dc3 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 256/308] 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 09cbf23dc3..a404589e10 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 257/308] 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 0b40698182..e732e15d25 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 0000000000..c5a622afb9 --- /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 a404589e10..e4d21a0bb2 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 258/308] Inline anchors and minor correction --- AUTHORS.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index e4d21a0bb2..fa192018ac 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 259/308] Make new paragraph --- AUTHORS.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index fa192018ac..b3d30e6bd7 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 260/308] Minor comdey --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index b3d30e6bd7..2c3bf6b22b 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 261/308] Adding to add --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 2c3bf6b22b..584a7c2f9e 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 262/308] Make task list --- AUTHORS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 584a7c2f9e..5d156b98d8 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 263/308] Change to ordered list --- AUTHORS.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 5d156b98d8..56419cd683 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 264/308] 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 56419cd683..5d156b98d8 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 265/308] Minor grammar --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 5d156b98d8..88e7d0782b 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 266/308] Typos --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 88e7d0782b..385ffd2e1b 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 267/308] Typo --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 385ffd2e1b..d9306e83c9 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 268/308] 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 c5a622afb9..5c1577362a 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 269/308] 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 5c1577362a..f995535bb9 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 270/308] 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 e732e15d25..f0b0a1106c 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 271/308] 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 f0b0a1106c..a7c85031d2 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 272/308] 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 a7c85031d2..2e4aeab8eb 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 b1f50fccfb..73aa0a82d2 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 dce66a28494df872a713e0326c69a2d818e2ca8f Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 3 Mar 2018 21:33:02 -0600 Subject: [PATCH 283/308] 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 0000000000..f430302d4c --- /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 284/308] 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 737f86df16..b8a4702ee0 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 0000000000..6d3b9ee78c --- /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 0000000000..c30a8429dd --- /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 f430302d4c..83f4fb57a0 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 285/308] 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 c30a8429dd..65526c863c 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 286/308] 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 8f089ff869..4964bcc79e 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 73aa0a82d2..f9d7da1e7d 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 287/308] 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 6030908329..e0465a7847 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 8c0eba80d1..094b42bc0e 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 fe38b4b475..9fbb49500b 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 288/308] Fix usage links in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6916eda5c..96ee203bad 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 d4e7bb4bb1892959b9ea5511e26a7e79e2d86c5e Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Thu, 8 Mar 2018 09:30:27 -0500 Subject: [PATCH 289/308] Code of conduct (#1094) Add initial code of conduct similar to Node.js --- CODE_OF_CONDUCT.md | 71 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..3fe8c89a80 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,71 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to block temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +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 +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. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +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] From 2509660bb9eacba46b432d728392496b0a3198c7 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 11 Mar 2018 17:06:03 -0400 Subject: [PATCH 290/308] Rename doc to docs --- doc/todo.md | 2 -- {doc => docs}/broken.md | 0 2 files changed, 2 deletions(-) delete mode 100644 doc/todo.md rename {doc => docs}/broken.md (100%) diff --git a/doc/todo.md b/doc/todo.md deleted file mode 100644 index 2e60b162ae..0000000000 --- a/doc/todo.md +++ /dev/null @@ -1,2 +0,0 @@ -# Todo - diff --git a/doc/broken.md b/docs/broken.md similarity index 100% rename from doc/broken.md rename to docs/broken.md From 94b8b3e1b168ce0b4369043997eace9a80ff87a9 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 11 Mar 2018 17:16:48 -0400 Subject: [PATCH 291/308] Move existing docs to /docs dir --- .github/PULL_REQUEST_TEMPLATE/release.md | 2 +- .npmignore | 1 + README.md | 12 +-- AUTHORS.md => docs/AUTHORS.md | 0 CODE_OF_CONDUCT.md => docs/CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md => docs/CONTRIBUTING.md | 8 +- docs/HOME.md | 99 +++++++++++++++++++ PUBLISHING.md => docs/PUBLISHING.md | 2 +- USING_ADVANCED.md => docs/USING_ADVANCED.md | 0 USING_PRO.md => docs/USING_PRO.md | 0 10 files changed, 113 insertions(+), 13 deletions(-) rename AUTHORS.md => docs/AUTHORS.md (100%) rename CODE_OF_CONDUCT.md => docs/CODE_OF_CONDUCT.md (96%) rename CONTRIBUTING.md => docs/CONTRIBUTING.md (85%) create mode 100644 docs/HOME.md rename PUBLISHING.md => docs/PUBLISHING.md (94%) rename USING_ADVANCED.md => docs/USING_ADVANCED.md (100%) rename USING_PRO.md => docs/USING_PRO.md (100%) diff --git a/.github/PULL_REQUEST_TEMPLATE/release.md b/.github/PULL_REQUEST_TEMPLATE/release.md index e297751786..d2183990c8 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release.md +++ b/.github/PULL_REQUEST_TEMPLATE/release.md @@ -19,7 +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/RELEASE.md)). +- [ ] Version in `package.json` has been updated (see [RELEASE.md](https://github.com/markedjs/marked/blob/master/docs/RELEASE.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). diff --git a/.npmignore b/.npmignore index 3fb773c034..029b92609d 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,3 @@ .git* test/ +docs \ No newline at end of file diff --git a/README.md b/README.md index 96ee203bad..d6146f11dc 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/USING_ADVANCED.md) and [extensibility](https://github.com/markedjs/marked/blob/master/USING_PRO.md) as well. +Marked offers [advanced configurations](https://github.com/markedjs/marked/blob/master/docs/USING_ADVANCED.md) and [extensibility](https://github.com/markedjs/marked/blob/master/docs/USING_PRO.md) as well.

    Supported Markdown specifications

    @@ -79,21 +79,21 @@ 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) 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](https://github.com/markedjs/marked/blob/master/docs/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. +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/docs/CONTRIBUTING.md) for more details. -For our Contribution License Agreement, see our [license](https://github.com/markedjs/marked/blob/master/LICENSE.md). +For our Contribution License Agreement, see our [license](LICENSE.md).

    Authors

    -For list of credited authors and contributors, please see our [authors page](https://github.com/markedjs/marked/blob/master/AUTHORS.md). +For list of credited authors and contributors, please see our [authors page](https://github.com/markedjs/marked/blob/master/docs/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. +See [license](LICENSE.md) for more details. diff --git a/AUTHORS.md b/docs/AUTHORS.md similarity index 100% rename from AUTHORS.md rename to docs/AUTHORS.md 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 3fe8c89a80..077c0fc708 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 9fbb49500b..d2198554e7 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/docs/HOME.md b/docs/HOME.md new file mode 100644 index 0000000000..1f677ac21d --- /dev/null +++ b/docs/HOME.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/PUBLISHING.md b/docs/PUBLISHING.md similarity index 94% rename from PUBLISHING.md rename to docs/PUBLISHING.md index 82a45d4bd3..4732fdf748 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/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 From 3e681a695c3a42787bdf64795fba262a82c0c017 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 11 Mar 2018 17:32:23 -0400 Subject: [PATCH 292/308] Move most of README.md to /docs/README.md --- README.md | 64 ++++++------------------------------- docs/{HOME.md => README.md} | 2 +- 2 files changed, 10 insertions(+), 56 deletions(-) rename docs/{HOME.md => README.md} (98%) diff --git a/README.md b/README.md index d6146f11dc..57f720749c 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/docs/USING_ADVANCED.md) and [extensibility](https://github.com/markedjs/marked/blob/master/docs/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/docs/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/docs/CONTRIBUTING.md) for more details. - -For our Contribution License Agreement, see our [license](LICENSE.md). - -

    Authors

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

    License

    +## License Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License) -See [license](LICENSE.md) for more details. - diff --git a/docs/HOME.md b/docs/README.md similarity index 98% rename from docs/HOME.md rename to docs/README.md index 1f677ac21d..95dacd51d2 100644 --- a/docs/HOME.md +++ b/docs/README.md @@ -48,7 +48,7 @@ $ cat hello.html Marked in the browser - +
    From 35214c58a68cc02e3d8458fd1223d82e6c6981d1 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 11 Mar 2018 18:43:26 -0400 Subject: [PATCH 293/308] Add initial docs with logo --- docs/img/logo-black-and-white.svg | 133 ++++++++++++++++++++++++++++++ docs/img/logo-black.svg | 32 +++++++ docs/index.html | 107 ++++++++++++++++++++++++ 3 files changed, 272 insertions(+) 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/docs/img/logo-black-and-white.svg b/docs/img/logo-black-and-white.svg new file mode 100644 index 0000000000..5f6c0b781b --- /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 0000000000..a67fb80e5f --- /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 0000000000..5be5946857 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,107 @@ + + + + + Marked.js Documentation + + + +
    +
    + +

    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 294/308] 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 0000000000..c92fdfcbd4 --- /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 295/308] [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 3cc69935fa..9f5e052beb 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 296/308] 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 2fdeb33e3d..a2884e8f9f 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 ba71eab395..88066002c7 100644 --- a/test/original/ordered_and_unordered_lists.html +++ b/test/original/ordered_and_unordered_lists.html @@ -146,3 +146,25 @@

    Nested

    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 7f3b49777f..3d5454d3cc 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 297/308] Add marked mark maker badge --- AUTHORS.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 094b42bc0e..3773d743c4 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 298/308] grammar --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index 3773d743c4..80f97d6a2b 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 299/308] 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 a2884e8f9f..b27e233cc6 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 88a00d0fe1..3f2eb42861 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 6d3b9ee78c..a699bfaf5a 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 88066002c7..4546947973 100644 --- a/test/original/ordered_and_unordered_lists.html +++ b/test/original/ordered_and_unordered_lists.html @@ -156,15 +156,9 @@

    Nested

    -

    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 3d5454d3cc..ea2b9c00d0 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 300/308] 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 a699bfaf5a..b312f8ee89 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 301/308] 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 0000000000..80f97d6a2b --- /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 302/308] 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 96ee203bad..57f720749c 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 0000000000..c92fdfcbd4 --- /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 3fe8c89a80..077c0fc708 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 9fbb49500b..d2198554e7 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 82a45d4bd3..4732fdf748 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 0000000000..95dacd51d2 --- /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 0000000000..5f6c0b781b --- /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 0000000000..a67fb80e5f --- /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 0000000000..5be5946857 --- /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 303/308] 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 80f97d6a2b..0000000000 --- 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 304/308] 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 094b42bc0e..341126b1f8 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 f69a82f7bcf856d2001f8c980d96c924910e74ac Mon Sep 17 00:00:00 2001 From: Paul Roub Date: Wed, 21 Mar 2018 09:23:13 -0400 Subject: [PATCH 305/308] 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 b27e233cc6..5552616ea0 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 3f2eb42861..1599b0f02c 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 306/308] 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 eef4c2c1ba..c3660ac56d 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 307/308] 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 2e48745bed..cfba80deea 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 b8a4702ee0..a2cdb75262 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 308/308] Update home page --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a2cdb75262..c59bfbfbb1 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" },