From 1b0ba2a19d3c9bc18d1b3cdb0dac7a9f5371907c Mon Sep 17 00:00:00 2001 From: x13machine Date: Mon, 18 Mar 2019 01:18:36 -0500 Subject: [PATCH 01/10] em bug fix --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index e910ed2d0c..10b762d6ee 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -542,7 +542,7 @@ var inline = { reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, - em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, + em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, br: /^( {2,}|\\)\n(?!\s*$)/, del: noop, From 75f35012b6264b5e4650138ee66a82ceff6af123 Mon Sep 17 00:00:00 2001 From: x13machine Date: Mon, 18 Mar 2019 01:27:25 -0500 Subject: [PATCH 02/10] added em_list_links test --- test/new/em_list_links.html | 55 +++++++++++++++++++++++++++++++++++++ test/new/em_list_links.md | 40 +++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 test/new/em_list_links.html create mode 100644 test/new/em_list_links.md diff --git a/test/new/em_list_links.html b/test/new/em_list_links.html new file mode 100644 index 0000000000..b52cd2a926 --- /dev/null +++ b/test/new/em_list_links.html @@ -0,0 +1,55 @@ + + diff --git a/test/new/em_list_links.md b/test/new/em_list_links.md new file mode 100644 index 0000000000..1cc50d5ce9 --- /dev/null +++ b/test/new/em_list_links.md @@ -0,0 +1,40 @@ +- italic + - [*named link*][some-url] + - *[named link][some-url]* + - [_named link_][some-url] + - _[named link][some-url]_ +- bold + - [**named link**][some-url] + - **[named link][some-url]** + - [__named link__][some-url] + - __[named link][some-url]__ +- bold italic + - [***named link***][some-url] + - ***[named link][some-url]*** + - [___named link___][some-url] + - ___[named link][some-url]___ + - [*__named link__*][some-url] + - [__*named link*__][some-url] + - __*[named link][some-url]*__ +- code + - [`named link`][some-url] +- code italic + - *[`named link`][some-url]* + - [*`named link`*][some-url] + - _[`named link`][some-url]_ + - [_`named link`_][some-url] +- code bold + - **[`named link`][some-url]** + - [**`named link`**][some-url] + - __[`named link`][some-url]__ + - [__`named link`__][some-url] +- code bold italic + - [***`named link`***][some-url] + - ***[`named link`][some-url]*** + - [___`named link`___][some-url] + - ___[`named link`][some-url]___ + - [*__`named link`__*][some-url] + - [__*`named link`*__][some-url] + - __*[`named link`][some-url]*__ + +[some-url]: https://www.google.com \ No newline at end of file From 4c54bd1a669d020070410e1935b6d376444184bc Mon Sep 17 00:00:00 2001 From: x13machine Date: Thu, 21 Mar 2019 01:18:31 -0500 Subject: [PATCH 03/10] fixed example #333 --- lib/marked.js | 3184 ++++++++++---------- test/specs/commonmark/commonmark.0.28.json | 6 +- 2 files changed, 1594 insertions(+), 1596 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index 10b762d6ee..255a1d200b 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -5,1688 +5,1688 @@ */ ;(function(root) { -'use strict'; - -/** - * Block-Level Grammar - */ - -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: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: '^ {0,3}(?:' // optional indentation - + '<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) - + '|comment[^\\n]*(\\n+|$)' // (2) - + '|<\\?[\\s\\S]*?\\?>\\n*' // (3) - + '|\\n*' // (4) - + '|\\n*' // (5) - + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) - + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag - + '|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag - + ')', - def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, - table: noop, - lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/, - text: /^[^\n]+/ -}; - -block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; -block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; -block.def = edit(block.def) - .replace('label', block._label) - .replace('title', block._title) - .getRegex(); - -block.bullet = /(?:[*+-]|\d{1,9}\.)/; -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 = 'address|article|aside|base|basefont|blockquote|body|caption' - + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' - + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' - + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' - + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' - + '|track|ul'; -block._comment = //; -block.html = edit(block.html, 'i') - .replace('comment', block._comment) - .replace('tag', block._tag) - .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) - .getRegex(); - -block.paragraph = edit(block.paragraph) - .replace('hr', block.hr) - .replace('heading', block.heading) - .replace('lheading', block.lheading) - .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks - .getRegex(); - -block.blockquote = edit(block.blockquote) - .replace('paragraph', block.paragraph) - .getRegex(); - -/** - * Normal Block Grammar - */ - -block.normal = merge({}, block); - -/** - * GFM Block Grammar - */ - -block.gfm = merge({}, block.normal, { - fences: /^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\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(); - -/** - * GFM + Tables Block Grammar - */ - -block.tables = merge({}, block.gfm, { - nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/, - table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ -}); - -/** - * Pedantic grammar - */ - -block.pedantic = merge({}, block.normal, { - html: edit( - '^ *(?:comment *(?:\\n|\\s*$)' - + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag - + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') + 'use strict'; + + /** + * Block-Level Grammar + */ + + 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: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, + html: '^ {0,3}(?:' // optional indentation + + '<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) + + '|comment[^\\n]*(\\n+|$)' // (2) + + '|<\\?[\\s\\S]*?\\?>\\n*' // (3) + + '|\\n*' // (4) + + '|\\n*' // (5) + + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) + + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag + + '|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + + ')', + def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, + table: noop, + lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, + paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/, + text: /^[^\n]+/ + }; + + block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; + block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; + block.def = edit(block.def) + .replace('label', block._label) + .replace('title', block._title) + .getRegex(); + + block.bullet = /(?:[*+-]|\d{1,9}\.)/; + 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 = 'address|article|aside|base|basefont|blockquote|body|caption' + + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + + '|track|ul'; + block._comment = //; + block.html = edit(block.html, 'i') .replace('comment', block._comment) - .replace(/tag/g, '(?!(?:' - + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' - + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' - + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b') - .getRegex(), - def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/ -}); - -/** - * Block Lexer - */ - -function Lexer(options) { - this.tokens = []; - this.tokens.links = Object.create(null); - this.options = options || marked.defaults; - this.rules = block.normal; - - if (this.options.pedantic) { - this.rules = block.pedantic; - } else if (this.options.gfm) { - if (this.options.tables) { - this.rules = block.tables; - } else { - this.rules = block.gfm; + .replace('tag', block._tag) + .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) + .getRegex(); + + block.paragraph = edit(block.paragraph) + .replace('hr', block.hr) + .replace('heading', block.heading) + .replace('lheading', block.lheading) + .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks + .getRegex(); + + block.blockquote = edit(block.blockquote) + .replace('paragraph', block.paragraph) + .getRegex(); + + /** + * Normal Block Grammar + */ + + block.normal = merge({}, block); + + /** + * GFM Block Grammar + */ + + block.gfm = merge({}, block.normal, { + fences: /^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\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(); + + /** + * GFM + Tables Block Grammar + */ + + block.tables = merge({}, block.gfm, { + nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/, + table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ + }); + + /** + * Pedantic grammar + */ + + block.pedantic = merge({}, block.normal, { + html: edit( + '^ *(?:comment *(?:\\n|\\s*$)' + + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag + + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') + .replace('comment', block._comment) + .replace(/tag/g, '(?!(?:' + + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b') + .getRegex(), + def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/ + }); + + /** + * Block Lexer + */ + + function Lexer(options) { + this.tokens = []; + this.tokens.links = Object.create(null); + this.options = options || marked.defaults; + this.rules = block.normal; + + if (this.options.pedantic) { + this.rules = block.pedantic; + } else if (this.options.gfm) { + if (this.options.tables) { + this.rules = block.tables; + } else { + this.rules = block.gfm; + } } } -} - -/** - * Expose Block Rules - */ - -Lexer.rules = block; - -/** - * Static Lex Method - */ - -Lexer.lex = function(src, options) { - var lexer = new Lexer(options); - return lexer.lex(src); -}; - -/** - * Preprocessing - */ - -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); -}; - -/** - * Lexing - */ - -Lexer.prototype.token = function(src, top) { - src = src.replace(/^ +$/gm, ''); - var next, - loose, - cap, - bull, - b, - item, - listStart, - listItems, - t, - space, - i, - tag, - l, - isordered, - istask, - ischecked; - - while (src) { - // newline - if (cap = this.rules.newline.exec(src)) { - src = src.substring(cap[0].length); - if (cap[0].length > 1) { + + /** + * Expose Block Rules + */ + + Lexer.rules = block; + + /** + * Static Lex Method + */ + + Lexer.lex = function(src, options) { + var lexer = new Lexer(options); + return lexer.lex(src); + }; + + /** + * Preprocessing + */ + + 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); + }; + + /** + * Lexing + */ + + Lexer.prototype.token = function(src, top) { + src = src.replace(/^ +$/gm, ''); + var next, + loose, + cap, + bull, + b, + item, + listStart, + listItems, + t, + space, + i, + tag, + l, + isordered, + istask, + ischecked; + + while (src) { + // newline + if (cap = this.rules.newline.exec(src)) { + src = src.substring(cap[0].length); + if (cap[0].length > 1) { + this.tokens.push({ + type: 'space' + }); + } + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + cap = cap[0].replace(/^ {4}/gm, ''); this.tokens.push({ - type: 'space' + type: 'code', + text: !this.options.pedantic + ? rtrim(cap, '\n') + : cap }); + continue; } - } - - // code - 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 - ? rtrim(cap, '\n') - : cap - }); - continue; - } - - // fences (gfm) - if (cap = this.rules.fences.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'code', - lang: cap[2] ? cap[2].trim() : cap[2], - text: cap[3] || '' - }); - continue; - } - - // heading - 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; - } - - // table no leading pipe (gfm) - if (cap = this.rules.nptable.exec(src)) { - item = { - type: 'table', - header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] - }; - - if (item.header.length === item.align.length) { + + // fences (gfm) + if (cap = this.rules.fences.exec(src)) { src = src.substring(cap[0].length); - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = splitCells(item.cells[i], item.header.length); - } - - this.tokens.push(item); - + this.tokens.push({ + type: 'code', + lang: cap[2] ? cap[2].trim() : cap[2], + text: cap[3] || '' + }); continue; } - } - - // hr - if (cap = this.rules.hr.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'hr' - }); - continue; - } - - // blockquote - if (cap = this.rules.blockquote.exec(src)) { - src = src.substring(cap[0].length); - - this.tokens.push({ - type: 'blockquote_start' - }); - - cap = cap[0].replace(/^ *> ?/gm, ''); - - // Pass `top` to keep the current - // "toplevel" state. This is exactly - // how markdown.pl works. - this.token(cap, top); - - this.tokens.push({ - type: 'blockquote_end' - }); - - continue; - } - - // list - if (cap = this.rules.list.exec(src)) { - src = src.substring(cap[0].length); - bull = cap[2]; - isordered = bull.length > 1; - - listStart = { - type: 'list_start', - ordered: isordered, - start: isordered ? +bull : '', - loose: false - }; - - this.tokens.push(listStart); - - // Get each top-level item. - cap = cap[0].match(this.rules.item); - - listItems = []; - next = false; - l = cap.length; - i = 0; - - for (; i < l; i++) { - item = cap[i]; - - // Remove the list item's bullet - // so it is seen as the next token. - space = item.length; - item = item.replace(/^ *([*+-]|\d+\.) */, ''); - - // Outdent whatever the - // list item contains. Hacky. - if (~item.indexOf('\n ')) { - space -= item.length; - item = !this.options.pedantic - ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') - : item.replace(/^ {1,4}/gm, ''); - } - - // Determine whether the next list item belongs here. - // Backpedal if it does not belong in this list. - if (i !== l - 1) { - b = block.bullet.exec(cap[i + 1])[0]; - if (bull.length > 1 ? b.length === 1 - : (b.length > 1 || (this.options.smartLists && b !== bull))) { - src = cap.slice(i + 1).join('\n') + src; - i = l - 1; + + // heading + 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; + } + + // table no leading pipe (gfm) + if (cap = this.rules.nptable.exec(src)) { + item = { + type: 'table', + header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] + }; + + if (item.header.length === item.align.length) { + src = src.substring(cap[0].length); + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = splitCells(item.cells[i], item.header.length); + } + + this.tokens.push(item); + + continue; } - - // Determine whether item is loose or not. - // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ - // for discount behavior. - loose = next || /\n\n(?!\s*$)/.test(item); - if (i !== l - 1) { - next = item.charAt(item.length - 1) === '\n'; - if (!loose) loose = next; - } - - if (loose) { - listStart.loose = true; - } - - // Check for task list items - istask = /^\[[ xX]\] /.test(item); - ischecked = undefined; - if (istask) { - ischecked = item[1] !== ' '; - item = item.replace(/^\[[ xX]\] +/, ''); - } - - t = { - type: 'list_item_start', - task: istask, - checked: ischecked, - loose: loose - }; - - listItems.push(t); - this.tokens.push(t); - - // Recurse. - this.token(item, false); - + } + + // hr + if (cap = this.rules.hr.exec(src)) { + src = src.substring(cap[0].length); this.tokens.push({ - type: 'list_item_end' + type: 'hr' }); + continue; } - - if (listStart.loose) { - l = listItems.length; + + // blockquote + if (cap = this.rules.blockquote.exec(src)) { + src = src.substring(cap[0].length); + + this.tokens.push({ + type: 'blockquote_start' + }); + + cap = cap[0].replace(/^ *> ?/gm, ''); + + // Pass `top` to keep the current + // "toplevel" state. This is exactly + // how markdown.pl works. + this.token(cap, top); + + this.tokens.push({ + type: 'blockquote_end' + }); + + continue; + } + + // list + if (cap = this.rules.list.exec(src)) { + src = src.substring(cap[0].length); + bull = cap[2]; + isordered = bull.length > 1; + + listStart = { + type: 'list_start', + ordered: isordered, + start: isordered ? +bull : '', + loose: false + }; + + this.tokens.push(listStart); + + // Get each top-level item. + cap = cap[0].match(this.rules.item); + + listItems = []; + next = false; + l = cap.length; i = 0; + for (; i < l; i++) { - listItems[i].loose = true; + item = cap[i]; + + // Remove the list item's bullet + // so it is seen as the next token. + space = item.length; + item = item.replace(/^ *([*+-]|\d+\.) */, ''); + + // Outdent whatever the + // list item contains. Hacky. + if (~item.indexOf('\n ')) { + space -= item.length; + item = !this.options.pedantic + ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') + : item.replace(/^ {1,4}/gm, ''); + } + + // Determine whether the next list item belongs here. + // Backpedal if it does not belong in this list. + if (i !== l - 1) { + b = block.bullet.exec(cap[i + 1])[0]; + if (bull.length > 1 ? b.length === 1 + : (b.length > 1 || (this.options.smartLists && b !== bull))) { + src = cap.slice(i + 1).join('\n') + src; + i = l - 1; + } + } + + // Determine whether item is loose or not. + // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ + // for discount behavior. + loose = next || /\n\n(?!\s*$)/.test(item); + if (i !== l - 1) { + next = item.charAt(item.length - 1) === '\n'; + if (!loose) loose = next; + } + + if (loose) { + listStart.loose = true; + } + + // Check for task list items + istask = /^\[[ xX]\] /.test(item); + ischecked = undefined; + if (istask) { + ischecked = item[1] !== ' '; + item = item.replace(/^\[[ xX]\] +/, ''); + } + + t = { + type: 'list_item_start', + task: istask, + checked: ischecked, + loose: loose + }; + + listItems.push(t); + this.tokens.push(t); + + // Recurse. + this.token(item, false); + + this.tokens.push({ + type: 'list_item_end' + }); } + + if (listStart.loose) { + l = listItems.length; + i = 0; + for (; i < l; i++) { + listItems[i].loose = true; + } + } + + this.tokens.push({ + type: 'list_end' + }); + + continue; } - - this.tokens.push({ - type: 'list_end' - }); - - continue; - } - - // html - 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; - } - - // def - 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().replace(/\s+/g, ' '); - if (!this.tokens.links[tag]) { - this.tokens.links[tag] = { - href: cap[2], - title: cap[3] - }; + + // html + 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; } - continue; - } - - // table (gfm) - if (cap = this.rules.table.exec(src)) { - item = { - type: 'table', - header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] - }; - - if (item.header.length === item.align.length) { + + // def + if (top && (cap = this.rules.def.exec(src))) { src = src.substring(cap[0].length); - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } + if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1); + tag = cap[1].toLowerCase().replace(/\s+/g, ' '); + if (!this.tokens.links[tag]) { + this.tokens.links[tag] = { + href: cap[2], + title: cap[3] + }; } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = splitCells( - item.cells[i].replace(/^ *\| *| *\| *$/g, ''), - item.header.length); + continue; + } + + // table (gfm) + if (cap = this.rules.table.exec(src)) { + item = { + type: 'table', + header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] + }; + + if (item.header.length === item.align.length) { + src = src.substring(cap[0].length); + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = splitCells( + item.cells[i].replace(/^ *\| *| *\| *$/g, ''), + item.header.length); + } + + this.tokens.push(item); + + continue; } - - this.tokens.push(item); - + } + + // 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); + this.tokens.push({ + type: 'paragraph', + text: cap[1].charAt(cap[1].length - 1) === '\n' + ? cap[1].slice(0, -1) + : cap[1] + }); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + // Top-level should never reach here. + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'text', + text: cap[0] + }); + continue; + } + + if (src) { + throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } } - - // 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); - this.tokens.push({ - type: 'paragraph', - text: cap[1].charAt(cap[1].length - 1) === '\n' - ? cap[1].slice(0, -1) - : cap[1] - }); - continue; - } - - // text - if (cap = this.rules.text.exec(src)) { - // Top-level should never reach here. - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'text', - text: cap[0] - }); - continue; - } - - if (src) { - throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); - } - } - - return this.tokens; -}; - -/** - * Inline-Level Grammar - */ - -var inline = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: noop, - tag: '^comment' - + '|^' // self-closing tag - + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag - + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. - + '|^' // declaration, e.g. - + '|^', // CDATA section - link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, - nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, - strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, - em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: noop, - text: /^(`+|[^`])[\s\S]*?(?=[\\?@\\[^_{|}~'; -inline.em = edit(inline.em).replace(/punctuation/g, inline._punctuation).getRegex(); - -inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g; - -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.autolink = edit(inline.autolink) - .replace('scheme', inline._scheme) - .replace('email', inline._email) - .getRegex(); - -inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; - -inline.tag = edit(inline.tag) - .replace('comment', block._comment) - .replace('attribute', inline._attribute) - .getRegex(); - -inline._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|`(?!`)|[^\[\]\\`])*?/; -inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*)/; -inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; - -inline.link = edit(inline.link) - .replace('label', inline._label) - .replace('href', inline._href) - .replace('title', inline._title) - .getRegex(); - -inline.reflink = edit(inline.reflink) - .replace('label', inline._label) - .getRegex(); - -/** - * Normal Inline Grammar - */ - -inline.normal = merge({}, inline); - -/** - * Pedantic Inline Grammar - */ - -inline.pedantic = merge({}, inline.normal, { - strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, - link: edit(/^!?\[(label)\]\((.*?)\)/) + + return this.tokens; + }; + + /** + * Inline-Level Grammar + */ + + var inline = { + escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, + autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, + url: noop, + tag: '^comment' + + '|^' // self-closing tag + + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag + + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. + + '|^' // declaration, e.g. + + '|^', // CDATA section + link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/, + reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, + nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, + strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, + em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, + code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, + br: /^( {2,}|\\)\n(?!\s*$)/, + del: noop, + text: /^(`+|[^`])[\s\S]*?(?=[\\?@\\[^_{|}~'; + inline.em = edit(inline.em).replace(/punctuation/g, inline._punctuation).getRegex(); + + inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g; + + 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.autolink = edit(inline.autolink) + .replace('scheme', inline._scheme) + .replace('email', inline._email) + .getRegex(); + + inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; + + inline.tag = edit(inline.tag) + .replace('comment', block._comment) + .replace('attribute', inline._attribute) + .getRegex(); + + inline._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|`(?!`)|[^\[\]\\`])*?/; + inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*)/; + inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; + + inline.link = edit(inline.link) .replace('label', inline._label) - .getRegex(), - reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) + .replace('href', inline._href) + .replace('title', inline._title) + .getRegex(); + + inline.reflink = edit(inline.reflink) .replace('label', inline._label) - .getRegex() -}); - -/** - * GFM Inline Grammar - */ - -inline.gfm = merge({}, inline.normal, { - escape: edit(inline.escape).replace('])', '~|])').getRegex(), - _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, - url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, - _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.gfm.url = edit(inline.gfm.url, 'i') - .replace('email', inline.gfm._extended_email) - .getRegex(); -/** - * GFM + Line Breaks Inline Grammar - */ - -inline.breaks = merge({}, inline.gfm, { - br: edit(inline.br).replace('{2,}', '*').getRegex(), - text: edit(inline.gfm.text).replace('{2,}', '*').getRegex() -}); - -/** - * Inline Lexer & Compiler - */ - -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.pedantic) { - this.rules = inline.pedantic; - } else if (this.options.gfm) { - if (this.options.breaks) { - this.rules = inline.breaks; - } else { - this.rules = inline.gfm; - } - } -} - -/** - * Expose Inline Rules - */ - -InlineLexer.rules = inline; - -/** - * Static Lexing/Compiling Method - */ - -InlineLexer.output = function(src, links, options) { - var inline = new InlineLexer(links, options); - return inline.output(src); -}; - -/** - * Lexing/Compiling - */ - -InlineLexer.prototype.output = function(src) { - var out = '', - link, - text, - href, - title, - cap, - prevCapZero; - - while (src) { - // escape - if (cap = this.rules.escape.exec(src)) { - src = src.substring(cap[0].length); - out += escape(cap[1]); - continue; - } - - // tag - if (cap = this.rules.tag.exec(src)) { - if (!this.inLink && /^/i.test(cap[0])) { - this.inLink = false; - } - if (!this.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.inRawBlock = true; - } else if (this.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.inRawBlock = 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; + .getRegex(); + + /** + * Normal Inline Grammar + */ + + inline.normal = merge({}, inline); + + /** + * Pedantic Inline Grammar + */ + + inline.pedantic = merge({}, inline.normal, { + strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, + em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, + link: edit(/^!?\[(label)\]\((.*?)\)/) + .replace('label', inline._label) + .getRegex(), + reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) + .replace('label', inline._label) + .getRegex() + }); + + /** + * GFM Inline Grammar + */ + + inline.gfm = merge({}, inline.normal, { + escape: edit(inline.escape).replace('])', '~|])').getRegex(), + _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, + url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, + _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.gfm.url = edit(inline.gfm.url, 'i') + .replace('email', inline.gfm._extended_email) + .getRegex(); + /** + * GFM + Line Breaks Inline Grammar + */ + + inline.breaks = merge({}, inline.gfm, { + br: edit(inline.br).replace('{2,}', '*').getRegex(), + text: edit(inline.gfm.text).replace('{2,}', '*').getRegex() + }); + + /** + * Inline Lexer & Compiler + */ + + 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.'); } - - // link - if (cap = this.rules.link.exec(src)) { - var lastParenIndex = findClosingBracket(cap[2], '()'); - if (lastParenIndex > -1) { - var linkLen = cap[0].length - (cap[2].length - lastParenIndex) - (cap[3] || '').length; - cap[2] = cap[2].substring(0, lastParenIndex); - cap[0] = cap[0].substring(0, linkLen).trim(); - cap[3] = ''; - } - src = src.substring(cap[0].length); - this.inLink = true; - href = cap[2]; - if (this.options.pedantic) { - link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); - - if (link) { - href = link[1]; - title = link[3]; - } else { - title = ''; - } + + if (this.options.pedantic) { + this.rules = inline.pedantic; + } else if (this.options.gfm) { + if (this.options.breaks) { + this.rules = inline.breaks; } else { - title = cap[3] ? cap[3].slice(1, -1) : ''; + this.rules = inline.gfm; } - href = href.trim().replace(/^<([\s\S]*)>$/, '$1'); - out += this.outputLink(cap, { - href: InlineLexer.escapes(href), - title: InlineLexer.escapes(title) - }); - this.inLink = false; - continue; } - - // reflink, nolink - 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; + } + + /** + * Expose Inline Rules + */ + + InlineLexer.rules = inline; + + /** + * Static Lexing/Compiling Method + */ + + InlineLexer.output = function(src, links, options) { + var inline = new InlineLexer(links, options); + return inline.output(src); + }; + + /** + * Lexing/Compiling + */ + + InlineLexer.prototype.output = function(src) { + var out = '', + link, + text, + href, + title, + cap, + prevCapZero; + + while (src) { + // escape + if (cap = this.rules.escape.exec(src)) { + src = src.substring(cap[0].length); + out += escape(cap[1]); continue; } - this.inLink = true; - out += this.outputLink(cap, link); - this.inLink = false; - continue; - } - - // strong - if (cap = this.rules.strong.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1])); - continue; - } - - // em - if (cap = this.rules.em.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1])); - continue; - } - - // code - if (cap = this.rules.code.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.codespan(escape(cap[2].trim(), true)); - continue; - } - - // br - if (cap = this.rules.br.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.br(); - continue; - } - - // del (gfm) - if (cap = this.rules.del.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.del(this.output(cap[1])); - continue; - } - - // autolink - 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; + + // tag + if (cap = this.rules.tag.exec(src)) { + if (!this.inLink && /^/i.test(cap[0])) { + this.inLink = false; + } + if (!this.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.inRawBlock = true; + } else if (this.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.inRawBlock = 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; } - out += this.renderer.link(href, null, text); - continue; - } - - // url (gfm) - if (!this.inLink && (cap = this.rules.url.exec(src))) { - if (cap[2] === '@') { - text = escape(cap[0]); - href = 'mailto:' + text; - } else { - // do extended autolink path validation - do { - prevCapZero = cap[0]; - cap[0] = this.rules._backpedal.exec(cap[0])[0]; - } while (prevCapZero !== cap[0]); - text = escape(cap[0]); - if (cap[1] === 'www.') { - href = 'http://' + text; + + // link + if (cap = this.rules.link.exec(src)) { + var lastParenIndex = findClosingBracket(cap[2], '()'); + if (lastParenIndex > -1) { + var linkLen = cap[0].length - (cap[2].length - lastParenIndex) - (cap[3] || '').length; + cap[2] = cap[2].substring(0, lastParenIndex); + cap[0] = cap[0].substring(0, linkLen).trim(); + cap[3] = ''; + } + src = src.substring(cap[0].length); + this.inLink = true; + href = cap[2]; + if (this.options.pedantic) { + link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); + + if (link) { + href = link[1]; + title = link[3]; + } else { + title = ''; + } } else { - href = text; + title = cap[3] ? cap[3].slice(1, -1) : ''; } + href = href.trim().replace(/^<([\s\S]*)>$/, '$1'); + out += this.outputLink(cap, { + href: InlineLexer.escapes(href), + title: InlineLexer.escapes(title) + }); + this.inLink = false; + continue; } - src = src.substring(cap[0].length); - out += this.renderer.link(href, null, text); - continue; - } - - // text - if (cap = this.rules.text.exec(src)) { - src = src.substring(cap[0].length); - if (this.inRawBlock) { - out += this.renderer.text(cap[0]); - } else { - out += this.renderer.text(escape(this.smartypants(cap[0]))); + + // reflink, nolink + 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; } - continue; - } - - if (src) { - throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); - } - } - - return out; -}; - -InlineLexer.escapes = function(text) { - return text ? text.replace(InlineLexer.rules._escapes, '$1') : text; -}; - -/** - * Compile Link - */ - -InlineLexer.prototype.outputLink = function(cap, link) { - var href = 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])); -}; - -/** - * Smartypants Transformations - */ - -InlineLexer.prototype.smartypants = function(text) { - if (!this.options.smartypants) return text; - return text - // em-dashes - .replace(/---/g, '\u2014') - // en-dashes - .replace(/--/g, '\u2013') - // opening singles - .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') - // closing singles & apostrophes - .replace(/'/g, '\u2019') - // opening doubles - .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') - // closing doubles - .replace(/"/g, '\u201d') - // ellipses - .replace(/\.{3}/g, '\u2026'); -}; - -/** - * Mangle Links - */ - -InlineLexer.prototype.mangle = function(text) { - if (!this.options.mangle) return text; - var out = '', - l = text.length, - i = 0, - ch; - - for (; i < l; i++) { - ch = text.charCodeAt(i); - if (Math.random() > 0.5) { - ch = 'x' + ch.toString(16); - } - out += '&#' + ch + ';'; - } - - return out; -}; - -/** - * Renderer - */ - -function Renderer(options) { - this.options = options || marked.defaults; -} - -Renderer.prototype.code = function(code, infostring, escaped) { - var lang = (infostring || '').match(/\S*/)[0]; - 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))
-      + '
'; - } - - return '
'
-    + (escaped ? code : escape(code, true))
-    + '
\n'; -}; - -Renderer.prototype.blockquote = function(quote) { - return '
\n' + quote + '
\n'; -}; - -Renderer.prototype.html = function(html) { - return html; -}; - -Renderer.prototype.heading = function(text, level, raw, slugger) { - if (this.options.headerIds) { - return '' - + text - + '\n'; - } - // ignore IDs - 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.checkbox = function(checked) { - return ' '; -}; - -Renderer.prototype.paragraph = function(text) { - return '

    ' + text + '

    \n'; -}; - -Renderer.prototype.table = function(header, body) { - if (body) body = '' + body + ''; - - return '\n' - + '\n' - + header - + '\n' - + body - + '
    \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 + ' align="' + flags.align + '">' - : '<' + type + '>'; - return tag + content + '\n'; -}; - -// span level renderer -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) { - href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); - if (href === null) { - return text; - } - var out = '
    '; - return out; -}; - -Renderer.prototype.image = function(href, title, text) { - href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); - if (href === null) { - return text; - } - - var out = '' + text + '' : '>'; - return out; -}; - -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 - */ - -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; - this.slugger = new Slugger(); -} - -/** - * Static Parse Method - */ - -Parser.parse = function(src, options) { - var parser = new Parser(options); - return parser.parse(src); -}; - -/** - * Parse Loop - */ - -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 = ''; - while (this.next()) { - out += this.tok(); - } - - return out; -}; - -/** - * Next Token - */ - -Parser.prototype.next = function() { - return this.token = this.tokens.pop(); -}; - -/** - * Preview Next Token - */ - -Parser.prototype.peek = function() { - return this.tokens[this.tokens.length - 1] || 0; -}; - -/** - * Parse Text Tokens - */ - -Parser.prototype.parseText = function() { - var body = this.token.text; - - while (this.peek().type === 'text') { - body += '\n' + this.next().text; + + // strong + if (cap = this.rules.strong.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1])); + continue; + } + + // em + if (cap = this.rules.em.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1])); + continue; + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.codespan(escape(cap[2].trim(), true)); + continue; + } + + // br + if (cap = this.rules.br.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.br(); + continue; + } + + // del (gfm) + if (cap = this.rules.del.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.del(this.output(cap[1])); + continue; + } + + // autolink + 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; + } + + // url (gfm) + if (!this.inLink && (cap = this.rules.url.exec(src))) { + if (cap[2] === '@') { + text = escape(cap[0]); + href = 'mailto:' + text; + } else { + // do extended autolink path validation + do { + prevCapZero = cap[0]; + cap[0] = this.rules._backpedal.exec(cap[0])[0]; + } while (prevCapZero !== cap[0]); + text = escape(cap[0]); + if (cap[1] === 'www.') { + href = 'http://' + text; + } else { + href = text; + } + } + src = src.substring(cap[0].length); + out += this.renderer.link(href, null, text); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + src = src.substring(cap[0].length); + if (this.inRawBlock) { + out += this.renderer.text(cap[0]); + } else { + 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.escapes = function(text) { + return text ? text.replace(InlineLexer.rules._escapes, '$1') : text; + }; + + /** + * Compile Link + */ + + InlineLexer.prototype.outputLink = function(cap, link) { + var href = 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])); + }; + + /** + * Smartypants Transformations + */ + + InlineLexer.prototype.smartypants = function(text) { + if (!this.options.smartypants) return text; + return text + // em-dashes + .replace(/---/g, '\u2014') + // en-dashes + .replace(/--/g, '\u2013') + // opening singles + .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') + // closing singles & apostrophes + .replace(/'/g, '\u2019') + // opening doubles + .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') + // closing doubles + .replace(/"/g, '\u201d') + // ellipses + .replace(/\.{3}/g, '\u2026'); + }; + + /** + * Mangle Links + */ + + InlineLexer.prototype.mangle = function(text) { + if (!this.options.mangle) return text; + var out = '', + l = text.length, + i = 0, + ch; + + for (; i < l; i++) { + ch = text.charCodeAt(i); + if (Math.random() > 0.5) { + ch = 'x' + ch.toString(16); + } + out += '&#' + ch + ';'; + } + + return out; + }; + + /** + * Renderer + */ + + function Renderer(options) { + this.options = options || marked.defaults; } - - return this.inline.output(body); -}; - -/** - * Parse Current Token - */ - -Parser.prototype.tok = function() { - switch (this.token.type) { - case 'space': { - return ''; + + Renderer.prototype.code = function(code, infostring, escaped) { + var lang = (infostring || '').match(/\S*/)[0]; + 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))
    +        + '
    '; + } + + return '
    '
    +      + (escaped ? code : escape(code, true))
    +      + '
    \n'; + }; + + Renderer.prototype.blockquote = function(quote) { + return '
    \n' + quote + '
    \n'; + }; + + Renderer.prototype.html = function(html) { + return html; + }; + + Renderer.prototype.heading = function(text, level, raw, slugger) { + if (this.options.headerIds) { + return '' + + text + + '\n'; + } + // ignore IDs + 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.checkbox = function(checked) { + return ' '; + }; + + Renderer.prototype.paragraph = function(text) { + return '

    ' + text + '

    \n'; + }; + + Renderer.prototype.table = function(header, body) { + if (body) body = '' + body + ''; + + return '\n' + + '\n' + + header + + '\n' + + body + + '
    \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 + ' align="' + flags.align + '">' + : '<' + type + '>'; + return tag + content + '\n'; + }; + + // span level renderer + 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) { + href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); + if (href === null) { + return text; } - case 'hr': { - return this.renderer.hr(); + var out = '
    '; + return out; + }; + + Renderer.prototype.image = function(href, title, text) { + href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); + if (href === null) { + return text; } - case 'code': { - return this.renderer.code(this.token.text, - this.token.lang, - this.token.escaped); + + var out = '' + text + '' : '>'; + return out; + }; + + 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 + */ + + 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; + this.slugger = new Slugger(); + } + + /** + * Static Parse Method + */ + + Parser.parse = function(src, options) { + var parser = new Parser(options); + return parser.parse(src); + }; + + /** + * Parse Loop + */ + + 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 = ''; + while (this.next()) { + out += this.tok(); + } + + return out; + }; + + /** + * Next Token + */ + + Parser.prototype.next = function() { + return this.token = this.tokens.pop(); + }; + + /** + * Preview Next Token + */ + + Parser.prototype.peek = function() { + return this.tokens[this.tokens.length - 1] || 0; + }; + + /** + * Parse Text Tokens + */ + + Parser.prototype.parseText = function() { + var body = this.token.text; + + while (this.peek().type === 'text') { + body += '\n' + this.next().text; + } + + return this.inline.output(body); + }; + + /** + * Parse Current Token + */ + + Parser.prototype.tok = function() { + switch (this.token.type) { + case 'space': { + return ''; } - header += this.renderer.tablerow(cell); - - for (i = 0; i < this.token.cells.length; i++) { - row = this.token.cells[i]; - + 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)), + this.slugger); + } + case 'code': { + return this.renderer.code(this.token.text, + this.token.lang, + this.token.escaped); + } + case 'table': { + var header = '', + body = '', + i, + row, + cell, + j; + + // header cell = ''; - for (j = 0; j < row.length; j++) { + for (i = 0; i < this.token.header.length; i++) { cell += this.renderer.tablecell( - this.inline.output(row[j]), - { header: false, align: this.token.align[j] } + this.inline.output(this.token.header[i]), + { header: true, align: this.token.align[i] } ); } - - body += this.renderer.tablerow(cell); + header += this.renderer.tablerow(cell); + + for (i = 0; i < this.token.cells.length; i++) { + row = this.token.cells[i]; + + cell = ''; + for (j = 0; j < row.length; j++) { + cell += this.renderer.tablecell( + this.inline.output(row[j]), + { header: false, align: this.token.align[j] } + ); + } + + body += this.renderer.tablerow(cell); + } + return this.renderer.table(header, body); } - return this.renderer.table(header, body); - } - case 'blockquote_start': { - body = ''; - - while (this.next().type !== 'blockquote_end') { - body += this.tok(); + case 'blockquote_start': { + body = ''; + + while (this.next().type !== 'blockquote_end') { + body += this.tok(); + } + + return this.renderer.blockquote(body); } - - return this.renderer.blockquote(body); - } - case 'list_start': { - body = ''; - var ordered = this.token.ordered, - start = this.token.start; - - while (this.next().type !== 'list_end') { - body += this.tok(); + case 'list_start': { + body = ''; + var ordered = this.token.ordered, + start = this.token.start; + + while (this.next().type !== 'list_end') { + body += this.tok(); + } + + return this.renderer.list(body, ordered, start); } - - return this.renderer.list(body, ordered, start); - } - case 'list_item_start': { - body = ''; - var loose = this.token.loose; - var checked = this.token.checked; - var task = this.token.task; - - if (this.token.task) { - body += this.renderer.checkbox(checked); + case 'list_item_start': { + body = ''; + var loose = this.token.loose; + var checked = this.token.checked; + var task = this.token.task; + + if (this.token.task) { + body += this.renderer.checkbox(checked); + } + + while (this.next().type !== 'list_item_end') { + body += !loose && this.token.type === 'text' + ? this.parseText() + : this.tok(); + } + return this.renderer.listitem(body, task, checked); } - - while (this.next().type !== 'list_item_end') { - body += !loose && this.token.type === 'text' - ? this.parseText() - : this.tok(); + case 'html': { + // TODO parse inline content if parameter markdown=1 + return this.renderer.html(this.token.text); + } + case 'paragraph': { + return this.renderer.paragraph(this.inline.output(this.token.text)); + } + case 'text': { + return this.renderer.paragraph(this.parseText()); + } + default: { + var errMsg = 'Token with "' + this.token.type + '" type was not found.'; + if (this.options.silent) { + console.log(errMsg); + } else { + throw new Error(errMsg); + } } - return this.renderer.listitem(body, task, checked); - } - case 'html': { - // TODO parse inline content if parameter markdown=1 - return this.renderer.html(this.token.text); - } - case 'paragraph': { - return this.renderer.paragraph(this.inline.output(this.token.text)); } - case 'text': { - return this.renderer.paragraph(this.parseText()); + }; + + /** + * Slugger generates header id + */ + + function Slugger () { + this.seen = {}; + } + + /** + * Convert string to unique id + */ + + Slugger.prototype.slug = function (value) { + var slug = value + .toLowerCase() + .trim() + .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '') + .replace(/\s/g, '-'); + + if (this.seen.hasOwnProperty(slug)) { + var originalSlug = slug; + do { + this.seen[originalSlug]++; + slug = originalSlug + '-' + this.seen[originalSlug]; + } while (this.seen.hasOwnProperty(slug)); } - default: { - var errMsg = 'Token with "' + this.token.type + '" type was not found.'; - if (this.options.silent) { - console.log(errMsg); - } else { - throw new Error(errMsg); + this.seen[slug] = 0; + + return slug; + }; + + /** + * Helpers + */ + + function escape(html, encode) { + if (encode) { + if (escape.escapeTest.test(html)) { + return html.replace(escape.escapeReplace, function (ch) { return escape.replacements[ch]; }); + } + } else { + if (escape.escapeTestNoEncode.test(html)) { + return html.replace(escape.escapeReplaceNoEncode, function (ch) { return escape.replacements[ch]; }); } } + + return html; } -}; - -/** - * Slugger generates header id - */ - -function Slugger () { - this.seen = {}; -} - -/** - * Convert string to unique id - */ - -Slugger.prototype.slug = function (value) { - var slug = value - .toLowerCase() - .trim() - .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '') - .replace(/\s/g, '-'); - - if (this.seen.hasOwnProperty(slug)) { - var originalSlug = slug; - do { - this.seen[originalSlug]++; - slug = originalSlug + '-' + this.seen[originalSlug]; - } while (this.seen.hasOwnProperty(slug)); + + escape.escapeTest = /[&<>"']/; + escape.escapeReplace = /[&<>"']/g; + escape.replacements = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + escape.escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/; + escape.escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g; + + function unescape(html) { + // 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) === '#') { + return n.charAt(1) === 'x' + ? String.fromCharCode(parseInt(n.substring(2), 16)) + : String.fromCharCode(+n.substring(1)); + } + return ''; + }); } - this.seen[slug] = 0; - - return slug; -}; - -/** - * Helpers - */ - -function escape(html, encode) { - if (encode) { - if (escape.escapeTest.test(html)) { - return html.replace(escape.escapeReplace, function (ch) { return escape.replacements[ch]; }); - } - } else { - if (escape.escapeTestNoEncode.test(html)) { - return html.replace(escape.escapeReplaceNoEncode, function (ch) { return escape.replacements[ch]; }); - } + + function edit(regex, opt) { + regex = regex.source || regex; + 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); + } + }; } - - return html; -} - -escape.escapeTest = /[&<>"']/; -escape.escapeReplace = /[&<>"']/g; -escape.replacements = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}; - -escape.escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/; -escape.escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g; - -function unescape(html) { - // 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) === '#') { - return n.charAt(1) === 'x' - ? String.fromCharCode(parseInt(n.substring(2), 16)) - : String.fromCharCode(+n.substring(1)); + + function cleanUrl(sanitize, base, href) { + if (sanitize) { + try { + var prot = decodeURIComponent(unescape(href)) + .replace(/[^\w:]/g, '') + .toLowerCase(); + } catch (e) { + return null; + } + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { + return null; + } } - return ''; - }); -} - -function edit(regex, opt) { - regex = regex.source || regex; - 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); + if (base && !originIndependentUrl.test(href)) { + href = resolveUrl(base, href); } - }; -} - -function cleanUrl(sanitize, base, href) { - if (sanitize) { try { - var prot = decodeURIComponent(unescape(href)) - .replace(/[^\w:]/g, '') - .toLowerCase(); + href = encodeURI(href).replace(/%25/g, '%'); } catch (e) { return null; } - if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { - return null; - } - } - if (base && !originIndependentUrl.test(href)) { - href = resolveUrl(base, href); + return href; } - try { - href = encodeURI(href).replace(/%25/g, '%'); - } catch (e) { - return null; - } - return href; -} - -function resolveUrl(base, href) { - if (!baseUrls[' ' + base]) { - // we can ignore everything in base after the last slash of its path component, - // but we might need to add _that_ - // https://tools.ietf.org/html/rfc3986#section-3 - if (/^[^:]+:\/*[^/]*$/.test(base)) { - baseUrls[' ' + base] = base + '/'; + + function resolveUrl(base, href) { + if (!baseUrls[' ' + base]) { + // we can ignore everything in base after the last slash of its path component, + // but we might need to add _that_ + // https://tools.ietf.org/html/rfc3986#section-3 + if (/^[^:]+:\/*[^/]*$/.test(base)) { + baseUrls[' ' + base] = base + '/'; + } else { + baseUrls[' ' + base] = rtrim(base, '/', true); + } + } + 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 { - baseUrls[' ' + base] = rtrim(base, '/', true); + return base + href; } } - 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 (; i < arguments.length; i++) { - target = arguments[i]; - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; + var baseUrls = {}; + var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; + + function noop() {} + noop.exec = noop; + + function merge(obj) { + var i = 1, + target, + key; + + for (; i < arguments.length; i++) { + target = arguments[i]; + for (key in target) { + if (Object.prototype.hasOwnProperty.call(target, key)) { + obj[key] = target[key]; + } } } + + return obj; } - - return obj; -} - -function splitCells(tableRow, count) { - // ensure that every cell-delimiting pipe has a space - // before it to distinguish it from an escaped pipe - var row = tableRow.replace(/\|/g, function (match, offset, str) { - var escaped = false, - curr = offset; - while (--curr >= 0 && str[curr] === '\\') escaped = !escaped; - if (escaped) { - // odd number of slashes means | is escaped - // so we leave it alone - return '|'; - } else { - // add space before unescaped | - return ' |'; - } - }), - cells = row.split(/ \|/), - i = 0; - - if (cells.length > count) { - cells.splice(count); - } else { - while (cells.length < count) cells.push(''); - } - - for (; i < cells.length; i++) { - // leading or trailing whitespace is ignored per the gfm spec - cells[i] = cells[i].trim().replace(/\\\|/g, '|'); - } - return cells; -} - -// Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). -// /c*$/ is vulnerable to REDOS. -// invert: Remove suffix of non-c chars instead. Default falsey. -function rtrim(str, c, invert) { - if (str.length === 0) { - return ''; - } - - // Length of suffix matching the invert condition. - var suffLen = 0; - - // Step left until we fail to match the invert condition. - while (suffLen < str.length) { - var currChar = str.charAt(str.length - suffLen - 1); - if (currChar === c && !invert) { - suffLen++; - } else if (currChar !== c && invert) { - suffLen++; + + function splitCells(tableRow, count) { + // ensure that every cell-delimiting pipe has a space + // before it to distinguish it from an escaped pipe + var row = tableRow.replace(/\|/g, function (match, offset, str) { + var escaped = false, + curr = offset; + while (--curr >= 0 && str[curr] === '\\') escaped = !escaped; + if (escaped) { + // odd number of slashes means | is escaped + // so we leave it alone + return '|'; + } else { + // add space before unescaped | + return ' |'; + } + }), + cells = row.split(/ \|/), + i = 0; + + if (cells.length > count) { + cells.splice(count); } else { - break; + while (cells.length < count) cells.push(''); } + + for (; i < cells.length; i++) { + // leading or trailing whitespace is ignored per the gfm spec + cells[i] = cells[i].trim().replace(/\\\|/g, '|'); + } + return cells; } - - return str.substr(0, str.length - suffLen); -} - -function findClosingBracket(str, b) { - if (str.indexOf(b[1]) === -1) { - return -1; - } - var level = 0; - for (var i = 0; i < str.length; i++) { - if (str[i] === '\\') { - i++; - } else if (str[i] === b[0]) { - level++; - } else if (str[i] === b[1]) { - level--; - if (level < 0) { - return i; + + // Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). + // /c*$/ is vulnerable to REDOS. + // invert: Remove suffix of non-c chars instead. Default falsey. + function rtrim(str, c, invert) { + if (str.length === 0) { + return ''; + } + + // Length of suffix matching the invert condition. + var suffLen = 0; + + // Step left until we fail to match the invert condition. + while (suffLen < str.length) { + var currChar = str.charAt(str.length - suffLen - 1); + if (currChar === c && !invert) { + suffLen++; + } else if (currChar !== c && invert) { + suffLen++; + } else { + break; } } + + return str.substr(0, str.length - suffLen); } - return -1; -} - -/** - * Marked - */ - -function marked(src, opt, callback) { - // 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'); + + function findClosingBracket(str, b) { + if (str.indexOf(b[1]) === -1) { + return -1; + } + var level = 0; + for (var i = 0; i < str.length; i++) { + if (str[i] === '\\') { + i++; + } else if (str[i] === b[0]) { + level++; + } else if (str[i] === b[1]) { + level--; + if (level < 0) { + return i; + } + } + } + return -1; } - - if (callback || typeof opt === 'function') { - if (!callback) { - callback = opt; - opt = null; + + /** + * Marked + */ + + function marked(src, opt, callback) { + // throw error in case of non string input + if (typeof src === 'undefined' || src === null) { + throw new Error('marked(): input parameter is undefined or null'); } - - opt = merge({}, marked.defaults, opt || {}); - - var highlight = opt.highlight, - tokens, - pending, - i = 0; - - try { - tokens = Lexer.lex(src, opt); - } catch (e) { - return callback(e); + if (typeof src !== 'string') { + throw new Error('marked(): input parameter is of type ' + + Object.prototype.toString.call(src) + ', string expected'); } - - pending = tokens.length; - - var done = function(err) { - if (err) { - opt.highlight = highlight; - return callback(err); + + if (callback || typeof opt === 'function') { + if (!callback) { + callback = opt; + opt = null; } - - var out; - + + opt = merge({}, marked.defaults, opt || {}); + + var highlight = opt.highlight, + tokens, + pending, + i = 0; + try { - out = Parser.parse(tokens, opt); + tokens = Lexer.lex(src, opt); } catch (e) { - err = e; + return callback(e); } - - opt.highlight = highlight; - - return err - ? callback(err) - : callback(null, out); - }; - - if (!highlight || highlight.length < 3) { - return done(); - } - - delete opt.highlight; - - if (!pending) return done(); - - for (; i < tokens.length; i++) { - (function(token) { - if (token.type !== 'code') { - return --pending || done(); + + pending = tokens.length; + + var done = function(err) { + if (err) { + opt.highlight = highlight; + return callback(err); + } + + var out; + + try { + out = Parser.parse(tokens, opt); + } catch (e) { + err = e; } - return highlight(token.text, token.lang, function(err, code) { - if (err) return done(err); - if (code == null || code === token.text) { + + opt.highlight = highlight; + + return err + ? callback(err) + : callback(null, out); + }; + + if (!highlight || highlight.length < 3) { + return done(); + } + + delete opt.highlight; + + if (!pending) return done(); + + for (; i < tokens.length; i++) { + (function(token) { + if (token.type !== 'code') { return --pending || done(); } - token.text = code; - token.escaped = true; - --pending || done(); - }); - })(tokens[i]); + return highlight(token.text, token.lang, function(err, code) { + if (err) return done(err); + if (code == null || code === token.text) { + return --pending || done(); + } + token.text = code; + token.escaped = true; + --pending || done(); + }); + })(tokens[i]); + } + + return; } - - return; - } - try { - if (opt) opt = merge({}, marked.defaults, opt); - return Parser.parse(Lexer.lex(src, opt), opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if ((opt || marked.defaults).silent) { - return '

    An error occurred:

    '
    -        + escape(e.message + '', true)
    -        + '
    '; + try { + if (opt) opt = merge({}, marked.defaults, opt); + return Parser.parse(Lexer.lex(src, opt), opt); + } catch (e) { + e.message += '\nPlease report this to https://github.com/markedjs/marked.'; + if ((opt || marked.defaults).silent) { + return '

    An error occurred:

    '
    +          + escape(e.message + '', true)
    +          + '
    '; + } + throw e; } - throw e; } -} - -/** - * Options - */ - -marked.options = -marked.setOptions = function(opt) { - merge(marked.defaults, opt); - return marked; -}; - -marked.getDefaults = function () { - return { - baseUrl: null, - breaks: false, - gfm: true, - headerIds: true, - headerPrefix: '', - highlight: null, - langPrefix: 'language-', - mangle: true, - pedantic: false, - renderer: new Renderer(), - sanitize: false, - sanitizer: null, - silent: false, - smartLists: false, - smartypants: false, - tables: true, - xhtml: false + + /** + * Options + */ + + marked.options = + marked.setOptions = function(opt) { + merge(marked.defaults, opt); + return marked; }; -}; - -marked.defaults = marked.getDefaults(); - -/** - * Expose - */ - -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.Slugger = Slugger; - -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)); + + marked.getDefaults = function () { + return { + baseUrl: null, + breaks: false, + gfm: true, + headerIds: true, + headerPrefix: '', + highlight: null, + langPrefix: 'language-', + mangle: true, + pedantic: false, + renderer: new Renderer(), + sanitize: false, + sanitizer: null, + silent: false, + smartLists: false, + smartypants: false, + tables: true, + xhtml: false + }; + }; + + marked.defaults = marked.getDefaults(); + + /** + * Expose + */ + + 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.Slugger = Slugger; + + 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/specs/commonmark/commonmark.0.28.json b/test/specs/commonmark/commonmark.0.28.json index 5b5001cd79..164044903c 100644 --- a/test/specs/commonmark/commonmark.0.28.json +++ b/test/specs/commonmark/commonmark.0.28.json @@ -3231,8 +3231,7 @@ "html": "

    foo bar

    \n", "markdown": "*foo [*bar*](/url)*\n", "example": 396, - "start_line": 6675, - "shouldFail": true + "start_line": 6675 }, { "end_line": 6688, @@ -3726,8 +3725,7 @@ "html": "

    a *

    \n", "markdown": "*a `*`*\n", "example": 455, - "start_line": 7139, - "shouldFail": true + "start_line": 7139 }, { "end_line": 7150, From add24ca26c7553fa9077aa83aca087314b328363 Mon Sep 17 00:00:00 2001 From: x13machine Date: Thu, 21 Mar 2019 01:41:52 -0500 Subject: [PATCH 04/10] fixed example #452 --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 255a1d200b..ec934cf299 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -542,7 +542,7 @@ reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, - em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, + em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, br: /^( {2,}|\\)\n(?!\s*$)/, del: noop, From dd696a779274da6a1b65f87b356baab6ea304618 Mon Sep 17 00:00:00 2001 From: x13machine Date: Thu, 21 Mar 2019 01:50:47 -0500 Subject: [PATCH 05/10] lint --- lib/marked.js | 2906 ++++++++++++++++++++++++------------------------- 1 file changed, 1453 insertions(+), 1453 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index ec934cf299..eef9c8833f 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -5,22 +5,22 @@ */ ;(function(root) { - 'use strict'; - - /** +'use strict'; + +/** * Block-Level Grammar */ - - 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: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: '^ {0,3}(?:' // optional indentation + +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: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, + html: '^ {0,3}(?:' // optional indentation + '<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) + '|comment[^\\n]*(\\n+|$)' // (2) + '|<\\?[\\s\\S]*?\\?>\\n*' // (3) @@ -30,939 +30,939 @@ + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag + '|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + ')', - def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, - table: noop, - lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/, - text: /^[^\n]+/ - }; - - block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; - block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; - block.def = edit(block.def) - .replace('label', block._label) - .replace('title', block._title) - .getRegex(); - - block.bullet = /(?:[*+-]|\d{1,9}\.)/; - 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 = 'address|article|aside|base|basefont|blockquote|body|caption' + 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|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/, + text: /^[^\n]+/ +}; + +block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; +block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; +block.def = edit(block.def) + .replace('label', block._label) + .replace('title', block._title) + .getRegex(); + +block.bullet = /(?:[*+-]|\d{1,9}\.)/; +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 = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul'; - block._comment = //; - block.html = edit(block.html, 'i') - .replace('comment', block._comment) - .replace('tag', block._tag) - .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) - .getRegex(); - - block.paragraph = edit(block.paragraph) - .replace('hr', block.hr) - .replace('heading', block.heading) - .replace('lheading', block.lheading) - .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks - .getRegex(); - - block.blockquote = edit(block.blockquote) - .replace('paragraph', block.paragraph) - .getRegex(); - - /** +block._comment = //; +block.html = edit(block.html, 'i') + .replace('comment', block._comment) + .replace('tag', block._tag) + .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) + .getRegex(); + +block.paragraph = edit(block.paragraph) + .replace('hr', block.hr) + .replace('heading', block.heading) + .replace('lheading', block.lheading) + .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks + .getRegex(); + +block.blockquote = edit(block.blockquote) + .replace('paragraph', block.paragraph) + .getRegex(); + +/** * Normal Block Grammar */ - - block.normal = merge({}, block); - - /** + +block.normal = merge({}, block); + +/** * GFM Block Grammar */ - - block.gfm = merge({}, block.normal, { - fences: /^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/, - paragraph: /^/, - heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ - }); - - block.gfm.paragraph = edit(block.paragraph) - .replace('(?!', '(?!' + +block.gfm = merge({}, block.normal, { + fences: /^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\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(); - - /** + .getRegex(); + +/** * GFM + Tables Block Grammar */ - - block.tables = merge({}, block.gfm, { - nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/, - table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ - }); - - /** + +block.tables = merge({}, block.gfm, { + nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/, + table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ +}); + +/** * Pedantic grammar */ - - block.pedantic = merge({}, block.normal, { - html: edit( - '^ *(?:comment *(?:\\n|\\s*$)' + +block.pedantic = merge({}, block.normal, { + html: edit( + '^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') - .replace('comment', block._comment) - .replace(/tag/g, '(?!(?:' + .replace('comment', block._comment) + .replace(/tag/g, '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b') - .getRegex(), - def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/ - }); - - /** + .getRegex(), + def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/ +}); + +/** * Block Lexer */ - - function Lexer(options) { - this.tokens = []; - this.tokens.links = Object.create(null); - this.options = options || marked.defaults; - this.rules = block.normal; - - if (this.options.pedantic) { - this.rules = block.pedantic; - } else if (this.options.gfm) { - if (this.options.tables) { - this.rules = block.tables; - } else { - this.rules = block.gfm; - } + +function Lexer(options) { + this.tokens = []; + this.tokens.links = Object.create(null); + this.options = options || marked.defaults; + this.rules = block.normal; + + if (this.options.pedantic) { + this.rules = block.pedantic; + } else if (this.options.gfm) { + if (this.options.tables) { + this.rules = block.tables; + } else { + this.rules = block.gfm; } } - - /** +} + +/** * Expose Block Rules */ - - Lexer.rules = block; - - /** + +Lexer.rules = block; + +/** * Static Lex Method */ - - Lexer.lex = function(src, options) { - var lexer = new Lexer(options); - return lexer.lex(src); - }; - - /** + +Lexer.lex = function(src, options) { + var lexer = new Lexer(options); + return lexer.lex(src); +}; + +/** * Preprocessing */ - - 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.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); +}; + +/** * Lexing */ - - Lexer.prototype.token = function(src, top) { - src = src.replace(/^ +$/gm, ''); - var next, - loose, - cap, - bull, - b, - item, - listStart, - listItems, - t, - space, - i, - tag, - l, - isordered, - istask, - ischecked; - - while (src) { - // newline - if (cap = this.rules.newline.exec(src)) { - src = src.substring(cap[0].length); - if (cap[0].length > 1) { - this.tokens.push({ - type: 'space' - }); - } - } - - // code - 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 - ? rtrim(cap, '\n') - : cap - }); - continue; - } - - // fences (gfm) - if (cap = this.rules.fences.exec(src)) { - src = src.substring(cap[0].length); + +Lexer.prototype.token = function(src, top) { + src = src.replace(/^ +$/gm, ''); + var next, + loose, + cap, + bull, + b, + item, + listStart, + listItems, + t, + space, + i, + tag, + l, + isordered, + istask, + ischecked; + + while (src) { + // newline + if (cap = this.rules.newline.exec(src)) { + src = src.substring(cap[0].length); + if (cap[0].length > 1) { this.tokens.push({ - type: 'code', - lang: cap[2] ? cap[2].trim() : cap[2], - text: cap[3] || '' + type: 'space' }); - continue; } - - // heading - if (cap = this.rules.heading.exec(src)) { + } + + // code + 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 + ? rtrim(cap, '\n') + : cap + }); + continue; + } + + // fences (gfm) + if (cap = this.rules.fences.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'code', + lang: cap[2] ? cap[2].trim() : cap[2], + text: cap[3] || '' + }); + continue; + } + + // heading + 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; + } + + // table no leading pipe (gfm) + if (cap = this.rules.nptable.exec(src)) { + item = { + type: 'table', + header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] + }; + + if (item.header.length === item.align.length) { src = src.substring(cap[0].length); - this.tokens.push({ - type: 'heading', - depth: cap[1].length, - text: cap[2] - }); - continue; - } - - // table no leading pipe (gfm) - if (cap = this.rules.nptable.exec(src)) { - item = { - type: 'table', - header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] - }; - - if (item.header.length === item.align.length) { - src = src.substring(cap[0].length); - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = splitCells(item.cells[i], item.header.length); + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; } - - this.tokens.push(item); - - continue; } - } - - // hr - if (cap = this.rules.hr.exec(src)) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'hr' - }); + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = splitCells(item.cells[i], item.header.length); + } + + this.tokens.push(item); + continue; } - - // blockquote - if (cap = this.rules.blockquote.exec(src)) { - src = src.substring(cap[0].length); - - this.tokens.push({ - type: 'blockquote_start' - }); - - cap = cap[0].replace(/^ *> ?/gm, ''); - - // Pass `top` to keep the current - // "toplevel" state. This is exactly - // how markdown.pl works. - this.token(cap, top); - + } + + // hr + if (cap = this.rules.hr.exec(src)) { + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'hr' + }); + continue; + } + + // blockquote + if (cap = this.rules.blockquote.exec(src)) { + src = src.substring(cap[0].length); + + this.tokens.push({ + type: 'blockquote_start' + }); + + cap = cap[0].replace(/^ *> ?/gm, ''); + + // Pass `top` to keep the current + // "toplevel" state. This is exactly + // how markdown.pl works. + this.token(cap, top); + + this.tokens.push({ + type: 'blockquote_end' + }); + + continue; + } + + // list + if (cap = this.rules.list.exec(src)) { + src = src.substring(cap[0].length); + bull = cap[2]; + isordered = bull.length > 1; + + listStart = { + type: 'list_start', + ordered: isordered, + start: isordered ? +bull : '', + loose: false + }; + + this.tokens.push(listStart); + + // Get each top-level item. + cap = cap[0].match(this.rules.item); + + listItems = []; + next = false; + l = cap.length; + i = 0; + + for (; i < l; i++) { + item = cap[i]; + + // Remove the list item's bullet + // so it is seen as the next token. + space = item.length; + item = item.replace(/^ *([*+-]|\d+\.) */, ''); + + // Outdent whatever the + // list item contains. Hacky. + if (~item.indexOf('\n ')) { + space -= item.length; + item = !this.options.pedantic + ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') + : item.replace(/^ {1,4}/gm, ''); + } + + // Determine whether the next list item belongs here. + // Backpedal if it does not belong in this list. + if (i !== l - 1) { + b = block.bullet.exec(cap[i + 1])[0]; + if (bull.length > 1 ? b.length === 1 + : (b.length > 1 || (this.options.smartLists && b !== bull))) { + src = cap.slice(i + 1).join('\n') + src; + i = l - 1; + } + } + + // Determine whether item is loose or not. + // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ + // for discount behavior. + loose = next || /\n\n(?!\s*$)/.test(item); + if (i !== l - 1) { + next = item.charAt(item.length - 1) === '\n'; + if (!loose) loose = next; + } + + if (loose) { + listStart.loose = true; + } + + // Check for task list items + istask = /^\[[ xX]\] /.test(item); + ischecked = undefined; + if (istask) { + ischecked = item[1] !== ' '; + item = item.replace(/^\[[ xX]\] +/, ''); + } + + t = { + type: 'list_item_start', + task: istask, + checked: ischecked, + loose: loose + }; + + listItems.push(t); + this.tokens.push(t); + + // Recurse. + this.token(item, false); + this.tokens.push({ - type: 'blockquote_end' + type: 'list_item_end' }); - - continue; } - - // list - if (cap = this.rules.list.exec(src)) { - src = src.substring(cap[0].length); - bull = cap[2]; - isordered = bull.length > 1; - - listStart = { - type: 'list_start', - ordered: isordered, - start: isordered ? +bull : '', - loose: false - }; - - this.tokens.push(listStart); - - // Get each top-level item. - cap = cap[0].match(this.rules.item); - - listItems = []; - next = false; - l = cap.length; + + if (listStart.loose) { + l = listItems.length; i = 0; - for (; i < l; i++) { - item = cap[i]; - - // Remove the list item's bullet - // so it is seen as the next token. - space = item.length; - item = item.replace(/^ *([*+-]|\d+\.) */, ''); - - // Outdent whatever the - // list item contains. Hacky. - if (~item.indexOf('\n ')) { - space -= item.length; - item = !this.options.pedantic - ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') - : item.replace(/^ {1,4}/gm, ''); - } - - // Determine whether the next list item belongs here. - // Backpedal if it does not belong in this list. - if (i !== l - 1) { - b = block.bullet.exec(cap[i + 1])[0]; - if (bull.length > 1 ? b.length === 1 - : (b.length > 1 || (this.options.smartLists && b !== bull))) { - src = cap.slice(i + 1).join('\n') + src; - i = l - 1; - } - } - - // Determine whether item is loose or not. - // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ - // for discount behavior. - loose = next || /\n\n(?!\s*$)/.test(item); - if (i !== l - 1) { - next = item.charAt(item.length - 1) === '\n'; - if (!loose) loose = next; - } - - if (loose) { - listStart.loose = true; - } - - // Check for task list items - istask = /^\[[ xX]\] /.test(item); - ischecked = undefined; - if (istask) { - ischecked = item[1] !== ' '; - item = item.replace(/^\[[ xX]\] +/, ''); - } - - t = { - type: 'list_item_start', - task: istask, - checked: ischecked, - loose: loose - }; - - listItems.push(t); - this.tokens.push(t); - - // Recurse. - this.token(item, false); - - this.tokens.push({ - type: 'list_item_end' - }); + listItems[i].loose = true; } - - if (listStart.loose) { - l = listItems.length; - i = 0; - for (; i < l; i++) { - listItems[i].loose = true; - } - } - - this.tokens.push({ - type: 'list_end' - }); - - continue; } - - // html - 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 + + this.tokens.push({ + type: 'list_end' + }); + + continue; + } + + // html + 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; + text: cap[0] + }); + continue; + } + + // def + 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().replace(/\s+/g, ' '); + if (!this.tokens.links[tag]) { + this.tokens.links[tag] = { + href: cap[2], + title: cap[3] + }; } - - // def - if (top && (cap = this.rules.def.exec(src))) { + continue; + } + + // table (gfm) + if (cap = this.rules.table.exec(src)) { + item = { + type: 'table', + header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] + }; + + if (item.header.length === item.align.length) { src = src.substring(cap[0].length); - if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1); - tag = cap[1].toLowerCase().replace(/\s+/g, ' '); - if (!this.tokens.links[tag]) { - this.tokens.links[tag] = { - href: cap[2], - title: cap[3] - }; - } - continue; - } - - // table (gfm) - if (cap = this.rules.table.exec(src)) { - item = { - type: 'table', - header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] - }; - - if (item.header.length === item.align.length) { - src = src.substring(cap[0].length); - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = splitCells( - item.cells[i].replace(/^ *\| *| *\| *$/g, ''), - item.header.length); + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; } - - this.tokens.push(item); - - 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); - this.tokens.push({ - type: 'paragraph', - text: cap[1].charAt(cap[1].length - 1) === '\n' - ? cap[1].slice(0, -1) - : cap[1] - }); - continue; - } - - // text - if (cap = this.rules.text.exec(src)) { - // Top-level should never reach here. - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'text', - text: cap[0] - }); + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = splitCells( + item.cells[i].replace(/^ *\| *| *\| *$/g, ''), + item.header.length); + } + + this.tokens.push(item); + continue; } - - if (src) { - throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); - } } - - return this.tokens; - }; - - /** + + // 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); + this.tokens.push({ + type: 'paragraph', + text: cap[1].charAt(cap[1].length - 1) === '\n' + ? cap[1].slice(0, -1) + : cap[1] + }); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + // Top-level should never reach here. + src = src.substring(cap[0].length); + this.tokens.push({ + type: 'text', + text: cap[0] + }); + continue; + } + + if (src) { + throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return this.tokens; +}; + +/** * Inline-Level Grammar */ - - var inline = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: noop, - tag: '^comment' + +var inline = { + escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, + autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, + url: noop, + tag: '^comment' + '|^' // self-closing tag + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. + '|^' // declaration, e.g. + '|^', // CDATA section - link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, - nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, - strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, - em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: noop, - text: /^(`+|[^`])[\s\S]*?(?=[\\?@\\[^_{|}~'; - inline.em = edit(inline.em).replace(/punctuation/g, inline._punctuation).getRegex(); - - inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g; - - 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.autolink = edit(inline.autolink) - .replace('scheme', inline._scheme) - .replace('email', inline._email) - .getRegex(); - - inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; - - inline.tag = edit(inline.tag) - .replace('comment', block._comment) - .replace('attribute', inline._attribute) - .getRegex(); - - inline._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|`(?!`)|[^\[\]\\`])*?/; - inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*)/; - inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; - - inline.link = edit(inline.link) - .replace('label', inline._label) - .replace('href', inline._href) - .replace('title', inline._title) - .getRegex(); - - inline.reflink = edit(inline.reflink) - .replace('label', inline._label) - .getRegex(); - - /** + link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/, + reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, + nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, + strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, + em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, + code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, + br: /^( {2,}|\\)\n(?!\s*$)/, + del: noop, + text: /^(`+|[^`])[\s\S]*?(?=[\\?@\\[^_{|}~'; +inline.em = edit(inline.em).replace(/punctuation/g, inline._punctuation).getRegex(); + +inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g; + +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.autolink = edit(inline.autolink) + .replace('scheme', inline._scheme) + .replace('email', inline._email) + .getRegex(); + +inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; + +inline.tag = edit(inline.tag) + .replace('comment', block._comment) + .replace('attribute', inline._attribute) + .getRegex(); + +inline._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|`(?!`)|[^\[\]\\`])*?/; +inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*)/; +inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; + +inline.link = edit(inline.link) + .replace('label', inline._label) + .replace('href', inline._href) + .replace('title', inline._title) + .getRegex(); + +inline.reflink = edit(inline.reflink) + .replace('label', inline._label) + .getRegex(); + +/** * Normal Inline Grammar */ - - inline.normal = merge({}, inline); - - /** + +inline.normal = merge({}, inline); + +/** * Pedantic Inline Grammar */ - - inline.pedantic = merge({}, inline.normal, { - strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, - link: edit(/^!?\[(label)\]\((.*?)\)/) - .replace('label', inline._label) - .getRegex(), - reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) - .replace('label', inline._label) - .getRegex() - }); - - /** + +inline.pedantic = merge({}, inline.normal, { + strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, + em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, + link: edit(/^!?\[(label)\]\((.*?)\)/) + .replace('label', inline._label) + .getRegex(), + reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) + .replace('label', inline._label) + .getRegex() +}); + +/** * GFM Inline Grammar */ - - inline.gfm = merge({}, inline.normal, { - escape: edit(inline.escape).replace('])', '~|])').getRegex(), - _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, - url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, - _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.gfm.url = edit(inline.gfm.url, 'i') - .replace('email', inline.gfm._extended_email) - .getRegex(); - /** + +inline.gfm = merge({}, inline.normal, { + escape: edit(inline.escape).replace('])', '~|])').getRegex(), + _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, + url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, + _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.gfm.url = edit(inline.gfm.url, 'i') + .replace('email', inline.gfm._extended_email) + .getRegex(); +/** * GFM + Line Breaks Inline Grammar */ - - inline.breaks = merge({}, inline.gfm, { - br: edit(inline.br).replace('{2,}', '*').getRegex(), - text: edit(inline.gfm.text).replace('{2,}', '*').getRegex() - }); - - /** + +inline.breaks = merge({}, inline.gfm, { + br: edit(inline.br).replace('{2,}', '*').getRegex(), + text: edit(inline.gfm.text).replace('{2,}', '*').getRegex() +}); + +/** * Inline Lexer & Compiler */ - - 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.pedantic) { - this.rules = inline.pedantic; - } else if (this.options.gfm) { - if (this.options.breaks) { - this.rules = inline.breaks; - } else { - this.rules = inline.gfm; - } + +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.pedantic) { + this.rules = inline.pedantic; + } else if (this.options.gfm) { + if (this.options.breaks) { + this.rules = inline.breaks; + } else { + this.rules = inline.gfm; } } - - /** +} + +/** * Expose Inline Rules */ - - InlineLexer.rules = inline; - - /** + +InlineLexer.rules = inline; + +/** * Static Lexing/Compiling Method */ - - InlineLexer.output = function(src, links, options) { - var inline = new InlineLexer(links, options); - return inline.output(src); - }; - - /** + +InlineLexer.output = function(src, links, options) { + var inline = new InlineLexer(links, options); + return inline.output(src); +}; + +/** * Lexing/Compiling */ - - InlineLexer.prototype.output = function(src) { - var out = '', - link, - text, - href, - title, - cap, - prevCapZero; - - while (src) { - // escape - if (cap = this.rules.escape.exec(src)) { - src = src.substring(cap[0].length); - out += escape(cap[1]); - continue; - } - - // tag - if (cap = this.rules.tag.exec(src)) { - if (!this.inLink && /^/i.test(cap[0])) { - this.inLink = false; - } - if (!this.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.inRawBlock = true; - } else if (this.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this.inRawBlock = 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; - } - - // link - if (cap = this.rules.link.exec(src)) { - var lastParenIndex = findClosingBracket(cap[2], '()'); - if (lastParenIndex > -1) { - var linkLen = cap[0].length - (cap[2].length - lastParenIndex) - (cap[3] || '').length; - cap[2] = cap[2].substring(0, lastParenIndex); - cap[0] = cap[0].substring(0, linkLen).trim(); - cap[3] = ''; - } - src = src.substring(cap[0].length); - this.inLink = true; - href = cap[2]; - if (this.options.pedantic) { - link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); - - if (link) { - href = link[1]; - title = link[3]; - } else { - title = ''; - } - } else { - title = cap[3] ? cap[3].slice(1, -1) : ''; - } - href = href.trim().replace(/^<([\s\S]*)>$/, '$1'); - out += this.outputLink(cap, { - href: InlineLexer.escapes(href), - title: InlineLexer.escapes(title) - }); - this.inLink = false; - continue; - } - - // reflink, nolink - 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; - } + +InlineLexer.prototype.output = function(src) { + var out = '', + link, + text, + href, + title, + cap, + prevCapZero; + + while (src) { + // escape + if (cap = this.rules.escape.exec(src)) { + src = src.substring(cap[0].length); + out += escape(cap[1]); + continue; + } + + // tag + if (cap = this.rules.tag.exec(src)) { + if (!this.inLink && /^/i.test(cap[0])) { this.inLink = false; - continue; } - - // strong - if (cap = this.rules.strong.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1])); - continue; + if (!this.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.inRawBlock = true; + } else if (this.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.inRawBlock = false; } - - // em - if (cap = this.rules.em.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1])); - continue; - } - - // code - if (cap = this.rules.code.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.codespan(escape(cap[2].trim(), true)); - continue; - } - - // br - if (cap = this.rules.br.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.br(); - continue; - } - - // del (gfm) - if (cap = this.rules.del.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.del(this.output(cap[1])); - continue; + + src = src.substring(cap[0].length); + out += this.options.sanitize + ? this.options.sanitizer + ? this.options.sanitizer(cap[0]) + : escape(cap[0]) + : cap[0]; + continue; + } + + // link + if (cap = this.rules.link.exec(src)) { + var lastParenIndex = findClosingBracket(cap[2], '()'); + if (lastParenIndex > -1) { + var linkLen = cap[0].length - (cap[2].length - lastParenIndex) - (cap[3] || '').length; + cap[2] = cap[2].substring(0, lastParenIndex); + cap[0] = cap[0].substring(0, linkLen).trim(); + cap[3] = ''; } - - // autolink - 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; + src = src.substring(cap[0].length); + this.inLink = true; + href = cap[2]; + if (this.options.pedantic) { + link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); + + if (link) { + href = link[1]; + title = link[3]; } else { - text = escape(cap[1]); - href = text; + title = ''; } - out += this.renderer.link(href, null, text); - continue; + } else { + title = cap[3] ? cap[3].slice(1, -1) : ''; } - - // url (gfm) - if (!this.inLink && (cap = this.rules.url.exec(src))) { - if (cap[2] === '@') { - text = escape(cap[0]); - href = 'mailto:' + text; - } else { - // do extended autolink path validation - do { - prevCapZero = cap[0]; - cap[0] = this.rules._backpedal.exec(cap[0])[0]; - } while (prevCapZero !== cap[0]); - text = escape(cap[0]); - if (cap[1] === 'www.') { - href = 'http://' + text; - } else { - href = text; - } - } - src = src.substring(cap[0].length); - out += this.renderer.link(href, null, text); + href = href.trim().replace(/^<([\s\S]*)>$/, '$1'); + out += this.outputLink(cap, { + href: InlineLexer.escapes(href), + title: InlineLexer.escapes(title) + }); + this.inLink = false; + continue; + } + + // reflink, nolink + 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; } - - // text - if (cap = this.rules.text.exec(src)) { - src = src.substring(cap[0].length); - if (this.inRawBlock) { - out += this.renderer.text(cap[0]); + this.inLink = true; + out += this.outputLink(cap, link); + this.inLink = false; + continue; + } + + // strong + if (cap = this.rules.strong.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1])); + continue; + } + + // em + if (cap = this.rules.em.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1])); + continue; + } + + // code + if (cap = this.rules.code.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.codespan(escape(cap[2].trim(), true)); + continue; + } + + // br + if (cap = this.rules.br.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.br(); + continue; + } + + // del (gfm) + if (cap = this.rules.del.exec(src)) { + src = src.substring(cap[0].length); + out += this.renderer.del(this.output(cap[1])); + continue; + } + + // autolink + 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; + } + + // url (gfm) + if (!this.inLink && (cap = this.rules.url.exec(src))) { + if (cap[2] === '@') { + text = escape(cap[0]); + href = 'mailto:' + text; + } else { + // do extended autolink path validation + do { + prevCapZero = cap[0]; + cap[0] = this.rules._backpedal.exec(cap[0])[0]; + } while (prevCapZero !== cap[0]); + text = escape(cap[0]); + if (cap[1] === 'www.') { + href = 'http://' + text; } else { - out += this.renderer.text(escape(this.smartypants(cap[0]))); + href = text; } - continue; } - - if (src) { - throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); + src = src.substring(cap[0].length); + out += this.renderer.link(href, null, text); + continue; + } + + // text + if (cap = this.rules.text.exec(src)) { + src = src.substring(cap[0].length); + if (this.inRawBlock) { + out += this.renderer.text(cap[0]); + } else { + out += this.renderer.text(escape(this.smartypants(cap[0]))); } + continue; } - - return out; - }; - - InlineLexer.escapes = function(text) { - return text ? text.replace(InlineLexer.rules._escapes, '$1') : text; - }; - - /** + + if (src) { + throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return out; +}; + +InlineLexer.escapes = function(text) { + return text ? text.replace(InlineLexer.rules._escapes, '$1') : text; +}; + +/** * Compile Link */ - - InlineLexer.prototype.outputLink = function(cap, link) { - var href = 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.outputLink = function(cap, link) { + var href = 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])); +}; + +/** * Smartypants Transformations */ - - InlineLexer.prototype.smartypants = function(text) { - if (!this.options.smartypants) return text; - return text - // em-dashes - .replace(/---/g, '\u2014') - // en-dashes - .replace(/--/g, '\u2013') - // opening singles - .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') - // closing singles & apostrophes - .replace(/'/g, '\u2019') - // opening doubles - .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') - // closing doubles - .replace(/"/g, '\u201d') - // ellipses - .replace(/\.{3}/g, '\u2026'); - }; - - /** + +InlineLexer.prototype.smartypants = function(text) { + if (!this.options.smartypants) return text; + return text + // em-dashes + .replace(/---/g, '\u2014') + // en-dashes + .replace(/--/g, '\u2013') + // opening singles + .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') + // closing singles & apostrophes + .replace(/'/g, '\u2019') + // opening doubles + .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') + // closing doubles + .replace(/"/g, '\u201d') + // ellipses + .replace(/\.{3}/g, '\u2026'); +}; + +/** * Mangle Links */ - - InlineLexer.prototype.mangle = function(text) { - if (!this.options.mangle) return text; - var out = '', - l = text.length, - i = 0, - ch; - - for (; i < l; i++) { - ch = text.charCodeAt(i); - if (Math.random() > 0.5) { - ch = 'x' + ch.toString(16); - } - out += '&#' + ch + ';'; + +InlineLexer.prototype.mangle = function(text) { + if (!this.options.mangle) return text; + var out = '', + l = text.length, + i = 0, + ch; + + for (; i < l; i++) { + ch = text.charCodeAt(i); + if (Math.random() > 0.5) { + ch = 'x' + ch.toString(16); } - - return out; - }; - - /** + out += '&#' + ch + ';'; + } + + return out; +}; + +/** * Renderer */ - - function Renderer(options) { - this.options = options || marked.defaults; - } - - Renderer.prototype.code = function(code, infostring, escaped) { - var lang = (infostring || '').match(/\S*/)[0]; - if (this.options.highlight) { - var out = this.options.highlight(code, lang); - if (out != null && out !== code) { - escaped = true; - code = out; - } + +function Renderer(options) { + this.options = options || marked.defaults; +} + +Renderer.prototype.code = function(code, infostring, escaped) { + var lang = (infostring || '').match(/\S*/)[0]; + if (this.options.highlight) { + var out = this.options.highlight(code, lang); + if (out != null && out !== code) { + escaped = true; + code = out; } - - if (!lang) { - return '
    '
    +  }
    +
    +  if (!lang) {
    +    return '
    '
             + (escaped ? code : escape(code, true))
             + '
    '; - } - - return '
    '
           + (escaped ? code : escape(code, true))
           + '
    \n'; - }; - - Renderer.prototype.blockquote = function(quote) { - return '
    \n' + quote + '
    \n'; - }; - - Renderer.prototype.html = function(html) { - return html; - }; - - Renderer.prototype.heading = function(text, level, raw, slugger) { - if (this.options.headerIds) { - return '\n' + quote + '\n'; +}; + +Renderer.prototype.html = function(html) { + return html; +}; + +Renderer.prototype.heading = function(text, level, raw, slugger) { + if (this.options.headerIds) { + return '\n' + body + '\n'; - }; - - Renderer.prototype.listitem = function(text) { - return '
  • ' + text + '
  • \n'; - }; - - Renderer.prototype.checkbox = function(checked) { - 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.checkbox = function(checked) { + return ' '; - }; - - Renderer.prototype.paragraph = function(text) { - return '

    ' + text + '

    \n'; - }; - - Renderer.prototype.table = function(header, body) { - if (body) body = '' + body + ''; - - return '\n' + + '> '; +}; + +Renderer.prototype.paragraph = function(text) { + return '

    ' + text + '

    \n'; +}; + +Renderer.prototype.table = function(header, body) { + if (body) body = '' + body + ''; + + return '
    \n' + '\n' + header + '\n' + body + '
    \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 + ' align="' + flags.align + '">' - : '<' + type + '>'; - return tag + content + '\n'; - }; - - // span level renderer - 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) { - href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); - if (href === null) { - return text; - } - var out = '
    '; - return out; - }; - - Renderer.prototype.image = function(href, title, text) { - href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); - if (href === null) { - return text; - } - - var out = '' + text + '' : '>'; - return out; - }; - - Renderer.prototype.text = function(text) { +}; + +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 + ' align="' + flags.align + '">' + : '<' + type + '>'; + return tag + content + '\n'; +}; + +// span level renderer +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) { + href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); + if (href === null) { return text; - }; - - /** + } + var out = '
    '; + return out; +}; + +Renderer.prototype.image = function(href, title, text) { + href = cleanUrl(this.options.sanitize, this.options.baseUrl, href); + if (href === null) { + return text; + } + + var out = '' + text + '' : '>'; + return out; +}; + +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 = + +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.link = TextRenderer.prototype.image = function(href, title, text) { return '' + text; }; - - TextRenderer.prototype.br = function() { - return ''; - }; - - /** + +TextRenderer.prototype.br = function() { + return ''; +}; + +/** * Parsing & Compiling */ - - 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; - this.slugger = new Slugger(); - } - - /** + +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; + this.slugger = new Slugger(); +} + +/** * Static Parse Method */ - - Parser.parse = function(src, options) { - var parser = new Parser(options); - return parser.parse(src); - }; - - /** + +Parser.parse = function(src, options) { + var parser = new Parser(options); + return parser.parse(src); +}; + +/** * Parse Loop */ - - 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 = ''; - while (this.next()) { - out += this.tok(); - } - - return out; - }; - - /** + +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 = ''; + while (this.next()) { + out += this.tok(); + } + + return out; +}; + +/** * Next Token */ - - Parser.prototype.next = function() { - return this.token = this.tokens.pop(); - }; - - /** + +Parser.prototype.next = function() { + return this.token = this.tokens.pop(); +}; + +/** * Preview Next Token */ - - Parser.prototype.peek = function() { - return this.tokens[this.tokens.length - 1] || 0; - }; - - /** + +Parser.prototype.peek = function() { + return this.tokens[this.tokens.length - 1] || 0; +}; + +/** * Parse Text Tokens */ - - 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.parseText = function() { + var body = this.token.text; + + while (this.peek().type === 'text') { + body += '\n' + this.next().text; + } + + return this.inline.output(body); +}; + +/** * Parse Current Token */ - - 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)), - this.slugger); - } - case 'code': { - return this.renderer.code(this.token.text, - this.token.lang, - this.token.escaped); + +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)), + this.slugger); + } + case 'code': { + return this.renderer.code(this.token.text, + this.token.lang, + this.token.escaped); + } + case 'table': { + var header = '', + body = '', + i, + row, + cell, + j; + + // header + cell = ''; + for (i = 0; i < this.token.header.length; i++) { + cell += this.renderer.tablecell( + this.inline.output(this.token.header[i]), + { header: true, align: this.token.align[i] } + ); } - case 'table': { - var header = '', - body = '', - i, - row, - cell, - j; - - // header + header += this.renderer.tablerow(cell); + + for (i = 0; i < this.token.cells.length; i++) { + row = this.token.cells[i]; + cell = ''; - for (i = 0; i < this.token.header.length; i++) { + for (j = 0; j < row.length; j++) { cell += this.renderer.tablecell( - this.inline.output(this.token.header[i]), - { header: true, align: this.token.align[i] } + this.inline.output(row[j]), + { header: false, align: this.token.align[j] } ); } - header += this.renderer.tablerow(cell); - - for (i = 0; i < this.token.cells.length; i++) { - row = this.token.cells[i]; - - cell = ''; - for (j = 0; j < row.length; j++) { - cell += this.renderer.tablecell( - this.inline.output(row[j]), - { header: false, align: this.token.align[j] } - ); - } - - body += this.renderer.tablerow(cell); - } - return this.renderer.table(header, body); - } - case 'blockquote_start': { - body = ''; - - while (this.next().type !== 'blockquote_end') { - body += this.tok(); - } - - return this.renderer.blockquote(body); - } - case 'list_start': { - body = ''; - var ordered = this.token.ordered, - start = this.token.start; - - while (this.next().type !== 'list_end') { - body += this.tok(); - } - - return this.renderer.list(body, ordered, start); + + body += this.renderer.tablerow(cell); } - case 'list_item_start': { - body = ''; - var loose = this.token.loose; - var checked = this.token.checked; - var task = this.token.task; - - if (this.token.task) { - body += this.renderer.checkbox(checked); - } - - while (this.next().type !== 'list_item_end') { - body += !loose && this.token.type === 'text' - ? this.parseText() - : this.tok(); - } - return this.renderer.listitem(body, task, checked); + return this.renderer.table(header, body); + } + case 'blockquote_start': { + body = ''; + + while (this.next().type !== 'blockquote_end') { + body += this.tok(); } - case 'html': { - // TODO parse inline content if parameter markdown=1 - return this.renderer.html(this.token.text); + + return this.renderer.blockquote(body); + } + case 'list_start': { + body = ''; + var ordered = this.token.ordered, + start = this.token.start; + + while (this.next().type !== 'list_end') { + body += this.tok(); } - case 'paragraph': { - return this.renderer.paragraph(this.inline.output(this.token.text)); + + return this.renderer.list(body, ordered, start); + } + case 'list_item_start': { + body = ''; + var loose = this.token.loose; + var checked = this.token.checked; + var task = this.token.task; + + if (this.token.task) { + body += this.renderer.checkbox(checked); } - case 'text': { - return this.renderer.paragraph(this.parseText()); + + while (this.next().type !== 'list_item_end') { + body += !loose && this.token.type === 'text' + ? this.parseText() + : this.tok(); } - default: { - var errMsg = 'Token with "' + this.token.type + '" type was not found.'; - if (this.options.silent) { - console.log(errMsg); - } else { - throw new Error(errMsg); - } + return this.renderer.listitem(body, task, checked); + } + case 'html': { + // TODO parse inline content if parameter markdown=1 + return this.renderer.html(this.token.text); + } + case 'paragraph': { + return this.renderer.paragraph(this.inline.output(this.token.text)); + } + case 'text': { + return this.renderer.paragraph(this.parseText()); + } + default: { + var errMsg = 'Token with "' + this.token.type + '" type was not found.'; + if (this.options.silent) { + console.log(errMsg); + } else { + throw new Error(errMsg); } } - }; - - /** + } +}; + +/** * Slugger generates header id */ - - function Slugger () { - this.seen = {}; - } - - /** + +function Slugger () { + this.seen = {}; +} + +/** * Convert string to unique id */ - - Slugger.prototype.slug = function (value) { - var slug = value - .toLowerCase() - .trim() - .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '') - .replace(/\s/g, '-'); - - if (this.seen.hasOwnProperty(slug)) { - var originalSlug = slug; - do { - this.seen[originalSlug]++; - slug = originalSlug + '-' + this.seen[originalSlug]; - } while (this.seen.hasOwnProperty(slug)); - } - this.seen[slug] = 0; - - return slug; - }; - - /** + +Slugger.prototype.slug = function (value) { + var slug = value + .toLowerCase() + .trim() + .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '') + .replace(/\s/g, '-'); + + if (this.seen.hasOwnProperty(slug)) { + var originalSlug = slug; + do { + this.seen[originalSlug]++; + slug = originalSlug + '-' + this.seen[originalSlug]; + } while (this.seen.hasOwnProperty(slug)); + } + this.seen[slug] = 0; + + return slug; +}; + +/** * Helpers */ - - function escape(html, encode) { - if (encode) { - if (escape.escapeTest.test(html)) { - return html.replace(escape.escapeReplace, function (ch) { return escape.replacements[ch]; }); - } - } else { - if (escape.escapeTestNoEncode.test(html)) { - return html.replace(escape.escapeReplaceNoEncode, function (ch) { return escape.replacements[ch]; }); - } + +function escape(html, encode) { + if (encode) { + if (escape.escapeTest.test(html)) { + return html.replace(escape.escapeReplace, function (ch) { return escape.replacements[ch]; }); + } + } else { + if (escape.escapeTestNoEncode.test(html)) { + return html.replace(escape.escapeReplaceNoEncode, function (ch) { return escape.replacements[ch]; }); } - - return html; - } - - escape.escapeTest = /[&<>"']/; - escape.escapeReplace = /[&<>"']/g; - escape.replacements = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - escape.escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/; - escape.escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g; - - function unescape(html) { - // 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) === '#') { - 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 || regex; - 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 cleanUrl(sanitize, base, href) { - if (sanitize) { - try { - var prot = decodeURIComponent(unescape(href)) - .replace(/[^\w:]/g, '') - .toLowerCase(); - } catch (e) { - return null; - } - if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { - return null; - } + + return html; +} + +escape.escapeTest = /[&<>"']/; +escape.escapeReplace = /[&<>"']/g; +escape.replacements = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}; + +escape.escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/; +escape.escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g; + +function unescape(html) { + // 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) === '#') { + return n.charAt(1) === 'x' + ? String.fromCharCode(parseInt(n.substring(2), 16)) + : String.fromCharCode(+n.substring(1)); } - if (base && !originIndependentUrl.test(href)) { - href = resolveUrl(base, href); + return ''; + }); +} + +function edit(regex, opt) { + regex = regex.source || regex; + 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 cleanUrl(sanitize, base, href) { + if (sanitize) { try { - href = encodeURI(href).replace(/%25/g, '%'); + var prot = decodeURIComponent(unescape(href)) + .replace(/[^\w:]/g, '') + .toLowerCase(); } catch (e) { return null; } - return href; - } - - function resolveUrl(base, href) { - if (!baseUrls[' ' + base]) { - // we can ignore everything in base after the last slash of its path component, - // but we might need to add _that_ - // https://tools.ietf.org/html/rfc3986#section-3 - if (/^[^:]+:\/*[^/]*$/.test(base)) { - baseUrls[' ' + base] = base + '/'; - } else { - baseUrls[' ' + base] = rtrim(base, '/', true); - } + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { + return null; } - 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; + } + if (base && !originIndependentUrl.test(href)) { + href = resolveUrl(base, href); + } + try { + href = encodeURI(href).replace(/%25/g, '%'); + } catch (e) { + return null; + } + return href; +} + +function resolveUrl(base, href) { + if (!baseUrls[' ' + base]) { + // we can ignore everything in base after the last slash of its path component, + // but we might need to add _that_ + // https://tools.ietf.org/html/rfc3986#section-3 + if (/^[^:]+:\/*[^/]*$/.test(base)) { + baseUrls[' ' + base] = base + '/'; } else { - return base + href; + baseUrls[' ' + base] = rtrim(base, '/', true); } } - var baseUrls = {}; - var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; - - function noop() {} - noop.exec = noop; - - function merge(obj) { - var i = 1, - target, - key; - - for (; i < arguments.length; i++) { - target = arguments[i]; - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; - } + 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 (; i < arguments.length; i++) { + target = arguments[i]; + for (key in target) { + if (Object.prototype.hasOwnProperty.call(target, key)) { + obj[key] = target[key]; } } - - return obj; } - - function splitCells(tableRow, count) { - // ensure that every cell-delimiting pipe has a space - // before it to distinguish it from an escaped pipe - var row = tableRow.replace(/\|/g, function (match, offset, str) { - var escaped = false, - curr = offset; - while (--curr >= 0 && str[curr] === '\\') escaped = !escaped; - if (escaped) { - // odd number of slashes means | is escaped - // so we leave it alone - return '|'; - } else { - // add space before unescaped | - return ' |'; - } - }), - cells = row.split(/ \|/), - i = 0; - - if (cells.length > count) { - cells.splice(count); + + return obj; +} + +function splitCells(tableRow, count) { + // ensure that every cell-delimiting pipe has a space + // before it to distinguish it from an escaped pipe + var row = tableRow.replace(/\|/g, function (match, offset, str) { + var escaped = false, + curr = offset; + while (--curr >= 0 && str[curr] === '\\') escaped = !escaped; + if (escaped) { + // odd number of slashes means | is escaped + // so we leave it alone + return '|'; + } else { + // add space before unescaped | + return ' |'; + } + }), + cells = row.split(/ \|/), + i = 0; + + if (cells.length > count) { + cells.splice(count); + } else { + while (cells.length < count) cells.push(''); + } + + for (; i < cells.length; i++) { + // leading or trailing whitespace is ignored per the gfm spec + cells[i] = cells[i].trim().replace(/\\\|/g, '|'); + } + return cells; +} + +// Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). +// /c*$/ is vulnerable to REDOS. +// invert: Remove suffix of non-c chars instead. Default falsey. +function rtrim(str, c, invert) { + if (str.length === 0) { + return ''; + } + + // Length of suffix matching the invert condition. + var suffLen = 0; + + // Step left until we fail to match the invert condition. + while (suffLen < str.length) { + var currChar = str.charAt(str.length - suffLen - 1); + if (currChar === c && !invert) { + suffLen++; + } else if (currChar !== c && invert) { + suffLen++; } else { - while (cells.length < count) cells.push(''); - } - - for (; i < cells.length; i++) { - // leading or trailing whitespace is ignored per the gfm spec - cells[i] = cells[i].trim().replace(/\\\|/g, '|'); + break; } - return cells; } - - // Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). - // /c*$/ is vulnerable to REDOS. - // invert: Remove suffix of non-c chars instead. Default falsey. - function rtrim(str, c, invert) { - if (str.length === 0) { - return ''; - } - - // Length of suffix matching the invert condition. - var suffLen = 0; - - // Step left until we fail to match the invert condition. - while (suffLen < str.length) { - var currChar = str.charAt(str.length - suffLen - 1); - if (currChar === c && !invert) { - suffLen++; - } else if (currChar !== c && invert) { - suffLen++; - } else { - break; - } - } - - return str.substr(0, str.length - suffLen); + + return str.substr(0, str.length - suffLen); +} + +function findClosingBracket(str, b) { + if (str.indexOf(b[1]) === -1) { + return -1; } - - function findClosingBracket(str, b) { - if (str.indexOf(b[1]) === -1) { - return -1; - } - var level = 0; - for (var i = 0; i < str.length; i++) { - if (str[i] === '\\') { - i++; - } else if (str[i] === b[0]) { - level++; - } else if (str[i] === b[1]) { - level--; - if (level < 0) { - return i; - } + var level = 0; + for (var i = 0; i < str.length; i++) { + if (str[i] === '\\') { + i++; + } else if (str[i] === b[0]) { + level++; + } else if (str[i] === b[1]) { + level--; + if (level < 0) { + return i; } } - return -1; } - - /** + return -1; +} + +/** * Marked */ - - function marked(src, opt, callback) { - // 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 ' + +function marked(src, opt, callback) { + // 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) { + callback = opt; + opt = null; } - - if (callback || typeof opt === 'function') { - if (!callback) { - callback = opt; - opt = null; + + opt = merge({}, marked.defaults, opt || {}); + + var highlight = opt.highlight, + tokens, + pending, + i = 0; + + try { + tokens = Lexer.lex(src, opt); + } catch (e) { + return callback(e); + } + + pending = tokens.length; + + var done = function(err) { + if (err) { + opt.highlight = highlight; + return callback(err); } - - opt = merge({}, marked.defaults, opt || {}); - - var highlight = opt.highlight, - tokens, - pending, - i = 0; - + + var out; + try { - tokens = Lexer.lex(src, opt); + out = Parser.parse(tokens, opt); } catch (e) { - return callback(e); + err = e; } - - pending = tokens.length; - - var done = function(err) { - if (err) { - opt.highlight = highlight; - return callback(err); - } - - var out; - - try { - out = Parser.parse(tokens, opt); - } catch (e) { - err = e; + + opt.highlight = highlight; + + return err + ? callback(err) + : callback(null, out); + }; + + if (!highlight || highlight.length < 3) { + return done(); + } + + delete opt.highlight; + + if (!pending) return done(); + + for (; i < tokens.length; i++) { + (function(token) { + if (token.type !== 'code') { + return --pending || done(); } - - opt.highlight = highlight; - - return err - ? callback(err) - : callback(null, out); - }; - - if (!highlight || highlight.length < 3) { - return done(); - } - - delete opt.highlight; - - if (!pending) return done(); - - for (; i < tokens.length; i++) { - (function(token) { - if (token.type !== 'code') { + return highlight(token.text, token.lang, function(err, code) { + if (err) return done(err); + if (code == null || code === token.text) { return --pending || done(); } - return highlight(token.text, token.lang, function(err, code) { - if (err) return done(err); - if (code == null || code === token.text) { - return --pending || done(); - } - token.text = code; - token.escaped = true; - --pending || done(); - }); - })(tokens[i]); - } - - return; + token.text = code; + token.escaped = true; + --pending || done(); + }); + })(tokens[i]); } - try { - if (opt) opt = merge({}, marked.defaults, opt); - return Parser.parse(Lexer.lex(src, opt), opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if ((opt || marked.defaults).silent) { - return '

    An error occurred:

    '
    +
    +    return;
    +  }
    +  try {
    +    if (opt) opt = merge({}, marked.defaults, opt);
    +    return Parser.parse(Lexer.lex(src, opt), opt);
    +  } catch (e) {
    +    e.message += '\nPlease report this to https://github.com/markedjs/marked.';
    +    if ((opt || marked.defaults).silent) {
    +      return '

    An error occurred:

    '
               + escape(e.message + '', true)
               + '
    '; - } - throw e; } + throw e; } - - /** +} + +/** * Options */ - - marked.options = + +marked.options = marked.setOptions = function(opt) { merge(marked.defaults, opt); return marked; }; - - marked.getDefaults = function () { - return { - baseUrl: null, - breaks: false, - gfm: true, - headerIds: true, - headerPrefix: '', - highlight: null, - langPrefix: 'language-', - mangle: true, - pedantic: false, - renderer: new Renderer(), - sanitize: false, - sanitizer: null, - silent: false, - smartLists: false, - smartypants: false, - tables: true, - xhtml: false - }; + +marked.getDefaults = function () { + return { + baseUrl: null, + breaks: false, + gfm: true, + headerIds: true, + headerPrefix: '', + highlight: null, + langPrefix: 'language-', + mangle: true, + pedantic: false, + renderer: new Renderer(), + sanitize: false, + sanitizer: null, + silent: false, + smartLists: false, + smartypants: false, + tables: true, + xhtml: false }; - - marked.defaults = marked.getDefaults(); - - /** +}; + +marked.defaults = marked.getDefaults(); + +/** * Expose */ - - 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.Slugger = Slugger; - - 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 + +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.Slugger = Slugger; + +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)); From a92adde53846feb51129bc3acd78cea52ec499e2 Mon Sep 17 00:00:00 2001 From: x13machine Date: Thu, 21 Mar 2019 02:02:30 -0500 Subject: [PATCH 06/10] fixed *"* bug --- lib/marked.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index eef9c8833f..a46ab264e0 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -542,7 +542,7 @@ var inline = { reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, - em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, + em: /^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, br: /^( {2,}|\\)\n(?!\s*$)/, del: noop, From 2fbadaf5f40d05b4569c5078583ab61bf04a7524 Mon Sep 17 00:00:00 2001 From: x13machine Date: Thu, 21 Mar 2019 12:10:31 -0500 Subject: [PATCH 07/10] fix syntax --- lib/marked.js | 302 +++++++++++++++++++++++++------------------------- 1 file changed, 151 insertions(+), 151 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index a46ab264e0..c77c8f8abb 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -8,8 +8,8 @@ 'use strict'; /** - * Block-Level Grammar - */ + * Block-Level Grammar + */ var block = { newline: /^\n+/, @@ -21,15 +21,15 @@ var block = { blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, html: '^ {0,3}(?:' // optional indentation - + '<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) - + '|comment[^\\n]*(\\n+|$)' // (2) - + '|<\\?[\\s\\S]*?\\?>\\n*' // (3) - + '|\\n*' // (4) - + '|\\n*' // (5) - + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) - + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag - + '|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag - + ')', + + '<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) + + '|comment[^\\n]*(\\n+|$)' // (2) + + '|<\\?[\\s\\S]*?\\?>\\n*' // (3) + + '|\\n*' // (4) + + '|\\n*' // (5) + + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) + + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag + + '|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + + ')', def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, table: noop, lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, @@ -57,11 +57,11 @@ block.list = edit(block.list) .getRegex(); block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' - + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' - + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' - + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' - + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' - + '|track|ul'; + + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + + '|track|ul'; block._comment = //; block.html = edit(block.html, 'i') .replace('comment', block._comment) @@ -81,14 +81,14 @@ block.blockquote = edit(block.blockquote) .getRegex(); /** - * Normal Block Grammar - */ + * Normal Block Grammar + */ block.normal = merge({}, block); /** - * GFM Block Grammar - */ + * GFM Block Grammar + */ block.gfm = merge({}, block.normal, { fences: /^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/, @@ -98,13 +98,13 @@ block.gfm = merge({}, block.normal, { block.gfm.paragraph = edit(block.paragraph) .replace('(?!', '(?!' - + block.gfm.fences.source.replace('\\1', '\\2') + '|' - + block.list.source.replace('\\1', '\\3') + '|') + + block.gfm.fences.source.replace('\\1', '\\2') + '|' + + block.list.source.replace('\\1', '\\3') + '|') .getRegex(); /** - * GFM + Tables Block Grammar - */ + * GFM + Tables Block Grammar + */ block.tables = merge({}, block.gfm, { nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/, @@ -112,26 +112,26 @@ block.tables = merge({}, block.gfm, { }); /** - * Pedantic grammar - */ + * Pedantic grammar + */ block.pedantic = merge({}, block.normal, { html: edit( '^ *(?:comment *(?:\\n|\\s*$)' - + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag - + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') + + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag + + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') .replace('comment', block._comment) .replace(/tag/g, '(?!(?:' - + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' - + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' - + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b') + + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub' + + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)' + + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b') .getRegex(), def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/ }); /** - * Block Lexer - */ + * Block Lexer + */ function Lexer(options) { this.tokens = []; @@ -151,14 +151,14 @@ function Lexer(options) { } /** - * Expose Block Rules - */ + * Expose Block Rules + */ Lexer.rules = block; /** - * Static Lex Method - */ + * Static Lex Method + */ Lexer.lex = function(src, options) { var lexer = new Lexer(options); @@ -166,8 +166,8 @@ Lexer.lex = function(src, options) { }; /** - * Preprocessing - */ + * Preprocessing + */ Lexer.prototype.lex = function(src) { src = src @@ -180,8 +180,8 @@ Lexer.prototype.lex = function(src) { }; /** - * Lexing - */ + * Lexing + */ Lexer.prototype.token = function(src, top) { src = src.replace(/^ +$/gm, ''); @@ -426,7 +426,7 @@ Lexer.prototype.token = function(src, top) { ? 'paragraph' : 'html', pre: !this.options.sanitizer - && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), + && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), text: cap[0] }); continue; @@ -525,19 +525,19 @@ Lexer.prototype.token = function(src, top) { }; /** - * Inline-Level Grammar - */ + * Inline-Level Grammar + */ var inline = { escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, url: noop, tag: '^comment' - + '|^' // self-closing tag - + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag - + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. - + '|^' // declaration, e.g. - + '|^', // CDATA section + + '|^' // self-closing tag + + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag + + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. + + '|^' // declaration, e.g. + + '|^', // CDATA section link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/, reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, @@ -585,14 +585,14 @@ inline.reflink = edit(inline.reflink) .getRegex(); /** - * Normal Inline Grammar - */ + * Normal Inline Grammar + */ inline.normal = merge({}, inline); /** - * Pedantic Inline Grammar - */ + * Pedantic Inline Grammar + */ inline.pedantic = merge({}, inline.normal, { strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, @@ -606,8 +606,8 @@ inline.pedantic = merge({}, inline.normal, { }); /** - * GFM Inline Grammar - */ + * GFM Inline Grammar + */ inline.gfm = merge({}, inline.normal, { escape: edit(inline.escape).replace('])', '~|])').getRegex(), @@ -625,8 +625,8 @@ inline.gfm.url = edit(inline.gfm.url, 'i') .replace('email', inline.gfm._extended_email) .getRegex(); /** - * GFM + Line Breaks Inline Grammar - */ + * GFM + Line Breaks Inline Grammar + */ inline.breaks = merge({}, inline.gfm, { br: edit(inline.br).replace('{2,}', '*').getRegex(), @@ -634,8 +634,8 @@ inline.breaks = merge({}, inline.gfm, { }); /** - * Inline Lexer & Compiler - */ + * Inline Lexer & Compiler + */ function InlineLexer(links, options) { this.options = options || marked.defaults; @@ -660,14 +660,14 @@ function InlineLexer(links, options) { } /** - * Expose Inline Rules - */ + * Expose Inline Rules + */ InlineLexer.rules = inline; /** - * Static Lexing/Compiling Method - */ + * Static Lexing/Compiling Method + */ InlineLexer.output = function(src, links, options) { var inline = new InlineLexer(links, options); @@ -675,8 +675,8 @@ InlineLexer.output = function(src, links, options) { }; /** - * Lexing/Compiling - */ + * Lexing/Compiling + */ InlineLexer.prototype.output = function(src) { var out = '', @@ -752,7 +752,7 @@ InlineLexer.prototype.output = function(src) { // reflink, nolink if ((cap = this.rules.reflink.exec(src)) - || (cap = this.rules.nolink.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()]; @@ -863,8 +863,8 @@ InlineLexer.escapes = function(text) { }; /** - * Compile Link - */ + * Compile Link + */ InlineLexer.prototype.outputLink = function(cap, link) { var href = link.href, @@ -876,31 +876,31 @@ InlineLexer.prototype.outputLink = function(cap, link) { }; /** - * Smartypants Transformations - */ + * Smartypants Transformations + */ InlineLexer.prototype.smartypants = function(text) { if (!this.options.smartypants) return text; return text - // em-dashes + // em-dashes .replace(/---/g, '\u2014') - // en-dashes + // en-dashes .replace(/--/g, '\u2013') - // opening singles + // opening singles .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') - // closing singles & apostrophes + // closing singles & apostrophes .replace(/'/g, '\u2019') - // opening doubles + // opening doubles .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') - // closing doubles + // closing doubles .replace(/"/g, '\u201d') - // ellipses + // ellipses .replace(/\.{3}/g, '\u2026'); }; /** - * Mangle Links - */ + * Mangle Links + */ InlineLexer.prototype.mangle = function(text) { if (!this.options.mangle) return text; @@ -921,8 +921,8 @@ InlineLexer.prototype.mangle = function(text) { }; /** - * Renderer - */ + * Renderer + */ function Renderer(options) { this.options = options || marked.defaults; @@ -940,16 +940,16 @@ Renderer.prototype.code = function(code, infostring, escaped) { if (!lang) { return '
    '
    -        + (escaped ? code : escape(code, true))
    -        + '
    '; + + (escaped ? code : escape(code, true)) + + '
    '; } return '
    '
    -      + (escaped ? code : escape(code, true))
    -      + '
    \n'; + + this.options.langPrefix + + escape(lang, true) + + '">' + + (escaped ? code : escape(code, true)) + + '
    \n'; }; Renderer.prototype.blockquote = function(quote) { @@ -963,15 +963,15 @@ Renderer.prototype.html = function(html) { Renderer.prototype.heading = function(text, level, raw, slugger) { if (this.options.headerIds) { return '' - + text - + '\n'; + + level + + ' id="' + + this.options.headerPrefix + + slugger.slug(raw) + + '">' + + text + + '\n'; } // ignore IDs return '' + text + '\n'; @@ -993,10 +993,10 @@ Renderer.prototype.listitem = function(text) { Renderer.prototype.checkbox = function(checked) { return ' '; + + (checked ? 'checked="" ' : '') + + 'disabled="" type="checkbox"' + + (this.options.xhtml ? ' /' : '') + + '> '; }; Renderer.prototype.paragraph = function(text) { @@ -1007,11 +1007,11 @@ Renderer.prototype.table = function(header, body) { if (body) body = '' + body + ''; return '\n' - + '\n' - + header - + '\n' - + body - + '
    \n'; + + '\n' + + header + + '\n' + + body + + '\n'; }; Renderer.prototype.tablerow = function(content) { @@ -1079,34 +1079,34 @@ Renderer.prototype.text = function(text) { }; /** - * TextRenderer - * returns only the textual part of the token - */ + * 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.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.image = function(href, title, text) { + return '' + text; +}; TextRenderer.prototype.br = function() { return ''; }; /** - * Parsing & Compiling - */ + * Parsing & Compiling + */ function Parser(options) { this.tokens = []; @@ -1119,8 +1119,8 @@ function Parser(options) { } /** - * Static Parse Method - */ + * Static Parse Method + */ Parser.parse = function(src, options) { var parser = new Parser(options); @@ -1128,8 +1128,8 @@ Parser.parse = function(src, options) { }; /** - * Parse Loop - */ + * Parse Loop + */ Parser.prototype.parse = function(src) { this.inline = new InlineLexer(src.links, this.options); @@ -1149,24 +1149,24 @@ Parser.prototype.parse = function(src) { }; /** - * Next Token - */ + * Next Token + */ Parser.prototype.next = function() { return this.token = this.tokens.pop(); }; /** - * Preview Next Token - */ + * Preview Next Token + */ Parser.prototype.peek = function() { return this.tokens[this.tokens.length - 1] || 0; }; /** - * Parse Text Tokens - */ + * Parse Text Tokens + */ Parser.prototype.parseText = function() { var body = this.token.text; @@ -1179,8 +1179,8 @@ Parser.prototype.parseText = function() { }; /** - * Parse Current Token - */ + * Parse Current Token + */ Parser.prototype.tok = function() { switch (this.token.type) { @@ -1294,16 +1294,16 @@ Parser.prototype.tok = function() { }; /** - * Slugger generates header id - */ + * Slugger generates header id + */ function Slugger () { this.seen = {}; } /** - * Convert string to unique id - */ + * Convert string to unique id + */ Slugger.prototype.slug = function (value) { var slug = value @@ -1325,8 +1325,8 @@ Slugger.prototype.slug = function (value) { }; /** - * Helpers - */ + * Helpers + */ function escape(html, encode) { if (encode) { @@ -1532,8 +1532,8 @@ function findClosingBracket(str, b) { } /** - * Marked - */ + * Marked + */ function marked(src, opt, callback) { // throw error in case of non string input @@ -1542,7 +1542,7 @@ function marked(src, opt, callback) { } if (typeof src !== 'string') { throw new Error('marked(): input parameter is of type ' - + Object.prototype.toString.call(src) + ', string expected'); + + Object.prototype.toString.call(src) + ', string expected'); } if (callback || typeof opt === 'function') { @@ -1621,22 +1621,22 @@ function marked(src, opt, callback) { e.message += '\nPlease report this to https://github.com/markedjs/marked.'; if ((opt || marked.defaults).silent) { return '

    An error occurred:

    '
    -          + escape(e.message + '', true)
    -          + '
    '; + + escape(e.message + '', true) + + ''; } throw e; } } /** - * Options - */ + * Options + */ marked.options = - marked.setOptions = function(opt) { - merge(marked.defaults, opt); - return marked; - }; +marked.setOptions = function(opt) { + merge(marked.defaults, opt); + return marked; +}; marked.getDefaults = function () { return { @@ -1663,8 +1663,8 @@ marked.getDefaults = function () { marked.defaults = marked.getDefaults(); /** - * Expose - */ + * Expose + */ marked.Parser = Parser; marked.parser = Parser.parse; From c1c1cfa263dc5465395f1f1b9bdbe22c5a8b9b32 Mon Sep 17 00:00:00 2001 From: x13machine Date: Tue, 21 May 2019 18:38:24 -0500 Subject: [PATCH 08/10] conflit fix --- ...monmark.0.28.json => commonmark.0.29.json} | 6370 +++++++++-------- 1 file changed, 3291 insertions(+), 3079 deletions(-) rename test/specs/commonmark/{commonmark.0.28.json => commonmark.0.29.json} (64%) diff --git a/test/specs/commonmark/commonmark.0.28.json b/test/specs/commonmark/commonmark.0.29.json similarity index 64% rename from test/specs/commonmark/commonmark.0.28.json rename to test/specs/commonmark/commonmark.0.29.json index 164044903c..ac86b64442 100644 --- a/test/specs/commonmark/commonmark.0.28.json +++ b/test/specs/commonmark/commonmark.0.29.json @@ -1,5112 +1,5324 @@ [ { - "end_line": 355, - "section": "Tabs", - "html": "
    foo\tbaz\t\tbim\n
    \n", "markdown": "\tfoo\tbaz\t\tbim\n", + "html": "
    foo\tbaz\t\tbim\n
    \n", "example": 1, - "start_line": 350 + "start_line": 352, + "end_line": 357, + "section": "Tabs" }, { - "end_line": 362, - "section": "Tabs", - "html": "
    foo\tbaz\t\tbim\n
    \n", "markdown": " \tfoo\tbaz\t\tbim\n", + "html": "
    foo\tbaz\t\tbim\n
    \n", "example": 2, - "start_line": 357 + "start_line": 359, + "end_line": 364, + "section": "Tabs" }, { - "end_line": 371, - "section": "Tabs", - "html": "
    a\ta\nὐ\ta\n
    \n", "markdown": " a\ta\n ὐ\ta\n", + "html": "
    a\ta\nὐ\ta\n
    \n", "example": 3, - "start_line": 364 + "start_line": 366, + "end_line": 373, + "section": "Tabs" }, { - "end_line": 388, - "section": "Tabs", - "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", "markdown": " - foo\n\n\tbar\n", + "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", "example": 4, - "start_line": 377 + "start_line": 379, + "end_line": 390, + "section": "Tabs" }, { - "end_line": 402, - "section": "Tabs", - "html": "
      \n
    • \n

      foo

      \n
        bar\n
      \n
    • \n
    \n", "markdown": "- foo\n\n\t\tbar\n", + "html": "
      \n
    • \n

      foo

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

    Foo

    \n", "markdown": "#\tFoo\n", + "html": "

    Foo

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

    +++

    \n", "markdown": "+++\n", + "html": "

    +++

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

    ===

    \n", "markdown": "===\n", + "html": "

    ===

    \n", "example": 15, - "start_line": 553 + "start_line": 555, + "end_line": 559, + "section": "Thematic breaks" }, { - "end_line": 570, - "section": "Thematic breaks", - "html": "

    --\n**\n__

    \n", "markdown": "--\n**\n__\n", + "html": "

    --\n**\n__

    \n", "example": 16, - "start_line": 562 + "start_line": 564, + "end_line": 572, + "section": "Thematic breaks" }, { - "end_line": 583, - "section": "Thematic breaks", - "html": "
    \n
    \n
    \n", "markdown": " ***\n ***\n ***\n", + "html": "
    \n
    \n
    \n", "example": 17, - "start_line": 575 + "start_line": 577, + "end_line": 585, + "section": "Thematic breaks" }, { - "end_line": 593, - "section": "Thematic breaks", - "html": "
    ***\n
    \n", "markdown": " ***\n", + "html": "
    ***\n
    \n", "example": 18, - "start_line": 588 + "start_line": 590, + "end_line": 595, + "section": "Thematic breaks" }, { - "end_line": 602, - "section": "Thematic breaks", - "html": "

    Foo\n***

    \n", "markdown": "Foo\n ***\n", + "html": "

    Foo\n***

    \n", "example": 19, - "start_line": 596 + "start_line": 598, + "end_line": 604, + "section": "Thematic breaks" }, { - "end_line": 611, - "section": "Thematic breaks", - "html": "
    \n", "markdown": "_____________________________________\n", + "html": "
    \n", "example": 20, - "start_line": 607 + "start_line": 609, + "end_line": 613, + "section": "Thematic breaks" }, { - "end_line": 620, - "section": "Thematic breaks", - "html": "
    \n", "markdown": " - - -\n", + "html": "
    \n", "example": 21, - "start_line": 616 + "start_line": 618, + "end_line": 622, + "section": "Thematic breaks" }, { - "end_line": 627, - "section": "Thematic breaks", - "html": "
    \n", "markdown": " ** * ** * ** * **\n", + "html": "
    \n", "example": 22, - "start_line": 623 + "start_line": 625, + "end_line": 629, + "section": "Thematic breaks" }, { - "end_line": 634, - "section": "Thematic breaks", - "html": "
    \n", "markdown": "- - - -\n", + "html": "
    \n", "example": 23, - "start_line": 630 + "start_line": 632, + "end_line": 636, + "section": "Thematic breaks" }, { - "end_line": 643, - "section": "Thematic breaks", - "html": "
    \n", "markdown": "- - - - \n", + "html": "
    \n", "example": 24, - "start_line": 639 + "start_line": 641, + "end_line": 645, + "section": "Thematic breaks" }, { - "end_line": 658, - "section": "Thematic breaks", - "html": "

    _ _ _ _ a

    \n

    a------

    \n

    ---a---

    \n", "markdown": "_ _ _ _ a\n\na------\n\n---a---\n", + "html": "

    _ _ _ _ a

    \n

    a------

    \n

    ---a---

    \n", "example": 25, - "start_line": 648 + "start_line": 650, + "end_line": 660, + "section": "Thematic breaks" }, { - "end_line": 668, - "section": "Thematic breaks", - "html": "

    -

    \n", "markdown": " *-*\n", + "html": "

    -

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

    Foo

    \n
    \n

    bar

    \n", "markdown": "Foo\n***\nbar\n", + "html": "

    Foo

    \n
    \n

    bar

    \n", "example": 28, - "start_line": 690 + "start_line": 692, + "end_line": 700, + "section": "Thematic breaks" }, { - "end_line": 714, - "section": "Thematic breaks", - "html": "

    Foo

    \n

    bar

    \n", "markdown": "Foo\n---\nbar\n", + "html": "

    Foo

    \n

    bar

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

    foo

    \n

    foo

    \n

    foo

    \n

    foo

    \n
    foo
    \n
    foo
    \n", "markdown": "# foo\n## foo\n### foo\n#### foo\n##### foo\n###### foo\n", + "html": "

    foo

    \n

    foo

    \n

    foo

    \n

    foo

    \n
    foo
    \n
    foo
    \n", "example": 32, - "start_line": 766 + "start_line": 768, + "end_line": 782, + "section": "ATX headings" }, { - "end_line": 789, - "section": "ATX headings", - "html": "

    ####### foo

    \n", "markdown": "####### foo\n", + "html": "

    ####### foo

    \n", "example": 33, - "start_line": 785 + "start_line": 787, + "end_line": 791, + "section": "ATX headings" }, { - "end_line": 807, - "section": "ATX headings", - "html": "

    #5 bolt

    \n

    #hashtag

    \n", "markdown": "#5 bolt\n\n#hashtag\n", + "html": "

    #5 bolt

    \n

    #hashtag

    \n", "example": 34, - "start_line": 800 + "start_line": 802, + "end_line": 809, + "section": "ATX headings" }, { - "end_line": 816, - "section": "ATX headings", - "html": "

    ## foo

    \n", "markdown": "\\## foo\n", + "html": "

    ## foo

    \n", "example": 35, - "start_line": 812 + "start_line": 814, + "end_line": 818, + "section": "ATX headings" }, { - "end_line": 825, - "section": "ATX headings", - "html": "

    foo bar *baz*

    \n", "markdown": "# foo *bar* \\*baz\\*\n", + "html": "

    foo bar *baz*

    \n", "example": 36, - "start_line": 821 + "start_line": 823, + "end_line": 827, + "section": "ATX headings" }, { - "end_line": 834, - "section": "ATX headings", - "html": "

    foo

    \n", "markdown": "# foo \n", + "html": "

    foo

    \n", "example": 37, - "start_line": 830 + "start_line": 832, + "end_line": 836, + "section": "ATX headings" }, { - "end_line": 847, - "section": "ATX headings", - "html": "

    foo

    \n

    foo

    \n

    foo

    \n", "markdown": " ### foo\n ## foo\n # foo\n", + "html": "

    foo

    \n

    foo

    \n

    foo

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

    foo\n# bar

    \n", "markdown": "foo\n # bar\n", + "html": "

    foo\n# bar

    \n", "example": 40, - "start_line": 860, - "shouldFail": true + "start_line": 862, + "end_line": 868, + "section": "ATX headings" }, { - "end_line": 877, - "section": "ATX headings", - "html": "

    foo

    \n

    bar

    \n", "markdown": "## foo ##\n ### bar ###\n", + "html": "

    foo

    \n

    bar

    \n", "example": 41, - "start_line": 871 + "start_line": 873, + "end_line": 879, + "section": "ATX headings" }, { - "end_line": 888, - "section": "ATX headings", - "html": "

    foo

    \n
    foo
    \n", "markdown": "# foo ##################################\n##### foo ##\n", + "html": "

    foo

    \n
    foo
    \n", "example": 42, - "start_line": 882 + "start_line": 884, + "end_line": 890, + "section": "ATX headings" }, { - "end_line": 897, - "section": "ATX headings", - "html": "

    foo

    \n", "markdown": "### foo ### \n", + "html": "

    foo

    \n", "example": 43, - "start_line": 893 + "start_line": 895, + "end_line": 899, + "section": "ATX headings" }, { - "end_line": 908, - "section": "ATX headings", - "html": "

    foo ### b

    \n", "markdown": "### foo ### b\n", + "html": "

    foo ### b

    \n", "example": 44, - "start_line": 904 + "start_line": 906, + "end_line": 910, + "section": "ATX headings" }, { - "end_line": 917, - "section": "ATX headings", - "html": "

    foo#

    \n", "markdown": "# foo#\n", + "html": "

    foo#

    \n", "example": 45, - "start_line": 913, + "start_line": 915, + "end_line": 919, + "section": "ATX headings", "shouldFail": true }, { - "end_line": 931, - "section": "ATX headings", - "html": "

    foo ###

    \n

    foo ###

    \n

    foo #

    \n", "markdown": "### foo \\###\n## foo #\\##\n# foo \\#\n", + "html": "

    foo ###

    \n

    foo ###

    \n

    foo #

    \n", "example": 46, - "start_line": 923, + "start_line": 925, + "end_line": 933, + "section": "ATX headings", "shouldFail": true }, { - "end_line": 945, - "section": "ATX headings", - "html": "
    \n

    foo

    \n
    \n", "markdown": "****\n## foo\n****\n", + "html": "
    \n

    foo

    \n
    \n", "example": 47, - "start_line": 937 + "start_line": 939, + "end_line": 947, + "section": "ATX headings" }, { - "end_line": 956, - "section": "ATX headings", - "html": "

    Foo bar

    \n

    baz

    \n

    Bar foo

    \n", "markdown": "Foo bar\n# baz\nBar foo\n", + "html": "

    Foo bar

    \n

    baz

    \n

    Bar foo

    \n", "example": 48, - "start_line": 948 + "start_line": 950, + "end_line": 958, + "section": "ATX headings" }, { - "end_line": 969, - "section": "ATX headings", - "html": "

    \n

    \n

    \n", "markdown": "## \n#\n### ###\n", + "html": "

    \n

    \n

    \n", "example": 49, - "start_line": 961, + "start_line": 963, + "end_line": 971, + "section": "ATX headings", "shouldFail": true }, { - "end_line": 1013, - "section": "Setext headings", - "html": "

    Foo bar

    \n

    Foo bar

    \n", "markdown": "Foo *bar*\n=========\n\nFoo *bar*\n---------\n", + "html": "

    Foo bar

    \n

    Foo bar

    \n", "example": 50, - "start_line": 1004 + "start_line": 1006, + "end_line": 1015, + "section": "Setext headings" }, { - "end_line": 1025, - "section": "Setext headings", - "html": "

    Foo bar\nbaz

    \n", "markdown": "Foo *bar\nbaz*\n====\n", + "html": "

    Foo bar\nbaz

    \n", "example": 51, - "start_line": 1018, + "start_line": 1020, + "end_line": 1027, + "section": "Setext headings", "shouldFail": true }, { - "end_line": 1039, - "section": "Setext headings", - "html": "

    Foo

    \n

    Foo

    \n", - "markdown": "Foo\n-------------------------\n\nFoo\n=\n", + "markdown": " Foo *bar\nbaz*\t\n====\n", + "html": "

    Foo bar\nbaz

    \n", "example": 52, - "start_line": 1030, + "start_line": 1034, + "end_line": 1041, + "section": "Setext headings", "shouldFail": true }, { - "end_line": 1058, - "section": "Setext headings", - "html": "

    Foo

    \n

    Foo

    \n

    Foo

    \n", - "markdown": " Foo\n---\n\n Foo\n-----\n\n Foo\n ===\n", + "markdown": "Foo\n-------------------------\n\nFoo\n=\n", + "html": "

    Foo

    \n

    Foo

    \n", "example": 53, - "start_line": 1045 + "start_line": 1046, + "end_line": 1055, + "section": "Setext headings", + "shouldFail": true }, { - "end_line": 1076, - "section": "Setext headings", - "html": "
    Foo\n---\n\nFoo\n
    \n
    \n", - "markdown": " Foo\n ---\n\n Foo\n---\n", + "markdown": " Foo\n---\n\n Foo\n-----\n\n Foo\n ===\n", + "html": "

    Foo

    \n

    Foo

    \n

    Foo

    \n", "example": 54, - "start_line": 1063 + "start_line": 1061, + "end_line": 1074, + "section": "Setext headings" }, { - "end_line": 1087, - "section": "Setext headings", - "html": "

    Foo

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

    Foo\n---

    \n", - "markdown": "Foo\n ---\n", + "markdown": "Foo\n ---- \n", + "html": "

    Foo

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

    Foo\n---

    \n", + "example": 57, + "start_line": 1108, "end_line": 1114, - "section": "Setext headings", - "html": "

    Foo\n= =

    \n

    Foo

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

    Foo\n= =

    \n

    Foo

    \n
    \n", + "example": 58, + "start_line": 1119, + "end_line": 1130, + "section": "Setext headings" }, { - "end_line": 1124, - "section": "Setext headings", - "html": "

    Foo

    \n", "markdown": "Foo \n-----\n", - "example": 58, - "start_line": 1119 + "html": "

    Foo

    \n", + "example": 59, + "start_line": 1135, + "end_line": 1140, + "section": "Setext headings" }, { - "end_line": 1134, - "section": "Setext headings", - "html": "

    Foo\\

    \n", "markdown": "Foo\\\n----\n", - "example": 59, - "start_line": 1129 + "html": "

    Foo\\

    \n", + "example": 60, + "start_line": 1145, + "end_line": 1150, + "section": "Setext headings" }, { - "end_line": 1153, - "section": "Setext headings", - "html": "

    `Foo

    \n

    `

    \n

    <a title="a lot

    \n

    of dashes"/>

    \n", "markdown": "`Foo\n----\n`\n\n
    \n", - "example": 60, - "start_line": 1140 + "html": "

    `Foo

    \n

    `

    \n

    <a title="a lot

    \n

    of dashes"/>

    \n", + "example": 61, + "start_line": 1156, + "end_line": 1169, + "section": "Setext headings" }, { - "end_line": 1167, - "section": "Setext headings", - "html": "
    \n

    Foo

    \n
    \n
    \n", "markdown": "> Foo\n---\n", - "example": 61, - "start_line": 1159 + "html": "
    \n

    Foo

    \n
    \n
    \n", + "example": 62, + "start_line": 1175, + "end_line": 1183, + "section": "Setext headings" }, { - "end_line": 1180, - "section": "Setext headings", - "html": "
    \n

    foo\nbar\n===

    \n
    \n", "markdown": "> foo\nbar\n===\n", - "example": 62, - "start_line": 1170, + "html": "
    \n

    foo\nbar\n===

    \n
    \n", + "example": 63, + "start_line": 1186, + "end_line": 1196, + "section": "Setext headings", "shouldFail": true }, { - "end_line": 1191, - "section": "Setext headings", - "html": "
      \n
    • Foo
    • \n
    \n
    \n", "markdown": "- Foo\n---\n", - "example": 63, - "start_line": 1183 + "html": "
      \n
    • Foo
    • \n
    \n
    \n", + "example": 64, + "start_line": 1199, + "end_line": 1207, + "section": "Setext headings" }, { - "end_line": 1205, - "section": "Setext headings", - "html": "

    Foo\nBar

    \n", "markdown": "Foo\nBar\n---\n", - "example": 64, - "start_line": 1198, + "html": "

    Foo\nBar

    \n", + "example": 65, + "start_line": 1214, + "end_line": 1221, + "section": "Setext headings", "shouldFail": true }, { - "end_line": 1223, - "section": "Setext headings", - "html": "
    \n

    Foo

    \n

    Bar

    \n

    Baz

    \n", "markdown": "---\nFoo\n---\nBar\n---\nBaz\n", - "example": 65, - "start_line": 1211 + "html": "
    \n

    Foo

    \n

    Bar

    \n

    Baz

    \n", + "example": 66, + "start_line": 1227, + "end_line": 1239, + "section": "Setext headings" }, { - "end_line": 1233, - "section": "Setext headings", - "html": "

    ====

    \n", "markdown": "\n====\n", - "example": 66, - "start_line": 1228 + "html": "

    ====

    \n", + "example": 67, + "start_line": 1244, + "end_line": 1249, + "section": "Setext headings" }, { - "end_line": 1246, - "section": "Setext headings", - "html": "
    \n
    \n", "markdown": "---\n---\n", - "example": 67, - "start_line": 1240 + "html": "
    \n
    \n", + "example": 68, + "start_line": 1256, + "end_line": 1262, + "section": "Setext headings" }, { - "end_line": 1257, - "section": "Setext headings", - "html": "
      \n
    • foo
    • \n
    \n
    \n", "markdown": "- foo\n-----\n", - "example": 68, - "start_line": 1249 + "html": "
      \n
    • foo
    • \n
    \n
    \n", + "example": 69, + "start_line": 1265, + "end_line": 1273, + "section": "Setext headings" }, { - "end_line": 1267, - "section": "Setext headings", - "html": "
    foo\n
    \n
    \n", "markdown": " foo\n---\n", - "example": 69, - "start_line": 1260 + "html": "
    foo\n
    \n
    \n", + "example": 70, + "start_line": 1276, + "end_line": 1283, + "section": "Setext headings" }, { - "end_line": 1278, - "section": "Setext headings", - "html": "
    \n

    foo

    \n
    \n
    \n", "markdown": "> foo\n-----\n", - "example": 70, - "start_line": 1270 + "html": "
    \n

    foo

    \n
    \n
    \n", + "example": 71, + "start_line": 1286, + "end_line": 1294, + "section": "Setext headings" }, { - "end_line": 1289, - "section": "Setext headings", - "html": "

    > foo

    \n", "markdown": "\\> foo\n------\n", - "example": 71, - "start_line": 1284 + "html": "

    > foo

    \n", + "example": 72, + "start_line": 1300, + "end_line": 1305, + "section": "Setext headings" }, { - "end_line": 1325, - "section": "Setext headings", - "html": "

    Foo

    \n

    bar

    \n

    baz

    \n", "markdown": "Foo\n\nbar\n---\nbaz\n", - "example": 72, - "start_line": 1315 + "html": "

    Foo

    \n

    bar

    \n

    baz

    \n", + "example": 73, + "start_line": 1331, + "end_line": 1341, + "section": "Setext headings" }, { - "end_line": 1343, - "section": "Setext headings", - "html": "

    Foo\nbar

    \n
    \n

    baz

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

    Foo\nbar

    \n
    \n

    baz

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

    Foo\nbar\n---\nbaz

    \n", - "markdown": "Foo\nbar\n\\---\nbaz\n", + "markdown": "Foo\nbar\n* * *\nbaz\n", + "html": "

    Foo\nbar

    \n
    \n

    baz

    \n", "example": 75, - "start_line": 1364 + "start_line": 1365, + "end_line": 1375, + "section": "Setext headings" }, { - "end_line": 1399, - "section": "Indented code blocks", - "html": "
    a simple\n  indented code block\n
    \n", - "markdown": " a simple\n indented code block\n", + "markdown": "Foo\nbar\n\\---\nbaz\n", + "html": "

    Foo\nbar\n---\nbaz

    \n", "example": 76, - "start_line": 1392 + "start_line": 1380, + "end_line": 1390, + "section": "Setext headings" }, { - "end_line": 1417, - "section": "Indented code blocks", - "html": "
      \n
    • \n

      foo

      \n

      bar

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

      foo

      \n
        \n
      • bar
      • \n
      \n
    2. \n
    \n", - "markdown": "1. foo\n\n - bar\n", + "markdown": " - foo\n\n bar\n", + "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", "example": 78, - "start_line": 1420 + "start_line": 1422, + "end_line": 1433, + "section": "Indented code blocks" }, { - "end_line": 1451, - "section": "Indented code blocks", - "html": "
    <a/>\n*hi*\n\n- one\n
    \n", - "markdown": "
    \n *hi*\n\n - one\n", + "markdown": "1. foo\n\n - bar\n", + "html": "
      \n
    1. \n

      foo

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

    Foo\nbar

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

    bar

    \n", - "markdown": " foo\nbar\n", + "markdown": "Foo\n bar\n\n", + "html": "

    Foo\nbar

    \n", "example": 83, - "start_line": 1508 + "start_line": 1510, + "end_line": 1517, + "section": "Indented code blocks" }, { - "end_line": 1536, - "section": "Indented code blocks", - "html": "

    Heading

    \n
    foo\n
    \n

    Heading

    \n
    foo\n
    \n
    \n", - "markdown": "# Heading\n foo\nHeading\n------\n foo\n----\n", + "markdown": " foo\nbar\n", + "html": "
    foo\n
    \n

    bar

    \n", "example": 84, - "start_line": 1521 + "start_line": 1524, + "end_line": 1531, + "section": "Indented code blocks" }, { - "end_line": 1548, - "section": "Indented code blocks", - "html": "
        foo\nbar\n
    \n", - "markdown": " foo\n bar\n", + "markdown": "# Heading\n foo\nHeading\n------\n foo\n----\n", + "html": "

    Heading

    \n
    foo\n
    \n

    Heading

    \n
    foo\n
    \n
    \n", "example": 85, - "start_line": 1541 + "start_line": 1537, + "end_line": 1552, + "section": "Indented code blocks" }, { - "end_line": 1563, - "section": "Indented code blocks", - "html": "
    foo\n
    \n", - "markdown": "\n \n foo\n \n\n", + "markdown": " foo\n bar\n", + "html": "
        foo\nbar\n
    \n", "example": 86, - "start_line": 1554 + "start_line": 1557, + "end_line": 1564, + "section": "Indented code blocks" }, { - "end_line": 1573, - "section": "Indented code blocks", - "html": "
    foo  \n
    \n", - "markdown": " foo \n", + "markdown": "\n \n foo\n \n\n", + "html": "
    foo\n
    \n", "example": 87, - "start_line": 1568 + "start_line": 1570, + "end_line": 1579, + "section": "Indented code blocks" }, { - "end_line": 1632, - "section": "Fenced code blocks", - "html": "
    <\n >\n
    \n", - "markdown": "```\n<\n >\n```\n", + "markdown": " foo \n", + "html": "
    foo  \n
    \n", "example": 88, - "start_line": 1623 + "start_line": 1584, + "end_line": 1589, + "section": "Indented code blocks" }, { - "end_line": 1646, - "section": "Fenced code blocks", + "markdown": "```\n<\n >\n```\n", "html": "
    <\n >\n
    \n", - "markdown": "~~~\n<\n >\n~~~\n", "example": 89, - "start_line": 1637 + "start_line": 1639, + "end_line": 1648, + "section": "Fenced code blocks" }, { - "end_line": 1656, - "section": "Fenced code blocks", - "html": "

    foo

    \n", - "markdown": "``\nfoo\n``\n", + "markdown": "~~~\n<\n >\n~~~\n", + "html": "
    <\n >\n
    \n", "example": 90, - "start_line": 1650 + "start_line": 1653, + "end_line": 1662, + "section": "Fenced code blocks" }, { - "end_line": 1670, - "section": "Fenced code blocks", - "html": "
    aaa\n~~~\n
    \n", - "markdown": "```\naaa\n~~~\n```\n", + "markdown": "``\nfoo\n``\n", + "html": "

    foo

    \n", "example": 91, - "start_line": 1661 + "start_line": 1666, + "end_line": 1672, + "section": "Fenced code blocks" }, { - "end_line": 1682, - "section": "Fenced code blocks", - "html": "
    aaa\n```\n
    \n", - "markdown": "~~~\naaa\n```\n~~~\n", + "markdown": "```\naaa\n~~~\n```\n", + "html": "
    aaa\n~~~\n
    \n", "example": 92, - "start_line": 1673 + "start_line": 1677, + "end_line": 1686, + "section": "Fenced code blocks" }, { - "end_line": 1696, - "section": "Fenced code blocks", + "markdown": "~~~\naaa\n```\n~~~\n", "html": "
    aaa\n```\n
    \n", - "markdown": "````\naaa\n```\n``````\n", "example": 93, - "start_line": 1687 + "start_line": 1689, + "end_line": 1698, + "section": "Fenced code blocks" }, { - "end_line": 1708, - "section": "Fenced code blocks", - "html": "
    aaa\n~~~\n
    \n", - "markdown": "~~~~\naaa\n~~~\n~~~~\n", + "markdown": "````\naaa\n```\n``````\n", + "html": "
    aaa\n```\n
    \n", "example": 94, - "start_line": 1699 + "start_line": 1703, + "end_line": 1712, + "section": "Fenced code blocks" }, { - "end_line": 1718, - "section": "Fenced code blocks", - "html": "
    \n", - "markdown": "```\n", + "markdown": "~~~~\naaa\n~~~\n~~~~\n", + "html": "
    aaa\n~~~\n
    \n", "example": 95, - "start_line": 1714 + "start_line": 1715, + "end_line": 1724, + "section": "Fenced code blocks" }, { - "end_line": 1731, - "section": "Fenced code blocks", - "html": "
    \n```\naaa\n
    \n", - "markdown": "`````\n\n```\naaa\n", + "markdown": "```\n", + "html": "
    \n", "example": 96, - "start_line": 1721 + "start_line": 1730, + "end_line": 1734, + "section": "Fenced code blocks" }, { - "end_line": 1745, - "section": "Fenced code blocks", - "html": "
    \n
    aaa\n
    \n
    \n

    bbb

    \n", - "markdown": "> ```\n> aaa\n\nbbb\n", + "markdown": "`````\n\n```\naaa\n", + "html": "
    \n```\naaa\n
    \n", "example": 97, - "start_line": 1734 + "start_line": 1737, + "end_line": 1747, + "section": "Fenced code blocks" }, { - "end_line": 1759, - "section": "Fenced code blocks", - "html": "
    \n  \n
    \n", - "markdown": "```\n\n \n```\n", + "markdown": "> ```\n> aaa\n\nbbb\n", + "html": "
    \n
    aaa\n
    \n
    \n

    bbb

    \n", "example": 98, - "start_line": 1750 + "start_line": 1750, + "end_line": 1761, + "section": "Fenced code blocks" }, { - "end_line": 1769, - "section": "Fenced code blocks", - "html": "
    \n", - "markdown": "```\n```\n", + "markdown": "```\n\n \n```\n", + "html": "
    \n  \n
    \n", "example": 99, - "start_line": 1764 + "start_line": 1766, + "end_line": 1775, + "section": "Fenced code blocks" }, { - "end_line": 1785, - "section": "Fenced code blocks", - "html": "
    aaa\naaa\n
    \n", - "markdown": " ```\n aaa\naaa\n```\n", + "markdown": "```\n```\n", + "html": "
    \n", "example": 100, - "start_line": 1776 + "start_line": 1780, + "end_line": 1785, + "section": "Fenced code blocks" }, { - "end_line": 1799, - "section": "Fenced code blocks", - "html": "
    aaa\naaa\naaa\n
    \n", - "markdown": " ```\naaa\n aaa\naaa\n ```\n", + "markdown": " ```\n aaa\naaa\n```\n", + "html": "
    aaa\naaa\n
    \n", "example": 101, - "start_line": 1788 + "start_line": 1792, + "end_line": 1801, + "section": "Fenced code blocks" }, { - "end_line": 1813, - "section": "Fenced code blocks", - "html": "
    aaa\n aaa\naaa\n
    \n", - "markdown": " ```\n aaa\n aaa\n aaa\n ```\n", + "markdown": " ```\naaa\n aaa\naaa\n ```\n", + "html": "
    aaa\naaa\naaa\n
    \n", "example": 102, - "start_line": 1802 + "start_line": 1804, + "end_line": 1815, + "section": "Fenced code blocks" }, { - "end_line": 1827, - "section": "Fenced code blocks", - "html": "
    ```\naaa\n```\n
    \n", - "markdown": " ```\n aaa\n ```\n", + "markdown": " ```\n aaa\n aaa\n aaa\n ```\n", + "html": "
    aaa\n aaa\naaa\n
    \n", "example": 103, - "start_line": 1818 + "start_line": 1818, + "end_line": 1829, + "section": "Fenced code blocks" }, { - "end_line": 1840, - "section": "Fenced code blocks", - "html": "
    aaa\n
    \n", - "markdown": "```\naaa\n ```\n", + "markdown": " ```\n aaa\n ```\n", + "html": "
    ```\naaa\n```\n
    \n", "example": 104, - "start_line": 1833 + "start_line": 1834, + "end_line": 1843, + "section": "Fenced code blocks" }, { - "end_line": 1850, - "section": "Fenced code blocks", + "markdown": "```\naaa\n ```\n", "html": "
    aaa\n
    \n", - "markdown": " ```\naaa\n ```\n", "example": 105, - "start_line": 1843 + "start_line": 1849, + "end_line": 1856, + "section": "Fenced code blocks" }, { - "end_line": 1863, - "section": "Fenced code blocks", - "html": "
    aaa\n    ```\n
    \n", - "markdown": "```\naaa\n ```\n", + "markdown": " ```\naaa\n ```\n", + "html": "
    aaa\n
    \n", "example": 106, - "start_line": 1855 + "start_line": 1859, + "end_line": 1866, + "section": "Fenced code blocks" }, { - "end_line": 1875, - "section": "Fenced code blocks", - "html": "

    \naaa

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

    \naaa

    \n", "example": 108, - "start_line": 1878 + "start_line": 1885, + "end_line": 1891, + "section": "Fenced code blocks" }, { - "end_line": 1903, - "section": "Fenced code blocks", - "html": "

    foo

    \n
    bar\n
    \n

    baz

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

    foo

    \n
    bar\n
    \n

    baz

    \n", - "markdown": "foo\n---\n~~~\nbar\n~~~\n# baz\n", + "markdown": "foo\n```\nbar\n```\nbaz\n", + "html": "

    foo

    \n
    bar\n
    \n

    baz

    \n", "example": 110, - "start_line": 1909 + "start_line": 1908, + "end_line": 1919, + "section": "Fenced code blocks" }, { - "end_line": 1940, - "section": "Fenced code blocks", - "html": "
    def foo(x)\n  return 3\nend\n
    \n", - "markdown": "```ruby\ndef foo(x)\n return 3\nend\n```\n", + "markdown": "foo\n---\n~~~\nbar\n~~~\n# baz\n", + "html": "

    foo

    \n
    bar\n
    \n

    baz

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

    aa\nfoo

    \n", - "markdown": "``` aa ```\nfoo\n", + "markdown": "````;\n````\n", + "html": "
    \n", "example": 114, - "start_line": 1967 + "start_line": 1975, + "end_line": 1980, + "section": "Fenced code blocks" }, { - "end_line": 1985, - "section": "Fenced code blocks", - "html": "
    ``` aaa\n
    \n", - "markdown": "```\n``` aaa\n```\n", + "markdown": "``` aa ```\nfoo\n", + "html": "

    aa\nfoo

    \n", "example": 115, - "start_line": 1978 + "start_line": 1985, + "end_line": 1991, + "section": "Fenced code blocks" }, { - "end_line": 2070, - "section": "HTML blocks", - "html": "
    \n
    \n**Hello**,\n

    world.\n

    \n
    \n", - "markdown": "
    \n
    \n**Hello**,\n\n_world_.\n
    \n
    \n", + "markdown": "~~~ aa ``` ~~~\nfoo\n~~~\n", + "html": "
    foo\n
    \n", "example": 116, - "start_line": 2055 + "start_line": 1996, + "end_line": 2003, + "section": "Fenced code blocks", + "shouldFail": true }, { - "end_line": 2103, - "section": "HTML blocks", - "html": "\n \n \n \n
    \n hi\n
    \n

    okay.

    \n", - "markdown": "\n \n \n \n
    \n hi\n
    \n\nokay.\n", + "markdown": "```\n``` aaa\n```\n", + "html": "
    ``` aaa\n
    \n", "example": 117, - "start_line": 2084 + "start_line": 2008, + "end_line": 2015, + "section": "Fenced code blocks" }, { - "end_line": 2114, - "section": "HTML blocks", - "html": "
    \n*foo*\n", + "markdown": "\n \n \n \n
    \n hi\n
    \n\nokay.\n", + "html": "\n \n \n \n
    \n hi\n
    \n

    okay.

    \n", "example": 119, - "start_line": 2119 + "start_line": 2116, + "end_line": 2135, + "section": "HTML blocks" }, { - "end_line": 2140, - "section": "HTML blocks", - "html": "
    \n

    Markdown

    \n
    \n", - "markdown": "
    \n\n*Markdown*\n\n
    \n", + "markdown": "
    \n*foo*\n", "example": 121, - "start_line": 2146 + "start_line": 2151, + "end_line": 2157, + "section": "HTML blocks" }, { - "end_line": 2165, - "section": "HTML blocks", - "html": "
    \n
    \n", - "markdown": "
    \n
    \n", + "markdown": "
    \n\n*Markdown*\n\n
    \n", + "html": "
    \n

    Markdown

    \n
    \n", "example": 122, - "start_line": 2157 + "start_line": 2162, + "end_line": 2172, + "section": "HTML blocks" }, { - "end_line": 2178, - "section": "HTML blocks", - "html": "
    \n*foo*\n

    bar

    \n", - "markdown": "
    \n*foo*\n\n*bar*\n", + "markdown": "
    \n
    \n", + "html": "
    \n
    \n", "example": 123, - "start_line": 2169 + "start_line": 2178, + "end_line": 2186, + "section": "HTML blocks" }, { - "end_line": 2191, - "section": "HTML blocks", - "html": "
    \n
    \n", + "html": "
    \n
    \n", "example": 124, - "start_line": 2185 + "start_line": 2189, + "end_line": 2197, + "section": "HTML blocks" }, { - "end_line": 2200, - "section": "HTML blocks", - "html": "
    \n*foo*\n\n*bar*\n", + "html": "
    \n*foo*\n

    bar

    \n", "example": 125, - "start_line": 2194 + "start_line": 2201, + "end_line": 2210, + "section": "HTML blocks" }, { - "end_line": 2212, - "section": "HTML blocks", - "html": "
    \n", - "markdown": "\n", + "markdown": "
    \nfoo\n\n", - "markdown": "
    \nfoo\n
    \n", + "markdown": "
    \n``` c\nint x = 33;\n```\n", - "markdown": "
    \n``` c\nint x = 33;\n```\n", + "markdown": "\n", + "html": "\n", "example": 129, - "start_line": 2242 + "start_line": 2250, + "end_line": 2254, + "section": "HTML blocks" }, { - "end_line": 2267, - "section": "HTML blocks", - "html": "\n*bar*\n\n", - "markdown": "\n*bar*\n\n", + "markdown": "
    \nfoo\n
    \n", + "html": "
    \nfoo\n
    \n", "example": 130, - "start_line": 2259 + "start_line": 2257, + "end_line": 2265, + "section": "HTML blocks" }, { - "end_line": 2280, - "section": "HTML blocks", - "html": "\n*bar*\n\n", - "markdown": "\n*bar*\n\n", + "markdown": "
    \n``` c\nint x = 33;\n```\n", + "html": "
    \n``` c\nint x = 33;\n```\n", "example": 131, - "start_line": 2272 + "start_line": 2274, + "end_line": 2284, + "section": "HTML blocks" }, { - "end_line": 2291, - "section": "HTML blocks", - "html": "\n*bar*\n\n", - "markdown": "\n*bar*\n\n", + "markdown": "\n*bar*\n\n", + "html": "\n*bar*\n\n", "example": 132, - "start_line": 2283 + "start_line": 2291, + "end_line": 2299, + "section": "HTML blocks" }, { - "end_line": 2300, - "section": "HTML blocks", - "html": "\n*bar*\n", - "markdown": "\n*bar*\n", + "markdown": "\n*bar*\n\n", + "html": "\n*bar*\n\n", "example": 133, - "start_line": 2294 + "start_line": 2304, + "end_line": 2312, + "section": "HTML blocks" }, { - "end_line": 2317, - "section": "HTML blocks", - "html": "\n*foo*\n\n", - "markdown": "\n*foo*\n\n", + "markdown": "\n*bar*\n\n", + "html": "\n*bar*\n\n", "example": 134, - "start_line": 2309 + "start_line": 2315, + "end_line": 2323, + "section": "HTML blocks" }, { - "end_line": 2334, - "section": "HTML blocks", - "html": "\n

    foo

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

    foo

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

    okay

    \n", - "markdown": "
    \nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
    \nokay\n", + "markdown": "\n\n*foo*\n\n\n", + "html": "\n

    foo

    \n
    \n", "example": 137, - "start_line": 2358 + "start_line": 2356, + "end_line": 2366, + "section": "HTML blocks" }, { - "end_line": 2393, - "section": "HTML blocks", - "html": "\n

    okay

    \n", - "markdown": "\nokay\n", + "markdown": "*foo*\n", + "html": "

    foo

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

    okay

    \n", - "markdown": "\nh1 {color:red;}\n\np {color:blue;}\n\nokay\n", + "markdown": "
    \nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
    \nokay\n", + "html": "
    \nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
    \n

    okay

    \n", "example": 139, - "start_line": 2398 + "start_line": 2390, + "end_line": 2406, + "section": "HTML blocks" }, { - "end_line": 2431, - "section": "HTML blocks", - "html": "\n\nfoo\n", - "markdown": "\n\nfoo\n", + "markdown": "\nokay\n", + "html": "\n

    okay

    \n", "example": 140, - "start_line": 2421 + "start_line": 2411, + "end_line": 2425, + "section": "HTML blocks" }, { - "end_line": 2445, - "section": "HTML blocks", - "html": "
    \n
    \nfoo\n
    \n

    bar

    \n", - "markdown": ">
    \n> foo\n\nbar\n", + "markdown": "\nh1 {color:red;}\n\np {color:blue;}\n\nokay\n", + "html": "\nh1 {color:red;}\n\np {color:blue;}\n\n

    okay

    \n", "example": 141, - "start_line": 2434 + "start_line": 2430, + "end_line": 2446, + "section": "HTML blocks" }, { - "end_line": 2458, - "section": "HTML blocks", - "html": "
      \n
    • \n
      \n
    • \n
    • foo
    • \n
    \n", - "markdown": "-
    \n- foo\n", + "markdown": "\n\nfoo\n", + "html": "\n\nfoo\n", "example": 142, - "start_line": 2448 + "start_line": 2453, + "end_line": 2463, + "section": "HTML blocks" }, { - "end_line": 2469, - "section": "HTML blocks", - "html": "\n

    foo

    \n", - "markdown": "\n*foo*\n", + "markdown": ">
    \n> foo\n\nbar\n", + "html": "
    \n
    \nfoo\n
    \n

    bar

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

    baz

    \n", - "markdown": "*bar*\n*baz*\n", + "markdown": "-
    \n- foo\n", + "html": "
      \n
    • \n
      \n
    • \n
    • foo
    • \n
    \n", "example": 144, - "start_line": 2472 + "start_line": 2480, + "end_line": 2490, + "section": "HTML blocks" }, { - "end_line": 2492, - "section": "HTML blocks", - "html": "1. *bar*\n", - "markdown": "1. *bar*\n", + "markdown": "\n*foo*\n", + "html": "\n

    foo

    \n", "example": 145, - "start_line": 2484 + "start_line": 2495, + "end_line": 2501, + "section": "HTML blocks" }, { - "end_line": 2509, - "section": "HTML blocks", - "html": "\n

    okay

    \n", - "markdown": "\nokay\n", + "markdown": "*bar*\n*baz*\n", + "html": "*bar*\n

    baz

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

    okay

    \n", - "markdown": "';\n\n?>\nokay\n", + "markdown": "1. *bar*\n", + "html": "1. *bar*\n", "example": 147, - "start_line": 2515 + "start_line": 2516, + "end_line": 2524, + "section": "HTML blocks" }, { - "end_line": 2538, - "section": "HTML blocks", - "html": "\n", - "markdown": "\n", + "markdown": "\nokay\n", + "html": "\n

    okay

    \n", "example": 148, - "start_line": 2534 + "start_line": 2529, + "end_line": 2541, + "section": "HTML blocks" }, { - "end_line": 2571, - "section": "HTML blocks", - "html": "\n

    okay

    \n", - "markdown": "\nokay\n", + "markdown": "';\n\n?>\nokay\n", + "html": "';\n\n?>\n

    okay

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

    okay

    \n", "example": 151, - "start_line": 2587 + "start_line": 2575, + "end_line": 2603, + "section": "HTML blocks" }, { - "end_line": 2611, - "section": "HTML blocks", - "html": "

    Foo

    \n
    \nbar\n
    \n", - "markdown": "Foo\n
    \nbar\n
    \n", + "markdown": " \n\n \n", + "html": " \n
    <!-- foo -->\n
    \n", "example": 152, - "start_line": 2601 + "start_line": 2608, + "end_line": 2616, + "section": "HTML blocks" }, { - "end_line": 2627, - "section": "HTML blocks", - "html": "
    \nbar\n
    \n*foo*\n", - "markdown": "
    \nbar\n
    \n*foo*\n", + "markdown": "
    \n\n
    \n", + "html": "
    \n
    <div>\n
    \n", "example": 153, - "start_line": 2617 + "start_line": 2619, + "end_line": 2627, + "section": "HTML blocks" }, { - "end_line": 2640, - "section": "HTML blocks", - "html": "

    Foo\n\nbaz

    \n", - "markdown": "Foo\n\nbaz\n", + "markdown": "Foo\n
    \nbar\n
    \n", + "html": "

    Foo

    \n
    \nbar\n
    \n", "example": 154, - "start_line": 2632 + "start_line": 2633, + "end_line": 2643, + "section": "HTML blocks" }, { - "end_line": 2683, - "section": "HTML blocks", - "html": "
    \n

    Emphasized text.

    \n
    \n", - "markdown": "
    \n\n*Emphasized* text.\n\n
    \n", + "markdown": "
    \nbar\n
    \n*foo*\n", + "html": "
    \nbar\n
    \n*foo*\n", "example": 155, - "start_line": 2673 + "start_line": 2650, + "end_line": 2660, + "section": "HTML blocks" }, { - "end_line": 2694, - "section": "HTML blocks", - "html": "
    \n*Emphasized* text.\n
    \n", - "markdown": "
    \n*Emphasized* text.\n
    \n", + "markdown": "Foo\n
    \nbaz\n", + "html": "

    Foo\n\nbaz

    \n", "example": 156, - "start_line": 2686 + "start_line": 2665, + "end_line": 2673, + "section": "HTML blocks" }, { - "end_line": 2728, - "section": "HTML blocks", - "html": "\n\n\n\n
    \nHi\n
    \n", - "markdown": "\n\n\n\n\n\n\n\n
    \nHi\n
    \n", + "markdown": "
    \n\n*Emphasized* text.\n\n
    \n", + "html": "
    \n

    Emphasized text.

    \n
    \n", "example": 157, - "start_line": 2708 + "start_line": 2706, + "end_line": 2716, + "section": "HTML blocks" }, { - "end_line": 2756, - "section": "HTML blocks", - "html": "\n \n
    <td>\n  Hi\n</td>\n
    \n \n
    \n", - "markdown": "\n\n \n\n \n\n \n\n
    \n Hi\n
    \n", + "markdown": "
    \n*Emphasized* text.\n
    \n", + "html": "
    \n*Emphasized* text.\n
    \n", "example": 158, - "start_line": 2735 + "start_line": 2719, + "end_line": 2727, + "section": "HTML blocks" }, { - "end_line": 2789, - "section": "Link reference definitions", - "html": "

    foo

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

    foo

    \n", - "markdown": " [foo]: \n /url \n 'the title' \n\n[foo]\n", + "markdown": "\n\n \n\n \n\n \n\n
    \n Hi\n
    \n", + "html": "\n \n
    <td>\n  Hi\n</td>\n
    \n \n
    \n", "example": 160, - "start_line": 2792 + "start_line": 2768, + "end_line": 2789, + "section": "HTML blocks" }, { - "end_line": 2809, - "section": "Link reference definitions", - "html": "

    Foo*bar]

    \n", - "markdown": "[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]\n", + "markdown": "[foo]: /url \"title\"\n\n[foo]\n", + "html": "

    foo

    \n", "example": 161, - "start_line": 2803 + "start_line": 2816, + "end_line": 2822, + "section": "Link reference definitions" }, { - "end_line": 2820, - "section": "Link reference definitions", - "html": "

    Foo bar

    \n", - "markdown": "[Foo bar]:\n\n'title'\n\n[Foo bar]\n", + "markdown": " [foo]: \n /url \n 'the title' \n\n[foo]\n", + "html": "

    foo

    \n", "example": 162, - "start_line": 2812 + "start_line": 2825, + "end_line": 2833, + "section": "Link reference definitions" }, { - "end_line": 2839, - "section": "Link reference definitions", - "html": "

    foo

    \n", - "markdown": "[foo]: /url '\ntitle\nline1\nline2\n'\n\n[foo]\n", + "markdown": "[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]\n", + "html": "

    Foo*bar]

    \n", "example": 163, - "start_line": 2825 + "start_line": 2836, + "end_line": 2842, + "section": "Link reference definitions" }, { - "end_line": 2854, - "section": "Link reference definitions", - "html": "

    [foo]: /url 'title

    \n

    with blank line'

    \n

    [foo]

    \n", - "markdown": "[foo]: /url 'title\n\nwith blank line'\n\n[foo]\n", + "markdown": "[Foo bar]:\n\n'title'\n\n[Foo bar]\n", + "html": "

    Foo bar

    \n", "example": 164, - "start_line": 2844 + "start_line": 2845, + "end_line": 2853, + "section": "Link reference definitions", + "shouldFail": true }, { - "end_line": 2866, - "section": "Link reference definitions", - "html": "

    foo

    \n", - "markdown": "[foo]:\n/url\n\n[foo]\n", + "markdown": "[foo]: /url '\ntitle\nline1\nline2\n'\n\n[foo]\n", + "html": "

    foo

    \n", "example": 165, - "start_line": 2859 + "start_line": 2858, + "end_line": 2872, + "section": "Link reference definitions" }, { - "end_line": 2878, - "section": "Link reference definitions", - "html": "

    [foo]:

    \n

    [foo]

    \n", - "markdown": "[foo]:\n\n[foo]\n", + "markdown": "[foo]: /url 'title\n\nwith blank line'\n\n[foo]\n", + "html": "

    [foo]: /url 'title

    \n

    with blank line'

    \n

    [foo]

    \n", "example": 166, - "start_line": 2871 + "start_line": 2877, + "end_line": 2887, + "section": "Link reference definitions" }, { - "end_line": 2890, - "section": "Link reference definitions", - "html": "

    foo

    \n", - "markdown": "[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]\n", + "markdown": "[foo]:\n/url\n\n[foo]\n", + "html": "

    foo

    \n", "example": 167, - "start_line": 2884, - "shouldFail": true + "start_line": 2892, + "end_line": 2899, + "section": "Link reference definitions" }, { - "end_line": 2901, - "section": "Link reference definitions", - "html": "

    foo

    \n", - "markdown": "[foo]\n\n[foo]: url\n", + "markdown": "[foo]:\n\n[foo]\n", + "html": "

    [foo]:

    \n

    [foo]

    \n", "example": 168, - "start_line": 2895 + "start_line": 2904, + "end_line": 2911, + "section": "Link reference definitions" }, { - "end_line": 2914, - "section": "Link reference definitions", - "html": "

    foo

    \n", - "markdown": "[foo]\n\n[foo]: first\n[foo]: second\n", + "markdown": "[foo]: <>\n\n[foo]\n", + "html": "

    foo

    \n", "example": 169, - "start_line": 2907 + "start_line": 2916, + "end_line": 2922, + "section": "Link reference definitions", + "shouldFail": true }, { - "end_line": 2926, - "section": "Link reference definitions", - "html": "

    Foo

    \n", - "markdown": "[FOO]: /url\n\n[Foo]\n", + "markdown": "[foo]: (baz)\n\n[foo]\n", + "html": "

    [foo]: (baz)

    \n

    [foo]

    \n", "example": 170, - "start_line": 2920 + "start_line": 2927, + "end_line": 2934, + "section": "Link reference definitions" }, { - "end_line": 2935, - "section": "Link reference definitions", - "html": "

    αγω

    \n", - "markdown": "[ΑΓΩ]: /φου\n\n[αγω]\n", + "markdown": "[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]\n", + "html": "

    foo

    \n", "example": 171, - "start_line": 2929 + "start_line": 2940, + "end_line": 2946, + "section": "Link reference definitions", + "shouldFail": true }, { - "end_line": 2944, - "section": "Link reference definitions", - "html": "", - "markdown": "[foo]: /url\n", + "markdown": "[foo]\n\n[foo]: url\n", + "html": "

    foo

    \n", "example": 172, - "start_line": 2941 + "start_line": 2951, + "end_line": 2957, + "section": "Link reference definitions" }, { - "end_line": 2956, - "section": "Link reference definitions", - "html": "

    bar

    \n", - "markdown": "[\nfoo\n]: /url\nbar\n", + "markdown": "[foo]\n\n[foo]: first\n[foo]: second\n", + "html": "

    foo

    \n", "example": 173, - "start_line": 2949 + "start_line": 2963, + "end_line": 2970, + "section": "Link reference definitions" }, { - "end_line": 2966, - "section": "Link reference definitions", - "html": "

    [foo]: /url "title" ok

    \n", - "markdown": "[foo]: /url \"title\" ok\n", + "markdown": "[FOO]: /url\n\n[Foo]\n", + "html": "

    Foo

    \n", "example": 174, - "start_line": 2962 + "start_line": 2976, + "end_line": 2982, + "section": "Link reference definitions" }, { - "end_line": 2976, - "section": "Link reference definitions", - "html": "

    "title" ok

    \n", - "markdown": "[foo]: /url\n\"title\" ok\n", + "markdown": "[ΑΓΩ]: /φου\n\n[αγω]\n", + "html": "

    αγω

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

    [foo]

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

    [foo]

    \n", - "markdown": "```\n[foo]: /url\n```\n\n[foo]\n", + "markdown": "[\nfoo\n]: /url\nbar\n", + "html": "

    bar

    \n", "example": 177, - "start_line": 2996 + "start_line": 3005, + "end_line": 3012, + "section": "Link reference definitions" }, { - "end_line": 3020, - "section": "Link reference definitions", - "html": "

    Foo\n[bar]: /baz

    \n

    [bar]

    \n", - "markdown": "Foo\n[bar]: /baz\n\n[bar]\n", + "markdown": "[foo]: /url \"title\" ok\n", + "html": "

    [foo]: /url "title" ok

    \n", "example": 178, - "start_line": 3011 + "start_line": 3018, + "end_line": 3022, + "section": "Link reference definitions" }, { - "end_line": 3035, - "section": "Link reference definitions", - "html": "

    Foo

    \n
    \n

    bar

    \n
    \n", - "markdown": "# [Foo]\n[foo]: /url\n> bar\n", + "markdown": "[foo]: /url\n\"title\" ok\n", + "html": "

    "title" ok

    \n", "example": 179, - "start_line": 3026 + "start_line": 3027, + "end_line": 3032, + "section": "Link reference definitions" }, { - "end_line": 3054, - "section": "Link reference definitions", - "html": "

    foo,\nbar,\nbaz

    \n", - "markdown": "[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]\n", + "markdown": " [foo]: /url \"title\"\n\n[foo]\n", + "html": "
    [foo]: /url "title"\n
    \n

    [foo]

    \n", "example": 180, - "start_line": 3041 + "start_line": 3038, + "end_line": 3046, + "section": "Link reference definitions" }, { - "end_line": 3070, - "section": "Link reference definitions", - "html": "

    foo

    \n
    \n
    \n", - "markdown": "[foo]\n\n> [foo]: /url\n", + "markdown": "```\n[foo]: /url\n```\n\n[foo]\n", + "html": "
    [foo]: /url\n
    \n

    [foo]

    \n", "example": 181, - "start_line": 3062 + "start_line": 3052, + "end_line": 3062, + "section": "Link reference definitions" }, { - "end_line": 3092, - "section": "Paragraphs", - "html": "

    aaa

    \n

    bbb

    \n", - "markdown": "aaa\n\nbbb\n", + "markdown": "Foo\n[bar]: /baz\n\n[bar]\n", + "html": "

    Foo\n[bar]: /baz

    \n

    [bar]

    \n", "example": 182, - "start_line": 3085 + "start_line": 3067, + "end_line": 3076, + "section": "Link reference definitions" }, { - "end_line": 3108, - "section": "Paragraphs", - "html": "

    aaa\nbbb

    \n

    ccc\nddd

    \n", - "markdown": "aaa\nbbb\n\nccc\nddd\n", + "markdown": "# [Foo]\n[foo]: /url\n> bar\n", + "html": "

    Foo

    \n
    \n

    bar

    \n
    \n", "example": 183, - "start_line": 3097 + "start_line": 3082, + "end_line": 3091, + "section": "Link reference definitions" }, { - "end_line": 3121, - "section": "Paragraphs", - "html": "

    aaa

    \n

    bbb

    \n", - "markdown": "aaa\n\n\nbbb\n", + "markdown": "[foo]: /url\nbar\n===\n[foo]\n", + "html": "

    bar

    \n

    foo

    \n", "example": 184, - "start_line": 3113 + "start_line": 3093, + "end_line": 3101, + "section": "Link reference definitions" }, { - "end_line": 3132, - "section": "Paragraphs", - "html": "

    aaa\nbbb

    \n", - "markdown": " aaa\n bbb\n", + "markdown": "[foo]: /url\n===\n[foo]\n", + "html": "

    ===\nfoo

    \n", "example": 185, - "start_line": 3126 + "start_line": 3103, + "end_line": 3110, + "section": "Link reference definitions" }, { - "end_line": 3146, - "section": "Paragraphs", - "html": "

    aaa\nbbb\nccc

    \n", - "markdown": "aaa\n bbb\n ccc\n", + "markdown": "[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]\n", + "html": "

    foo,\nbar,\nbaz

    \n", "example": 186, - "start_line": 3138 + "start_line": 3116, + "end_line": 3129, + "section": "Link reference definitions" }, { - "end_line": 3158, - "section": "Paragraphs", - "html": "

    aaa\nbbb

    \n", - "markdown": " aaa\nbbb\n", + "markdown": "[foo]\n\n> [foo]: /url\n", + "html": "

    foo

    \n
    \n
    \n", "example": 187, - "start_line": 3152 + "start_line": 3137, + "end_line": 3145, + "section": "Link reference definitions" }, { - "end_line": 3168, - "section": "Paragraphs", - "html": "
    aaa\n
    \n

    bbb

    \n", - "markdown": " aaa\nbbb\n", + "markdown": "[foo]: /url\n", + "html": "", "example": 188, - "start_line": 3161 + "start_line": 3154, + "end_line": 3157, + "section": "Link reference definitions" }, { - "end_line": 3181, - "section": "Paragraphs", - "html": "

    aaa
    \nbbb

    \n", - "markdown": "aaa \nbbb \n", + "markdown": "aaa\n\nbbb\n", + "html": "

    aaa

    \n

    bbb

    \n", "example": 189, - "start_line": 3175 + "start_line": 3171, + "end_line": 3178, + "section": "Paragraphs" }, { - "end_line": 3204, - "section": "Blank lines", - "html": "

    aaa

    \n

    aaa

    \n", - "markdown": " \n\naaa\n \n\n# aaa\n\n \n", + "markdown": "aaa\nbbb\n\nccc\nddd\n", + "html": "

    aaa\nbbb

    \n

    ccc\nddd

    \n", "example": 190, - "start_line": 3192 + "start_line": 3183, + "end_line": 3194, + "section": "Paragraphs" }, { - "end_line": 3268, - "section": "Block quotes", - "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", - "markdown": "> # Foo\n> bar\n> baz\n", + "markdown": "aaa\n\n\nbbb\n", + "html": "

    aaa

    \n

    bbb

    \n", "example": 191, - "start_line": 3258 + "start_line": 3199, + "end_line": 3207, + "section": "Paragraphs" }, { - "end_line": 3283, - "section": "Block quotes", - "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", - "markdown": "># Foo\n>bar\n> baz\n", + "markdown": " aaa\n bbb\n", + "html": "

    aaa\nbbb

    \n", "example": 192, - "start_line": 3273 + "start_line": 3212, + "end_line": 3218, + "section": "Paragraphs" }, { - "end_line": 3298, - "section": "Block quotes", - "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", - "markdown": " > # Foo\n > bar\n > baz\n", + "markdown": "aaa\n bbb\n ccc\n", + "html": "

    aaa\nbbb\nccc

    \n", "example": 193, - "start_line": 3288 + "start_line": 3224, + "end_line": 3232, + "section": "Paragraphs" }, { - "end_line": 3312, - "section": "Block quotes", - "html": "
    > # Foo\n> bar\n> baz\n
    \n", - "markdown": " > # Foo\n > bar\n > baz\n", + "markdown": " aaa\nbbb\n", + "html": "

    aaa\nbbb

    \n", "example": 194, - "start_line": 3303 + "start_line": 3238, + "end_line": 3244, + "section": "Paragraphs" }, { - "end_line": 3328, - "section": "Block quotes", - "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", - "markdown": "> # Foo\n> bar\nbaz\n", + "markdown": " aaa\nbbb\n", + "html": "
    aaa\n
    \n

    bbb

    \n", "example": 195, - "start_line": 3318 + "start_line": 3247, + "end_line": 3254, + "section": "Paragraphs" }, { - "end_line": 3344, - "section": "Block quotes", - "html": "
    \n

    bar\nbaz\nfoo

    \n
    \n", - "markdown": "> bar\nbaz\n> foo\n", + "markdown": "aaa \nbbb \n", + "html": "

    aaa
    \nbbb

    \n", "example": 196, - "start_line": 3334 + "start_line": 3261, + "end_line": 3267, + "section": "Paragraphs" }, { - "end_line": 3366, - "section": "Block quotes", - "html": "
    \n

    foo

    \n
    \n
    \n", - "markdown": "> foo\n---\n", + "markdown": " \n\naaa\n \n\n# aaa\n\n \n", + "html": "

    aaa

    \n

    aaa

    \n", "example": 197, - "start_line": 3358 + "start_line": 3278, + "end_line": 3290, + "section": "Blank lines" }, { - "end_line": 3390, - "section": "Block quotes", - "html": "
    \n
      \n
    • foo
    • \n
    \n
    \n
      \n
    • bar
    • \n
    \n", - "markdown": "> - foo\n- bar\n", + "markdown": "> # Foo\n> bar\n> baz\n", + "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", "example": 198, - "start_line": 3378, - "shouldFail": true + "start_line": 3344, + "end_line": 3354, + "section": "Block quotes" }, { - "end_line": 3406, - "section": "Block quotes", - "html": "
    \n
    foo\n
    \n
    \n
    bar\n
    \n", - "markdown": "> foo\n bar\n", + "markdown": "># Foo\n>bar\n> baz\n", + "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", "example": 199, - "start_line": 3396, - "shouldFail": true + "start_line": 3359, + "end_line": 3369, + "section": "Block quotes" }, { - "end_line": 3419, - "section": "Block quotes", - "html": "
    \n
    \n
    \n

    foo

    \n
    \n", - "markdown": "> ```\nfoo\n```\n", + "markdown": " > # Foo\n > bar\n > baz\n", + "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", "example": 200, - "start_line": 3409, - "shouldFail": true + "start_line": 3374, + "end_line": 3384, + "section": "Block quotes" }, { - "end_line": 3433, - "section": "Block quotes", - "html": "
    \n

    foo\n- bar

    \n
    \n", - "markdown": "> foo\n - bar\n", + "markdown": " > # Foo\n > bar\n > baz\n", + "html": "
    > # Foo\n> bar\n> baz\n
    \n", "example": 201, - "start_line": 3425 + "start_line": 3389, + "end_line": 3398, + "section": "Block quotes" }, { - "end_line": 3454, - "section": "Block quotes", - "html": "
    \n
    \n", - "markdown": ">\n", + "markdown": "> # Foo\n> bar\nbaz\n", + "html": "
    \n

    Foo

    \n

    bar\nbaz

    \n
    \n", "example": 202, - "start_line": 3449 + "start_line": 3404, + "end_line": 3414, + "section": "Block quotes" }, { - "end_line": 3464, - "section": "Block quotes", - "html": "
    \n
    \n", - "markdown": ">\n> \n> \n", + "markdown": "> bar\nbaz\n> foo\n", + "html": "
    \n

    bar\nbaz\nfoo

    \n
    \n", "example": 203, - "start_line": 3457 + "start_line": 3420, + "end_line": 3430, + "section": "Block quotes" }, { - "end_line": 3477, - "section": "Block quotes", - "html": "
    \n

    foo

    \n
    \n", - "markdown": ">\n> foo\n> \n", + "markdown": "> foo\n---\n", + "html": "
    \n

    foo

    \n
    \n
    \n", "example": 204, - "start_line": 3469 + "start_line": 3444, + "end_line": 3452, + "section": "Block quotes" }, { - "end_line": 3493, - "section": "Block quotes", - "html": "
    \n

    foo

    \n
    \n
    \n

    bar

    \n
    \n", - "markdown": "> foo\n\n> bar\n", + "markdown": "> - foo\n- bar\n", + "html": "
    \n
      \n
    • foo
    • \n
    \n
    \n
      \n
    • bar
    • \n
    \n", "example": 205, - "start_line": 3482 + "start_line": 3464, + "end_line": 3476, + "section": "Block quotes", + "shouldFail": true }, { - "end_line": 3512, - "section": "Block quotes", - "html": "
    \n

    foo\nbar

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

    foo

    \n

    bar

    \n
    \n", - "markdown": "> foo\n>\n> bar\n", + "markdown": "> ```\nfoo\n```\n", + "html": "
    \n
    \n
    \n

    foo

    \n
    \n", "example": 207, - "start_line": 3517 + "start_line": 3495, + "end_line": 3505, + "section": "Block quotes", + "shouldFail": true }, { - "end_line": 3539, - "section": "Block quotes", - "html": "

    foo

    \n
    \n

    bar

    \n
    \n", - "markdown": "foo\n> bar\n", + "markdown": "> foo\n - bar\n", + "html": "
    \n

    foo\n- bar

    \n
    \n", "example": 208, - "start_line": 3531 + "start_line": 3511, + "end_line": 3519, + "section": "Block quotes" }, { - "end_line": 3557, - "section": "Block quotes", - "html": "
    \n

    aaa

    \n
    \n
    \n
    \n

    bbb

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

    bar\nbaz

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

    bar

    \n
    \n

    baz

    \n", - "markdown": "> bar\n\nbaz\n", + "markdown": ">\n> foo\n> \n", + "html": "
    \n

    foo

    \n
    \n", "example": 211, - "start_line": 3574 + "start_line": 3555, + "end_line": 3563, + "section": "Block quotes" }, { - "end_line": 3595, - "section": "Block quotes", - "html": "
    \n

    bar

    \n
    \n

    baz

    \n", - "markdown": "> bar\n>\nbaz\n", + "markdown": "> foo\n\n> bar\n", + "html": "
    \n

    foo

    \n
    \n
    \n

    bar

    \n
    \n", "example": 212, - "start_line": 3586 + "start_line": 3568, + "end_line": 3579, + "section": "Block quotes" }, { - "end_line": 3614, - "section": "Block quotes", - "html": "
    \n
    \n
    \n

    foo\nbar

    \n
    \n
    \n
    \n", - "markdown": "> > > foo\nbar\n", + "markdown": "> foo\n> bar\n", + "html": "
    \n

    foo\nbar

    \n
    \n", "example": 213, - "start_line": 3602 + "start_line": 3590, + "end_line": 3598, + "section": "Block quotes" }, { - "end_line": 3631, - "section": "Block quotes", - "html": "
    \n
    \n
    \n

    foo\nbar\nbaz

    \n
    \n
    \n
    \n", - "markdown": ">>> foo\n> bar\n>>baz\n", + "markdown": "> foo\n>\n> bar\n", + "html": "
    \n

    foo

    \n

    bar

    \n
    \n", "example": 214, - "start_line": 3617 + "start_line": 3603, + "end_line": 3612, + "section": "Block quotes" }, { - "end_line": 3651, - "section": "Block quotes", - "html": "
    \n
    code\n
    \n
    \n
    \n

    not code

    \n
    \n", - "markdown": "> code\n\n> not code\n", + "markdown": "foo\n> bar\n", + "html": "

    foo

    \n
    \n

    bar

    \n
    \n", "example": 215, - "start_line": 3639 + "start_line": 3617, + "end_line": 3625, + "section": "Block quotes" }, { - "end_line": 3709, - "section": "List items", - "html": "

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n", - "markdown": "A paragraph\nwith two lines.\n\n indented code\n\n> A block quote.\n", + "markdown": "> aaa\n***\n> bbb\n", + "html": "
    \n

    aaa

    \n
    \n
    \n
    \n

    bbb

    \n
    \n", "example": 216, - "start_line": 3694 + "start_line": 3631, + "end_line": 3643, + "section": "Block quotes" }, { - "end_line": 3735, - "section": "List items", - "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", - "markdown": "1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "markdown": "> bar\nbaz\n", + "html": "
    \n

    bar\nbaz

    \n
    \n", "example": 217, - "start_line": 3716 + "start_line": 3649, + "end_line": 3657, + "section": "Block quotes" }, { - "end_line": 3758, - "section": "List items", - "html": "
      \n
    • one
    • \n
    \n

    two

    \n", - "markdown": "- one\n\n two\n", + "markdown": "> bar\n\nbaz\n", + "html": "
    \n

    bar

    \n
    \n

    baz

    \n", "example": 218, - "start_line": 3749, - "shouldFail": true + "start_line": 3660, + "end_line": 3669, + "section": "Block quotes" }, { - "end_line": 3772, - "section": "List items", - "html": "
      \n
    • \n

      one

      \n

      two

      \n
    • \n
    \n", - "markdown": "- one\n\n two\n", + "markdown": "> bar\n>\nbaz\n", + "html": "
    \n

    bar

    \n
    \n

    baz

    \n", "example": 219, - "start_line": 3761 + "start_line": 3672, + "end_line": 3681, + "section": "Block quotes" }, { - "end_line": 3785, - "section": "List items", - "html": "
      \n
    • one
    • \n
    \n
     two\n
    \n", - "markdown": " - one\n\n two\n", + "markdown": "> > > foo\nbar\n", + "html": "
    \n
    \n
    \n

    foo\nbar

    \n
    \n
    \n
    \n", "example": 220, - "start_line": 3775, - "shouldFail": true + "start_line": 3688, + "end_line": 3700, + "section": "Block quotes" }, { - "end_line": 3799, - "section": "List items", - "html": "
      \n
    • \n

      one

      \n

      two

      \n
    • \n
    \n", - "markdown": " - one\n\n two\n", + "markdown": ">>> foo\n> bar\n>>baz\n", + "html": "
    \n
    \n
    \n

    foo\nbar\nbaz

    \n
    \n
    \n
    \n", "example": 221, - "start_line": 3788 + "start_line": 3703, + "end_line": 3717, + "section": "Block quotes" }, { - "end_line": 3825, - "section": "List items", - "html": "
    \n
    \n
      \n
    1. \n

      one

      \n

      two

      \n
    2. \n
    \n
    \n
    \n", - "markdown": " > > 1. one\n>>\n>> two\n", + "markdown": "> code\n\n> not code\n", + "html": "
    \n
    code\n
    \n
    \n
    \n

    not code

    \n
    \n", "example": 222, - "start_line": 3810 + "start_line": 3725, + "end_line": 3737, + "section": "Block quotes" }, { - "end_line": 3850, - "section": "List items", - "html": "
    \n
    \n
      \n
    • one
    • \n
    \n

    two

    \n
    \n
    \n", - "markdown": ">>- one\n>>\n > > two\n", + "markdown": "A paragraph\nwith two lines.\n\n indented code\n\n> A block quote.\n", + "html": "

    A paragraph\nwith two lines.

    \n
    indented code\n
    \n
    \n

    A block quote.

    \n
    \n", "example": 223, - "start_line": 3837 + "start_line": 3779, + "end_line": 3794, + "section": "List items" }, { - "end_line": 3863, - "section": "List items", - "html": "

    -one

    \n

    2.two

    \n", - "markdown": "-one\n\n2.two\n", + "markdown": "1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", "example": 224, - "start_line": 3856 + "start_line": 3801, + "end_line": 3820, + "section": "List items" }, { - "end_line": 3881, - "section": "List items", - "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", - "markdown": "- foo\n\n\n bar\n", + "markdown": "- one\n\n two\n", + "html": "
      \n
    • one
    • \n
    \n

    two

    \n", "example": 225, - "start_line": 3869, + "start_line": 3834, + "end_line": 3843, + "section": "List items", "shouldFail": true }, { - "end_line": 3908, - "section": "List items", - "html": "
      \n
    1. \n

      foo

      \n
      bar\n
      \n

      baz

      \n
      \n

      bam

      \n
      \n
    2. \n
    \n", - "markdown": "1. foo\n\n ```\n bar\n ```\n\n baz\n\n > bam\n", + "markdown": "- one\n\n two\n", + "html": "
      \n
    • \n

      one

      \n

      two

      \n
    • \n
    \n", "example": 226, - "start_line": 3886 + "start_line": 3846, + "end_line": 3857, + "section": "List items" }, { - "end_line": 3932, - "section": "List items", - "html": "
      \n
    • \n

      Foo

      \n
      bar\n\n\nbaz\n
      \n
    • \n
    \n", - "markdown": "- Foo\n\n bar\n\n\n baz\n", + "markdown": " - one\n\n two\n", + "html": "
      \n
    • one
    • \n
    \n
     two\n
    \n", "example": 227, - "start_line": 3914, + "start_line": 3860, + "end_line": 3870, + "section": "List items", "shouldFail": true }, { - "end_line": 3942, - "section": "List items", - "html": "
      \n
    1. ok
    2. \n
    \n", - "markdown": "123456789. ok\n", + "markdown": " - one\n\n two\n", + "html": "
      \n
    • \n

      one

      \n

      two

      \n
    • \n
    \n", "example": 228, - "start_line": 3936 + "start_line": 3873, + "end_line": 3884, + "section": "List items" }, { - "end_line": 3949, - "section": "List items", - "html": "

    1234567890. not ok

    \n", - "markdown": "1234567890. not ok\n", + "markdown": " > > 1. one\n>>\n>> two\n", + "html": "
    \n
    \n
      \n
    1. \n

      one

      \n

      two

      \n
    2. \n
    \n
    \n
    \n", "example": 229, - "start_line": 3945 + "start_line": 3895, + "end_line": 3910, + "section": "List items" }, { - "end_line": 3960, - "section": "List items", - "html": "
      \n
    1. ok
    2. \n
    \n", - "markdown": "0. ok\n", + "markdown": ">>- one\n>>\n > > two\n", + "html": "
    \n
    \n
      \n
    • one
    • \n
    \n

    two

    \n
    \n
    \n", "example": 230, - "start_line": 3954 + "start_line": 3922, + "end_line": 3935, + "section": "List items" }, { - "end_line": 3969, - "section": "List items", - "html": "
      \n
    1. ok
    2. \n
    \n", - "markdown": "003. ok\n", + "markdown": "-one\n\n2.two\n", + "html": "

    -one

    \n

    2.two

    \n", "example": 231, - "start_line": 3963 + "start_line": 3941, + "end_line": 3948, + "section": "List items" }, { - "end_line": 3978, - "section": "List items", - "html": "

    -1. not ok

    \n", - "markdown": "-1. not ok\n", + "markdown": "- foo\n\n\n bar\n", + "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", "example": 232, - "start_line": 3974 + "start_line": 3954, + "end_line": 3966, + "section": "List items", + "shouldFail": true }, { - "end_line": 4010, - "section": "List items", - "html": "
      \n
    • \n

      foo

      \n
      bar\n
      \n
    • \n
    \n", - "markdown": "- foo\n\n bar\n", + "markdown": "1. foo\n\n ```\n bar\n ```\n\n baz\n\n > bam\n", + "html": "
      \n
    1. \n

      foo

      \n
      bar\n
      \n

      baz

      \n
      \n

      bam

      \n
      \n
    2. \n
    \n", "example": 233, - "start_line": 3998 + "start_line": 3971, + "end_line": 3993, + "section": "List items" }, { - "end_line": 4027, - "section": "List items", - "html": "
      \n
    1. \n

      foo

      \n
      bar\n
      \n
    2. \n
    \n", - "markdown": " 10. foo\n\n bar\n", + "markdown": "- Foo\n\n bar\n\n\n baz\n", + "html": "
      \n
    • \n

      Foo

      \n
      bar\n\n\nbaz\n
      \n
    • \n
    \n", "example": 234, - "start_line": 4015 + "start_line": 3999, + "end_line": 4017, + "section": "List items", + "shouldFail": true }, { - "end_line": 4046, - "section": "List items", - "html": "
    indented code\n
    \n

    paragraph

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

      paragraph

      \n
      more code\n
      \n
    2. \n
    \n", - "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "markdown": "1234567890. not ok\n", + "html": "

    1234567890. not ok

    \n", "example": 236, - "start_line": 4049, - "shouldFail": true + "start_line": 4030, + "end_line": 4034, + "section": "List items" }, { - "end_line": 4087, - "section": "List items", - "html": "
      \n
    1. \n
       indented code\n
      \n

      paragraph

      \n
      more code\n
      \n
    2. \n
    \n", - "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "markdown": "0. ok\n", + "html": "
      \n
    1. ok
    2. \n
    \n", "example": 237, - "start_line": 4071, + "start_line": 4039, + "end_line": 4045, + "section": "List items" + }, + { + "markdown": "003. ok\n", + "html": "
      \n
    1. ok
    2. \n
    \n", + "example": 238, + "start_line": 4048, + "end_line": 4054, + "section": "List items" + }, + { + "markdown": "-1. not ok\n", + "html": "

    -1. not ok

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

      foo

      \n
      bar\n
      \n
    • \n
    \n", + "example": 240, + "start_line": 4082, + "end_line": 4094, + "section": "List items" + }, + { + "markdown": " 10. foo\n\n bar\n", + "html": "
      \n
    1. \n

      foo

      \n
      bar\n
      \n
    2. \n
    \n", + "example": 241, + "start_line": 4099, + "end_line": 4111, + "section": "List items" + }, + { + "markdown": " indented code\n\nparagraph\n\n more code\n", + "html": "
    indented code\n
    \n

    paragraph

    \n
    more code\n
    \n", + "example": 242, + "start_line": 4118, + "end_line": 4130, + "section": "List items" + }, + { + "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "html": "
      \n
    1. \n
      indented code\n
      \n

      paragraph

      \n
      more code\n
      \n
    2. \n
    \n", + "example": 243, + "start_line": 4133, + "end_line": 4149, + "section": "List items", "shouldFail": true }, { - "end_line": 4105, + "markdown": "1. indented code\n\n paragraph\n\n more code\n", + "html": "
      \n
    1. \n
       indented code\n
      \n

      paragraph

      \n
      more code\n
      \n
    2. \n
    \n", + "example": 244, + "start_line": 4155, + "end_line": 4171, "section": "List items", - "html": "

    foo

    \n

    bar

    \n", + "shouldFail": true + }, + { "markdown": " foo\n\nbar\n", - "example": 238, - "start_line": 4098 + "html": "

    foo

    \n

    bar

    \n", + "example": 245, + "start_line": 4182, + "end_line": 4189, + "section": "List items" }, { - "end_line": 4117, - "section": "List items", - "html": "
      \n
    • foo
    • \n
    \n

    bar

    \n", "markdown": "- foo\n\n bar\n", - "example": 239, - "start_line": 4108, + "html": "
      \n
    • foo
    • \n
    \n

    bar

    \n", + "example": 246, + "start_line": 4192, + "end_line": 4201, + "section": "List items", "shouldFail": true }, { - "end_line": 4136, - "section": "List items", - "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", "markdown": "- foo\n\n bar\n", - "example": 240, - "start_line": 4125 + "html": "
      \n
    • \n

      foo

      \n

      bar

      \n
    • \n
    \n", + "example": 247, + "start_line": 4209, + "end_line": 4220, + "section": "List items" }, { - "end_line": 4174, - "section": "List items", - "html": "
      \n
    • foo
    • \n
    • \n
      bar\n
      \n
    • \n
    • \n
      baz\n
      \n
    • \n
    \n", "markdown": "-\n foo\n-\n ```\n bar\n ```\n-\n baz\n", - "example": 241, - "start_line": 4153, + "html": "
      \n
    • foo
    • \n
    • \n
      bar\n
      \n
    • \n
    • \n
      baz\n
      \n
    • \n
    \n", + "example": 248, + "start_line": 4237, + "end_line": 4258, + "section": "List items", "shouldFail": true }, { - "end_line": 4186, - "section": "List items", - "html": "
      \n
    • foo
    • \n
    \n", "markdown": "- \n foo\n", - "example": 242, - "start_line": 4179 + "html": "
      \n
    • foo
    • \n
    \n", + "example": 249, + "start_line": 4263, + "end_line": 4270, + "section": "List items" }, { - "end_line": 4202, - "section": "List items", - "html": "
      \n
    • \n
    \n

    foo

    \n", "markdown": "-\n\n foo\n", - "example": 243, - "start_line": 4193, + "html": "
      \n
    • \n
    \n

    foo

    \n", + "example": 250, + "start_line": 4277, + "end_line": 4286, + "section": "List items", "shouldFail": true }, { - "end_line": 4217, - "section": "List items", - "html": "
      \n
    • foo
    • \n
    • \n
    • bar
    • \n
    \n", "markdown": "- foo\n-\n- bar\n", - "example": 244, - "start_line": 4207 + "html": "
      \n
    • foo
    • \n
    • \n
    • bar
    • \n
    \n", + "example": 251, + "start_line": 4291, + "end_line": 4301, + "section": "List items" }, { - "end_line": 4232, - "section": "List items", - "html": "
      \n
    • foo
    • \n
    • \n
    • bar
    • \n
    \n", "markdown": "- foo\n- \n- bar\n", - "example": 245, - "start_line": 4222 + "html": "
      \n
    • foo
    • \n
    • \n
    • bar
    • \n
    \n", + "example": 252, + "start_line": 4306, + "end_line": 4316, + "section": "List items" }, { - "end_line": 4247, - "section": "List items", - "html": "
      \n
    1. foo
    2. \n
    3. \n
    4. bar
    5. \n
    \n", "markdown": "1. foo\n2.\n3. bar\n", - "example": 246, - "start_line": 4237 + "html": "
      \n
    1. foo
    2. \n
    3. \n
    4. bar
    5. \n
    \n", + "example": 253, + "start_line": 4321, + "end_line": 4331, + "section": "List items" }, { - "end_line": 4258, - "section": "List items", - "html": "
      \n
    • \n
    \n", "markdown": "*\n", - "example": 247, - "start_line": 4252, + "html": "
      \n
    • \n
    \n", + "example": 254, + "start_line": 4336, + "end_line": 4342, + "section": "List items", "shouldFail": true }, { - "end_line": 4273, - "section": "List items", - "html": "

    foo\n*

    \n

    foo\n1.

    \n", "markdown": "foo\n*\n\nfoo\n1.\n", - "example": 248, - "start_line": 4262 + "html": "

    foo\n*

    \n

    foo\n1.

    \n", + "example": 255, + "start_line": 4346, + "end_line": 4357, + "section": "List items" }, { - "end_line": 4303, - "section": "List items", - "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", - "example": 249, - "start_line": 4284 + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "example": 256, + "start_line": 4368, + "end_line": 4387, + "section": "List items" }, { - "end_line": 4327, - "section": "List items", - "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", - "example": 250, - "start_line": 4308 + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "example": 257, + "start_line": 4392, + "end_line": 4411, + "section": "List items" }, { - "end_line": 4351, - "section": "List items", - "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", - "example": 251, - "start_line": 4332 + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "example": 258, + "start_line": 4416, + "end_line": 4435, + "section": "List items" }, { - "end_line": 4371, - "section": "List items", - "html": "
    1.  A paragraph\n    with two lines.\n\n        indented code\n\n    > A block quote.\n
    \n", "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", - "example": 252, - "start_line": 4356 + "html": "
    1.  A paragraph\n    with two lines.\n\n        indented code\n\n    > A block quote.\n
    \n", + "example": 259, + "start_line": 4440, + "end_line": 4455, + "section": "List items" }, { - "end_line": 4405, - "section": "List items", - "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", "markdown": " 1. A paragraph\nwith two lines.\n\n indented code\n\n > A block quote.\n", - "example": 253, - "start_line": 4386 + "html": "
      \n
    1. \n

      A paragraph\nwith two lines.

      \n
      indented code\n
      \n
      \n

      A block quote.

      \n
      \n
    2. \n
    \n", + "example": 260, + "start_line": 4470, + "end_line": 4489, + "section": "List items" }, { - "end_line": 4418, - "section": "List items", - "html": "
      \n
    1. A paragraph\nwith two lines.
    2. \n
    \n", "markdown": " 1. A paragraph\n with two lines.\n", - "example": 254, - "start_line": 4410 + "html": "
      \n
    1. A paragraph\nwith two lines.
    2. \n
    \n", + "example": 261, + "start_line": 4494, + "end_line": 4502, + "section": "List items" }, { - "end_line": 4437, - "section": "List items", - "html": "
    \n
      \n
    1. \n
      \n

      Blockquote\ncontinued here.

      \n
      \n
    2. \n
    \n
    \n", "markdown": "> 1. > Blockquote\ncontinued here.\n", - "example": 255, - "start_line": 4423 + "html": "
    \n
      \n
    1. \n
      \n

      Blockquote\ncontinued here.

      \n
      \n
    2. \n
    \n
    \n", + "example": 262, + "start_line": 4507, + "end_line": 4521, + "section": "List items" }, { - "end_line": 4454, - "section": "List items", - "html": "
    \n
      \n
    1. \n
      \n

      Blockquote\ncontinued here.

      \n
      \n
    2. \n
    \n
    \n", "markdown": "> 1. > Blockquote\n> continued here.\n", - "example": 256, - "start_line": 4440 + "html": "
    \n
      \n
    1. \n
      \n

      Blockquote\ncontinued here.

      \n
      \n
    2. \n
    \n
    \n", + "example": 263, + "start_line": 4524, + "end_line": 4538, + "section": "List items" }, { - "end_line": 4488, - "section": "List items", - "html": "
      \n
    • foo\n
        \n
      • bar\n
          \n
        • baz\n
            \n
          • boo
          • \n
          \n
        • \n
        \n
      • \n
      \n
    • \n
    \n", "markdown": "- foo\n - bar\n - baz\n - boo\n", - "example": 257, - "start_line": 4467 + "html": "
      \n
    • foo\n
        \n
      • bar\n
          \n
        • baz\n
            \n
          • boo
          • \n
          \n
        • \n
        \n
      • \n
      \n
    • \n
    \n", + "example": 264, + "start_line": 4552, + "end_line": 4573, + "section": "List items" }, { - "end_line": 4505, - "section": "List items", - "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    • baz
    • \n
    • boo
    • \n
    \n", "markdown": "- foo\n - bar\n - baz\n - boo\n", - "example": 258, - "start_line": 4493, + "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    • baz
    • \n
    • boo
    • \n
    \n", + "example": 265, + "start_line": 4578, + "end_line": 4590, + "section": "List items", "shouldFail": true }, { - "end_line": 4521, - "section": "List items", - "html": "
      \n
    1. foo\n
        \n
      • bar
      • \n
      \n
    2. \n
    \n", "markdown": "10) foo\n - bar\n", - "example": 259, - "start_line": 4510, + "html": "
      \n
    1. foo\n
        \n
      • bar
      • \n
      \n
    2. \n
    \n", + "example": 266, + "start_line": 4595, + "end_line": 4606, + "section": "List items", "shouldFail": true }, { - "end_line": 4536, - "section": "List items", - "html": "
      \n
    1. foo
    2. \n
    \n
      \n
    • bar
    • \n
    \n", "markdown": "10) foo\n - bar\n", - "example": 260, - "start_line": 4526, + "html": "
      \n
    1. foo
    2. \n
    \n
      \n
    • bar
    • \n
    \n", + "example": 267, + "start_line": 4611, + "end_line": 4621, + "section": "List items", "shouldFail": true }, { - "end_line": 4551, - "section": "List items", - "html": "
      \n
    • \n
        \n
      • foo
      • \n
      \n
    • \n
    \n", "markdown": "- - foo\n", - "example": 261, - "start_line": 4541 + "html": "
      \n
    • \n
        \n
      • foo
      • \n
      \n
    • \n
    \n", + "example": 268, + "start_line": 4626, + "end_line": 4636, + "section": "List items" }, { - "end_line": 4568, - "section": "List items", - "html": "
      \n
    1. \n
        \n
      • \n
          \n
        1. foo
        2. \n
        \n
      • \n
      \n
    2. \n
    \n", "markdown": "1. - 2. foo\n", - "example": 262, - "start_line": 4554 + "html": "
      \n
    1. \n
        \n
      • \n
          \n
        1. foo
        2. \n
        \n
      • \n
      \n
    2. \n
    \n", + "example": 269, + "start_line": 4639, + "end_line": 4653, + "section": "List items" }, { - "end_line": 4587, - "section": "List items", - "html": "
      \n
    • \n

      Foo

      \n
    • \n
    • \n

      Bar

      \nbaz
    • \n
    \n", "markdown": "- # Foo\n- Bar\n ---\n baz\n", - "example": 263, - "start_line": 4573 + "html": "
      \n
    • \n

      Foo

      \n
    • \n
    • \n

      Bar

      \nbaz
    • \n
    \n", + "example": 270, + "start_line": 4658, + "end_line": 4672, + "section": "List items" }, { - "end_line": 4821, - "section": "Lists", - "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    \n
      \n
    • baz
    • \n
    \n", "markdown": "- foo\n- bar\n+ baz\n", - "example": 264, - "start_line": 4809, + "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    \n
      \n
    • baz
    • \n
    \n", + "example": 271, + "start_line": 4894, + "end_line": 4906, + "section": "Lists", "shouldFail": true }, { - "end_line": 4836, - "section": "Lists", - "html": "
      \n
    1. foo
    2. \n
    3. bar
    4. \n
    \n
      \n
    1. baz
    2. \n
    \n", "markdown": "1. foo\n2. bar\n3) baz\n", - "example": 265, - "start_line": 4824, + "html": "
      \n
    1. foo
    2. \n
    3. bar
    4. \n
    \n
      \n
    1. baz
    2. \n
    \n", + "example": 272, + "start_line": 4909, + "end_line": 4921, + "section": "Lists", "shouldFail": true }, { - "end_line": 4853, - "section": "Lists", - "html": "

    Foo

    \n
      \n
    • bar
    • \n
    • baz
    • \n
    \n", "markdown": "Foo\n- bar\n- baz\n", - "example": 266, - "start_line": 4843 + "html": "

    Foo

    \n
      \n
    • bar
    • \n
    • baz
    • \n
    \n", + "example": 273, + "start_line": 4928, + "end_line": 4938, + "section": "Lists" }, { - "end_line": 4926, - "section": "Lists", - "html": "

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

    \n", "markdown": "The number of windows in my house is\n14. The number of doors is 6.\n", - "example": 267, - "start_line": 4920, + "html": "

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

    \n", + "example": 274, + "start_line": 5005, + "end_line": 5011, + "section": "Lists", "shouldFail": true }, { - "end_line": 4938, - "section": "Lists", - "html": "

    The number of windows in my house is

    \n
      \n
    1. The number of doors is 6.
    2. \n
    \n", "markdown": "The number of windows in my house is\n1. The number of doors is 6.\n", - "example": 268, - "start_line": 4930 + "html": "

    The number of windows in my house is

    \n
      \n
    1. The number of doors is 6.
    2. \n
    \n", + "example": 275, + "start_line": 5015, + "end_line": 5023, + "section": "Lists" }, { - "end_line": 4963, - "section": "Lists", - "html": "
      \n
    • \n

      foo

      \n
    • \n
    • \n

      bar

      \n
    • \n
    • \n

      baz

      \n
    • \n
    \n", "markdown": "- foo\n\n- bar\n\n\n- baz\n", - "example": 269, - "start_line": 4944, + "html": "
      \n
    • \n

      foo

      \n
    • \n
    • \n

      bar

      \n
    • \n
    • \n

      baz

      \n
    • \n
    \n", + "example": 276, + "start_line": 5029, + "end_line": 5048, + "section": "Lists", "shouldFail": true }, { - "end_line": 4987, - "section": "Lists", - "html": "
      \n
    • foo\n
        \n
      • bar\n
          \n
        • \n

          baz

          \n

          bim

          \n
        • \n
        \n
      • \n
      \n
    • \n
    \n", "markdown": "- foo\n - bar\n - baz\n\n\n bim\n", - "example": 270, - "start_line": 4965, + "html": "
      \n
    • foo\n
        \n
      • bar\n
          \n
        • \n

          baz

          \n

          bim

          \n
        • \n
        \n
      • \n
      \n
    • \n
    \n", + "example": 277, + "start_line": 5050, + "end_line": 5072, + "section": "Lists", "shouldFail": true }, { - "end_line": 5013, - "section": "Lists", - "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    \n\n
      \n
    • baz
    • \n
    • bim
    • \n
    \n", "markdown": "- foo\n- bar\n\n\n\n- baz\n- bim\n", - "example": 271, - "start_line": 4995 + "html": "
      \n
    • foo
    • \n
    • bar
    • \n
    \n\n
      \n
    • baz
    • \n
    • bim
    • \n
    \n", + "example": 278, + "start_line": 5080, + "end_line": 5098, + "section": "Lists" }, { - "end_line": 5039, - "section": "Lists", - "html": "
      \n
    • \n

      foo

      \n

      notcode

      \n
    • \n
    • \n

      foo

      \n
    • \n
    \n\n
    code\n
    \n", "markdown": "- foo\n\n notcode\n\n- foo\n\n\n\n code\n", - "example": 272, - "start_line": 5016 + "html": "
      \n
    • \n

      foo

      \n

      notcode

      \n
    • \n
    • \n

      foo

      \n
    • \n
    \n\n
    code\n
    \n", + "example": 279, + "start_line": 5101, + "end_line": 5124, + "section": "Lists" }, { - "end_line": 5069, + "markdown": "- a\n - b\n - c\n - d\n - e\n - f\n- g\n", + "html": "
      \n
    • a
    • \n
    • b
    • \n
    • c
    • \n
    • d
    • \n
    • e
    • \n
    • f
    • \n
    • g
    • \n
    \n", + "example": 280, + "start_line": 5132, + "end_line": 5150, "section": "Lists", - "html": "
      \n
    • a
    • \n
    • b
    • \n
    • c
    • \n
    • d
    • \n
    • e
    • \n
    • f
    • \n
    • g
    • \n
    • h
    • \n
    • i
    • \n
    \n", - "markdown": "- a\n - b\n - c\n - d\n - e\n - f\n - g\n - h\n- i\n", - "example": 273, - "start_line": 5047, "shouldFail": true }, { - "end_line": 5090, - "section": "Lists", + "markdown": "1. a\n\n 2. b\n\n 3. c\n", "html": "
      \n
    1. \n

      a

      \n
    2. \n
    3. \n

      b

      \n
    4. \n
    5. \n

      c

      \n
    6. \n
    \n", - "markdown": "1. a\n\n 2. b\n\n 3. c\n", - "example": 274, - "start_line": 5072, + "example": 281, + "start_line": 5153, + "end_line": 5171, + "section": "Lists", "shouldFail": true }, { - "end_line": 5113, + "markdown": "- a\n - b\n - c\n - d\n - e\n", + "html": "
      \n
    • a
    • \n
    • b
    • \n
    • c
    • \n
    • d\n- e
    • \n
    \n", + "example": 282, + "start_line": 5177, + "end_line": 5191, "section": "Lists", - "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n

      b

      \n
    • \n
    • \n

      c

      \n
    • \n
    \n", - "markdown": "- a\n- b\n\n- c\n", - "example": 275, - "start_line": 5096 + "shouldFail": true }, { - "end_line": 5133, + "markdown": "1. a\n\n 2. b\n\n 3. c\n", + "html": "
      \n
    1. \n

      a

      \n
    2. \n
    3. \n

      b

      \n
    4. \n
    \n
    3. c\n
    \n", + "example": 283, + "start_line": 5197, + "end_line": 5214, "section": "Lists", - "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n
    • \n

      c

      \n
    • \n
    \n", + "shouldFail": true + }, + { + "markdown": "- a\n- b\n\n- c\n", + "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n

      b

      \n
    • \n
    • \n

      c

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

      a

      \n
    • \n
    • \n
    • \n

      c

      \n
    • \n
    \n", + "example": 285, + "start_line": 5242, + "end_line": 5257, + "section": "Lists" }, { - "end_line": 5159, - "section": "Lists", - "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n

      b

      \n

      c

      \n
    • \n
    • \n

      d

      \n
    • \n
    \n", "markdown": "- a\n- b\n\n c\n- d\n", - "example": 277, - "start_line": 5140 + "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n

      b

      \n

      c

      \n
    • \n
    • \n

      d

      \n
    • \n
    \n", + "example": 286, + "start_line": 5264, + "end_line": 5283, + "section": "Lists" }, { - "end_line": 5180, - "section": "Lists", - "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n

      b

      \n
    • \n
    • \n

      d

      \n
    • \n
    \n", "markdown": "- a\n- b\n\n [ref]: /url\n- d\n", - "example": 278, - "start_line": 5162, + "html": "
      \n
    • \n

      a

      \n
    • \n
    • \n

      b

      \n
    • \n
    • \n

      d

      \n
    • \n
    \n", + "example": 287, + "start_line": 5286, + "end_line": 5304, + "section": "Lists", "shouldFail": true }, { - "end_line": 5204, - "section": "Lists", - "html": "
      \n
    • a
    • \n
    • \n
      b\n\n\n
      \n
    • \n
    • c
    • \n
    \n", "markdown": "- a\n- ```\n b\n\n\n ```\n- c\n", - "example": 279, - "start_line": 5185, + "html": "
      \n
    • a
    • \n
    • \n
      b\n\n\n
      \n
    • \n
    • c
    • \n
    \n", + "example": 288, + "start_line": 5309, + "end_line": 5328, + "section": "Lists", "shouldFail": true }, { - "end_line": 5229, - "section": "Lists", - "html": "
      \n
    • a\n
        \n
      • \n

        b

        \n

        c

        \n
      • \n
      \n
    • \n
    • d
    • \n
    \n", "markdown": "- a\n - b\n\n c\n- d\n", - "example": 280, - "start_line": 5211, + "html": "
      \n
    • a\n
        \n
      • \n

        b

        \n

        c

        \n
      • \n
      \n
    • \n
    • d
    • \n
    \n", + "example": 289, + "start_line": 5335, + "end_line": 5353, + "section": "Lists", "shouldFail": true }, { - "end_line": 5249, - "section": "Lists", - "html": "
      \n
    • a\n
      \n

      b

      \n
      \n
    • \n
    • c
    • \n
    \n", "markdown": "* a\n > b\n >\n* c\n", - "example": 281, - "start_line": 5235 + "html": "
      \n
    • a\n
      \n

      b

      \n
      \n
    • \n
    • c
    • \n
    \n", + "example": 290, + "start_line": 5359, + "end_line": 5373, + "section": "Lists" }, { - "end_line": 5273, - "section": "Lists", - "html": "
      \n
    • a\n
      \n

      b

      \n
      \n
      c\n
      \n
    • \n
    • d
    • \n
    \n", "markdown": "- a\n > b\n ```\n c\n ```\n- d\n", - "example": 282, - "start_line": 5255, + "html": "
      \n
    • a\n
      \n

      b

      \n
      \n
      c\n
      \n
    • \n
    • d
    • \n
    \n", + "example": 291, + "start_line": 5379, + "end_line": 5397, + "section": "Lists", "shouldFail": true }, { - "end_line": 5284, - "section": "Lists", - "html": "
      \n
    • a
    • \n
    \n", "markdown": "- a\n", - "example": 283, - "start_line": 5278 + "html": "
      \n
    • a
    • \n
    \n", + "example": 292, + "start_line": 5402, + "end_line": 5408, + "section": "Lists" }, { - "end_line": 5298, - "section": "Lists", - "html": "
      \n
    • a\n
        \n
      • b
      • \n
      \n
    • \n
    \n", "markdown": "- a\n - b\n", - "example": 284, - "start_line": 5287 + "html": "
      \n
    • a\n
        \n
      • b
      • \n
      \n
    • \n
    \n", + "example": 293, + "start_line": 5411, + "end_line": 5422, + "section": "Lists" }, { - "end_line": 5318, - "section": "Lists", - "html": "
      \n
    1. \n
      foo\n
      \n

      bar

      \n
    2. \n
    \n", "markdown": "1. ```\n foo\n ```\n\n bar\n", - "example": 285, - "start_line": 5304 + "html": "
      \n
    1. \n
      foo\n
      \n

      bar

      \n
    2. \n
    \n", + "example": 294, + "start_line": 5428, + "end_line": 5442, + "section": "Lists" }, { - "end_line": 5338, - "section": "Lists", - "html": "
      \n
    • \n

      foo

      \n
        \n
      • bar
      • \n
      \n

      baz

      \n
    • \n
    \n", "markdown": "* foo\n * bar\n\n baz\n", - "example": 286, - "start_line": 5323 + "html": "
      \n
    • \n

      foo

      \n
        \n
      • bar
      • \n
      \n

      baz

      \n
    • \n
    \n", + "example": 295, + "start_line": 5447, + "end_line": 5462, + "section": "Lists" }, { - "end_line": 5366, - "section": "Lists", - "html": "
      \n
    • \n

      a

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

      d

      \n
        \n
      • e
      • \n
      • f
      • \n
      \n
    • \n
    \n", "markdown": "- a\n - b\n - c\n\n- d\n - e\n - f\n", - "example": 287, - "start_line": 5341 + "html": "
      \n
    • \n

      a

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

      d

      \n
        \n
      • e
      • \n
      • f
      • \n
      \n
    • \n
    \n", + "example": 296, + "start_line": 5465, + "end_line": 5490, + "section": "Lists" }, { - "end_line": 5379, - "section": "Inlines", - "html": "

    hilo`

    \n", "markdown": "`hi`lo`\n", - "example": 288, - "start_line": 5375 + "html": "

    hilo`

    \n", + "example": 297, + "start_line": 5499, + "end_line": 5503, + "section": "Inlines" }, { - "end_line": 5393, - "section": "Backslash escapes", - "html": "

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

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

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

    \n", + "example": 298, + "start_line": 5513, + "end_line": 5517, + "section": "Backslash escapes" }, { - "end_line": 5403, - "section": "Backslash escapes", - "html": "

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

    \n", "markdown": "\\\t\\A\\a\\ \\3\\φ\\«\n", - "example": 290, - "start_line": 5399 + "html": "

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

    \n", + "example": 299, + "start_line": 5523, + "end_line": 5527, + "section": "Backslash escapes" }, { - "end_line": 5427, - "section": "Backslash escapes", - "html": "

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

    \n", - "markdown": "\\*not emphasized*\n\\
    not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n", - "example": 291, - "start_line": 5409 + "markdown": "\\*not emphasized*\n\\
    not a tag\n\\[not a link](/foo)\n\\`not code`\n1\\. not a list\n\\* not a list\n\\# not a heading\n\\[foo]: /url \"not a reference\"\n\\ö not a character entity\n", + "html": "

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

    \n", + "example": 300, + "start_line": 5533, + "end_line": 5553, + "section": "Backslash escapes" }, { - "end_line": 5436, - "section": "Backslash escapes", - "html": "

    \\emphasis

    \n", "markdown": "\\\\*emphasis*\n", - "example": 292, - "start_line": 5432 + "html": "

    \\emphasis

    \n", + "example": 301, + "start_line": 5558, + "end_line": 5562, + "section": "Backslash escapes" }, { - "end_line": 5447, - "section": "Backslash escapes", - "html": "

    foo
    \nbar

    \n", "markdown": "foo\\\nbar\n", - "example": 293, - "start_line": 5441 + "html": "

    foo
    \nbar

    \n", + "example": 302, + "start_line": 5567, + "end_line": 5573, + "section": "Backslash escapes" }, { - "end_line": 5457, - "section": "Backslash escapes", - "html": "

    \\[\\`

    \n", "markdown": "`` \\[\\` ``\n", - "example": 294, - "start_line": 5453 + "html": "

    \\[\\`

    \n", + "example": 303, + "start_line": 5579, + "end_line": 5583, + "section": "Backslash escapes" }, { - "end_line": 5465, - "section": "Backslash escapes", - "html": "
    \\[\\]\n
    \n", "markdown": " \\[\\]\n", - "example": 295, - "start_line": 5460 + "html": "
    \\[\\]\n
    \n", + "example": 304, + "start_line": 5586, + "end_line": 5591, + "section": "Backslash escapes" }, { - "end_line": 5475, - "section": "Backslash escapes", - "html": "
    \\[\\]\n
    \n", "markdown": "~~~\n\\[\\]\n~~~\n", - "example": 296, - "start_line": 5468 + "html": "
    \\[\\]\n
    \n", + "example": 305, + "start_line": 5594, + "end_line": 5601, + "section": "Backslash escapes" }, { - "end_line": 5482, - "section": "Backslash escapes", - "html": "

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

    \n", "markdown": "\n", - "example": 297, - "start_line": 5478 + "html": "

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

    \n", + "example": 306, + "start_line": 5604, + "end_line": 5608, + "section": "Backslash escapes" }, { - "end_line": 5489, - "section": "Backslash escapes", - "html": "\n", "markdown": "\n", - "example": 298, - "start_line": 5485 + "html": "\n", + "example": 307, + "start_line": 5611, + "end_line": 5615, + "section": "Backslash escapes" }, { - "end_line": 5499, - "section": "Backslash escapes", - "html": "

    foo

    \n", "markdown": "[foo](/bar\\* \"ti\\*tle\")\n", - "example": 299, - "start_line": 5495 + "html": "

    foo

    \n", + "example": 308, + "start_line": 5621, + "end_line": 5625, + "section": "Backslash escapes" }, { - "end_line": 5508, - "section": "Backslash escapes", - "html": "

    foo

    \n", "markdown": "[foo]\n\n[foo]: /bar\\* \"ti\\*tle\"\n", - "example": 300, - "start_line": 5502, + "html": "

    foo

    \n", + "example": 309, + "start_line": 5628, + "end_line": 5634, + "section": "Backslash escapes", "shouldFail": true }, { - "end_line": 5518, - "section": "Backslash escapes", - "html": "
    foo\n
    \n", "markdown": "``` foo\\+bar\nfoo\n```\n", - "example": 301, - "start_line": 5511, + "html": "
    foo\n
    \n", + "example": 310, + "start_line": 5637, + "end_line": 5644, + "section": "Backslash escapes", "shouldFail": true }, { - "end_line": 5546, - "section": "Entity and numeric character references", - "html": "

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

    \n", "markdown": "  & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸\n", - "example": 302, - "start_line": 5538 + "html": "

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

    \n", + "example": 311, + "start_line": 5674, + "end_line": 5682, + "section": "Entity and numeric character references" }, { - "end_line": 5561, - "section": "Entity and numeric character references", - "html": "

    # Ӓ Ϡ � �

    \n", - "markdown": "# Ӓ Ϡ � �\n", - "example": 303, - "start_line": 5557 + "markdown": "# Ӓ Ϡ �\n", + "html": "

    # Ӓ Ϡ �

    \n", + "example": 312, + "start_line": 5693, + "end_line": 5697, + "section": "Entity and numeric character references" }, { - "end_line": 5574, - "section": "Entity and numeric character references", - "html": "

    " ആ ಫ

    \n", "markdown": "" ആ ಫ\n", - "example": 304, - "start_line": 5570 + "html": "

    " ആ ಫ

    \n", + "example": 313, + "start_line": 5706, + "end_line": 5710, + "section": "Entity and numeric character references" }, { - "end_line": 5585, + "markdown": "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;\n", + "html": "

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

    \n", + "example": 314, + "start_line": 5715, + "end_line": 5725, "section": "Entity and numeric character references", - "html": "

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

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

    &copy

    \n", "markdown": "©\n", - "example": 306, - "start_line": 5592 + "html": "

    &copy

    \n", + "example": 315, + "start_line": 5732, + "end_line": 5736, + "section": "Entity and numeric character references" }, { - "end_line": 5606, - "section": "Entity and numeric character references", - "html": "

    &MadeUpEntity;

    \n", "markdown": "&MadeUpEntity;\n", - "example": 307, - "start_line": 5602 + "html": "

    &MadeUpEntity;

    \n", + "example": 316, + "start_line": 5742, + "end_line": 5746, + "section": "Entity and numeric character references" }, { - "end_line": 5617, - "section": "Entity and numeric character references", - "html": "\n", "markdown": "\n", - "example": 308, - "start_line": 5613 + "html": "\n", + "example": 317, + "start_line": 5753, + "end_line": 5757, + "section": "Entity and numeric character references" }, { - "end_line": 5624, - "section": "Entity and numeric character references", - "html": "

    foo

    \n", "markdown": "[foo](/föö \"föö\")\n", - "example": 309, - "start_line": 5620, + "html": "

    foo

    \n", + "example": 318, + "start_line": 5760, + "end_line": 5764, + "section": "Entity and numeric character references", "shouldFail": true }, { - "end_line": 5633, - "section": "Entity and numeric character references", - "html": "

    foo

    \n", "markdown": "[foo]\n\n[foo]: /föö \"föö\"\n", - "example": 310, - "start_line": 5627, + "html": "

    foo

    \n", + "example": 319, + "start_line": 5767, + "end_line": 5773, + "section": "Entity and numeric character references", "shouldFail": true }, { - "end_line": 5643, - "section": "Entity and numeric character references", - "html": "
    foo\n
    \n", "markdown": "``` föö\nfoo\n```\n", - "example": 311, - "start_line": 5636, + "html": "
    foo\n
    \n", + "example": 320, + "start_line": 5776, + "end_line": 5783, + "section": "Entity and numeric character references", "shouldFail": true }, { - "end_line": 5653, - "section": "Entity and numeric character references", - "html": "

    f&ouml;&ouml;

    \n", "markdown": "`föö`\n", - "example": 312, - "start_line": 5649 + "html": "

    f&ouml;&ouml;

    \n", + "example": 321, + "start_line": 5789, + "end_line": 5793, + "section": "Entity and numeric character references" }, { - "end_line": 5661, - "section": "Entity and numeric character references", - "html": "
    f&ouml;f&ouml;\n
    \n", "markdown": " föfö\n", - "example": 313, - "start_line": 5656 + "html": "
    f&ouml;f&ouml;\n
    \n", + "example": 322, + "start_line": 5796, + "end_line": 5801, + "section": "Entity and numeric character references" + }, + { + "markdown": "*foo*\n*foo*\n", + "html": "

    *foo*\nfoo

    \n", + "example": 323, + "start_line": 5808, + "end_line": 5814, + "section": "Entity and numeric character references" + }, + { + "markdown": "* foo\n\n* foo\n", + "html": "

    * foo

    \n
      \n
    • foo
    • \n
    \n", + "example": 324, + "start_line": 5816, + "end_line": 5825, + "section": "Entity and numeric character references" + }, + { + "markdown": "foo bar\n", + "html": "

    foo\n\nbar

    \n", + "example": 325, + "start_line": 5827, + "end_line": 5833, + "section": "Entity and numeric character references" + }, + { + "markdown": " foo\n", + "html": "

    \tfoo

    \n", + "example": 326, + "start_line": 5835, + "end_line": 5839, + "section": "Entity and numeric character references" + }, + { + "markdown": "[a](url "tit")\n", + "html": "

    [a](url "tit")

    \n", + "example": 327, + "start_line": 5842, + "end_line": 5846, + "section": "Entity and numeric character references" }, { - "end_line": 5682, - "section": "Code spans", - "html": "

    foo

    \n", "markdown": "`foo`\n", - "example": 314, - "start_line": 5678 + "html": "

    foo

    \n", + "example": 328, + "start_line": 5870, + "end_line": 5874, + "section": "Code spans" }, { - "end_line": 5692, - "section": "Code spans", + "markdown": "`` foo ` bar ``\n", "html": "

    foo ` bar

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

    ``

    \n", "markdown": "` `` `\n", - "example": 316, - "start_line": 5698 + "html": "

    ``

    \n", + "example": 330, + "start_line": 5891, + "end_line": 5895, + "section": "Code spans" }, { - "end_line": 5713, - "section": "Code spans", - "html": "

    foo

    \n", - "markdown": "``\nfoo\n``\n", - "example": 317, - "start_line": 5707 + "markdown": "` `` `\n", + "html": "

    ``

    \n", + "example": 331, + "start_line": 5899, + "end_line": 5903, + "section": "Code spans" }, { - "end_line": 5724, - "section": "Code spans", - "html": "

    foo bar baz

    \n", - "markdown": "`foo bar\n baz`\n", - "example": 318, - "start_line": 5719 + "markdown": "` a`\n", + "html": "

    a

    \n", + "example": 332, + "start_line": 5908, + "end_line": 5912, + "section": "Code spans" }, { - "end_line": 5734, - "section": "Code spans", - "html": "

    a b

    \n", - "markdown": "`a b`\n", - "example": 319, - "start_line": 5730 + "markdown": "` b `\n", + "html": "

     b 

    \n", + "example": 333, + "start_line": 5917, + "end_line": 5921, + "section": "Code spans" }, { - "end_line": 5754, - "section": "Code spans", - "html": "

    foo `` bar

    \n", - "markdown": "`foo `` bar`\n", - "example": 320, - "start_line": 5750 + "markdown": "` `\n` `\n", + "html": "

     \n

    \n", + "example": 334, + "start_line": 5925, + "end_line": 5931, + "section": "Code spans" + }, + { + "markdown": "``\nfoo\nbar \nbaz\n``\n", + "html": "

    foo bar baz

    \n", + "example": 335, + "start_line": 5936, + "end_line": 5944, + "section": "Code spans" + }, + { + "markdown": "``\nfoo \n``\n", + "html": "

    foo

    \n", + "example": 336, + "start_line": 5946, + "end_line": 5952, + "section": "Code spans" + }, + { + "markdown": "`foo bar \nbaz`\n", + "html": "

    foo bar baz

    \n", + "example": 337, + "start_line": 5957, + "end_line": 5962, + "section": "Code spans" }, { - "end_line": 5764, - "section": "Code spans", - "html": "

    foo\\bar`

    \n", "markdown": "`foo\\`bar`\n", - "example": 321, - "start_line": 5760 + "html": "

    foo\\bar`

    \n", + "example": 338, + "start_line": 5974, + "end_line": 5978, + "section": "Code spans" + }, + { + "markdown": "``foo`bar``\n", + "html": "

    foo`bar

    \n", + "example": 339, + "start_line": 5985, + "end_line": 5989, + "section": "Code spans" + }, + { + "markdown": "` foo `` bar `\n", + "html": "

    foo `` bar

    \n", + "example": 340, + "start_line": 5991, + "end_line": 5995, + "section": "Code spans" }, { - "end_line": 5780, - "section": "Code spans", - "html": "

    *foo*

    \n", "markdown": "*foo`*`\n", - "example": 322, - "start_line": 5776, + "html": "

    *foo*

    \n", + "example": 341, + "start_line": 6003, + "end_line": 6007, + "section": "Code spans", "shouldFail": true }, { - "end_line": 5789, - "section": "Code spans", - "html": "

    [not a link](/foo)

    \n", "markdown": "[not a `link](/foo`)\n", - "example": 323, - "start_line": 5785, + "html": "

    [not a link](/foo)

    \n", + "example": 342, + "start_line": 6012, + "end_line": 6016, + "section": "Code spans", "shouldFail": true }, { - "end_line": 5799, - "section": "Code spans", - "html": "

    <a href="">`

    \n", "markdown": "``\n", - "example": 324, - "start_line": 5795 + "html": "

    <a href="">`

    \n", + "example": 343, + "start_line": 6022, + "end_line": 6026, + "section": "Code spans" }, { - "end_line": 5808, - "section": "Code spans", - "html": "

    `

    \n", "markdown": "`\n", - "example": 325, - "start_line": 5804 + "html": "

    `

    \n", + "example": 344, + "start_line": 6031, + "end_line": 6035, + "section": "Code spans" }, { - "end_line": 5817, - "section": "Code spans", - "html": "

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

    \n", "markdown": "``\n", - "example": 326, - "start_line": 5813 + "html": "

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

    \n", + "example": 345, + "start_line": 6040, + "end_line": 6044, + "section": "Code spans" }, { - "end_line": 5826, - "section": "Code spans", - "html": "

    http://foo.bar.`baz`

    \n", "markdown": "`\n", - "example": 327, - "start_line": 5822 + "html": "

    http://foo.bar.`baz`

    \n", + "example": 346, + "start_line": 6049, + "end_line": 6053, + "section": "Code spans" }, { - "end_line": 5836, - "section": "Code spans", - "html": "

    ```foo``

    \n", "markdown": "```foo``\n", - "example": 328, - "start_line": 5832 + "html": "

    ```foo``

    \n", + "example": 347, + "start_line": 6059, + "end_line": 6063, + "section": "Code spans" }, { - "end_line": 5843, - "section": "Code spans", - "html": "

    `foo

    \n", "markdown": "`foo\n", - "example": 329, - "start_line": 5839 + "html": "

    `foo

    \n", + "example": 348, + "start_line": 6066, + "end_line": 6070, + "section": "Code spans" }, { - "end_line": 5852, - "section": "Code spans", - "html": "

    `foobar

    \n", "markdown": "`foo``bar``\n", - "example": 330, - "start_line": 5848 + "html": "

    `foobar

    \n", + "example": 349, + "start_line": 6075, + "end_line": 6079, + "section": "Code spans" }, { - "end_line": 6065, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "*foo bar*\n", - "example": 331, - "start_line": 6061 + "html": "

    foo bar

    \n", + "example": 350, + "start_line": 6292, + "end_line": 6296, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6075, - "section": "Emphasis and strong emphasis", - "html": "

    a * foo bar*

    \n", "markdown": "a * foo bar*\n", - "example": 332, - "start_line": 6071 + "html": "

    a * foo bar*

    \n", + "example": 351, + "start_line": 6302, + "end_line": 6306, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6086, - "section": "Emphasis and strong emphasis", - "html": "

    a*"foo"*

    \n", "markdown": "a*\"foo\"*\n", - "example": 333, - "start_line": 6082 + "html": "

    a*"foo"*

    \n", + "example": 352, + "start_line": 6313, + "end_line": 6317, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6095, + "markdown": "* a *\n", + "html": "

    * a *

    \n", + "example": 353, + "start_line": 6322, + "end_line": 6326, "section": "Emphasis and strong emphasis", - "html": "

    * a *

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

    foobar

    \n", "markdown": "foo*bar*\n", - "example": 335, - "start_line": 6100 + "html": "

    foobar

    \n", + "example": 354, + "start_line": 6331, + "end_line": 6335, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6111, - "section": "Emphasis and strong emphasis", - "html": "

    5678

    \n", "markdown": "5*6*78\n", - "example": 336, - "start_line": 6107 + "html": "

    5678

    \n", + "example": 355, + "start_line": 6338, + "end_line": 6342, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6120, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "_foo bar_\n", - "example": 337, - "start_line": 6116 + "html": "

    foo bar

    \n", + "example": 356, + "start_line": 6347, + "end_line": 6351, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6130, - "section": "Emphasis and strong emphasis", - "html": "

    _ foo bar_

    \n", "markdown": "_ foo bar_\n", - "example": 338, - "start_line": 6126 + "html": "

    _ foo bar_

    \n", + "example": 357, + "start_line": 6357, + "end_line": 6361, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6140, - "section": "Emphasis and strong emphasis", - "html": "

    a_"foo"_

    \n", "markdown": "a_\"foo\"_\n", - "example": 339, - "start_line": 6136 + "html": "

    a_"foo"_

    \n", + "example": 358, + "start_line": 6367, + "end_line": 6371, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6149, - "section": "Emphasis and strong emphasis", - "html": "

    foo_bar_

    \n", "markdown": "foo_bar_\n", - "example": 340, - "start_line": 6145 + "html": "

    foo_bar_

    \n", + "example": 359, + "start_line": 6376, + "end_line": 6380, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6156, - "section": "Emphasis and strong emphasis", - "html": "

    5_6_78

    \n", "markdown": "5_6_78\n", - "example": 341, - "start_line": 6152 + "html": "

    5_6_78

    \n", + "example": 360, + "start_line": 6383, + "end_line": 6387, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6163, - "section": "Emphasis and strong emphasis", - "html": "

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

    \n", "markdown": "пристаням_стремятся_\n", - "example": 342, - "start_line": 6159, + "html": "

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

    \n", + "example": 361, + "start_line": 6390, + "end_line": 6394, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6173, - "section": "Emphasis and strong emphasis", - "html": "

    aa_"bb"_cc

    \n", "markdown": "aa_\"bb\"_cc\n", - "example": 343, - "start_line": 6169 + "html": "

    aa_"bb"_cc

    \n", + "example": 362, + "start_line": 6400, + "end_line": 6404, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6184, - "section": "Emphasis and strong emphasis", - "html": "

    foo-(bar)

    \n", "markdown": "foo-_(bar)_\n", - "example": 344, - "start_line": 6180 + "html": "

    foo-(bar)

    \n", + "example": 363, + "start_line": 6411, + "end_line": 6415, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6196, - "section": "Emphasis and strong emphasis", - "html": "

    _foo*

    \n", "markdown": "_foo*\n", - "example": 345, - "start_line": 6192 + "html": "

    _foo*

    \n", + "example": 364, + "start_line": 6423, + "end_line": 6427, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6206, - "section": "Emphasis and strong emphasis", - "html": "

    *foo bar *

    \n", "markdown": "*foo bar *\n", - "example": 346, - "start_line": 6202 + "html": "

    *foo bar *

    \n", + "example": 365, + "start_line": 6433, + "end_line": 6437, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6217, - "section": "Emphasis and strong emphasis", - "html": "

    *foo bar\n*

    \n", "markdown": "*foo bar\n*\n", - "example": 347, - "start_line": 6211 + "html": "

    *foo bar\n*

    \n", + "example": 366, + "start_line": 6442, + "end_line": 6448, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6228, - "section": "Emphasis and strong emphasis", - "html": "

    *(*foo)

    \n", "markdown": "*(*foo)\n", - "example": 348, - "start_line": 6224, + "html": "

    *(*foo)

    \n", + "example": 367, + "start_line": 6455, + "end_line": 6459, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6238, - "section": "Emphasis and strong emphasis", - "html": "

    (foo)

    \n", "markdown": "*(*foo*)*\n", - "example": 349, - "start_line": 6234, + "html": "

    (foo)

    \n", + "example": 368, + "start_line": 6465, + "end_line": 6469, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6247, - "section": "Emphasis and strong emphasis", - "html": "

    foobar

    \n", "markdown": "*foo*bar\n", - "example": 350, - "start_line": 6243 + "html": "

    foobar

    \n", + "example": 369, + "start_line": 6474, + "end_line": 6478, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6260, - "section": "Emphasis and strong emphasis", - "html": "

    _foo bar _

    \n", "markdown": "_foo bar _\n", - "example": 351, - "start_line": 6256 + "html": "

    _foo bar _

    \n", + "example": 370, + "start_line": 6487, + "end_line": 6491, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6270, - "section": "Emphasis and strong emphasis", - "html": "

    _(_foo)

    \n", "markdown": "_(_foo)\n", - "example": 352, - "start_line": 6266, + "html": "

    _(_foo)

    \n", + "example": 371, + "start_line": 6497, + "end_line": 6501, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6279, - "section": "Emphasis and strong emphasis", - "html": "

    (foo)

    \n", "markdown": "_(_foo_)_\n", - "example": 353, - "start_line": 6275, + "html": "

    (foo)

    \n", + "example": 372, + "start_line": 6506, + "end_line": 6510, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6288, - "section": "Emphasis and strong emphasis", - "html": "

    _foo_bar

    \n", "markdown": "_foo_bar\n", - "example": 354, - "start_line": 6284 + "html": "

    _foo_bar

    \n", + "example": 373, + "start_line": 6515, + "end_line": 6519, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6295, - "section": "Emphasis and strong emphasis", - "html": "

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

    \n", "markdown": "_пристаням_стремятся\n", - "example": 355, - "start_line": 6291 + "html": "

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

    \n", + "example": 374, + "start_line": 6522, + "end_line": 6526, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6302, - "section": "Emphasis and strong emphasis", - "html": "

    foo_bar_baz

    \n", "markdown": "_foo_bar_baz_\n", - "example": 356, - "start_line": 6298 + "html": "

    foo_bar_baz

    \n", + "example": 375, + "start_line": 6529, + "end_line": 6533, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6313, - "section": "Emphasis and strong emphasis", - "html": "

    (bar).

    \n", "markdown": "_(bar)_.\n", - "example": 357, - "start_line": 6309 + "html": "

    (bar).

    \n", + "example": 376, + "start_line": 6540, + "end_line": 6544, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6322, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "**foo bar**\n", - "example": 358, - "start_line": 6318 + "html": "

    foo bar

    \n", + "example": 377, + "start_line": 6549, + "end_line": 6553, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6332, - "section": "Emphasis and strong emphasis", - "html": "

    ** foo bar**

    \n", "markdown": "** foo bar**\n", - "example": 359, - "start_line": 6328 + "html": "

    ** foo bar**

    \n", + "example": 378, + "start_line": 6559, + "end_line": 6563, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6343, - "section": "Emphasis and strong emphasis", - "html": "

    a**"foo"**

    \n", "markdown": "a**\"foo\"**\n", - "example": 360, - "start_line": 6339, + "html": "

    a**"foo"**

    \n", + "example": 379, + "start_line": 6570, + "end_line": 6574, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6352, - "section": "Emphasis and strong emphasis", - "html": "

    foobar

    \n", "markdown": "foo**bar**\n", - "example": 361, - "start_line": 6348 + "html": "

    foobar

    \n", + "example": 380, + "start_line": 6579, + "end_line": 6583, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6361, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "__foo bar__\n", - "example": 362, - "start_line": 6357 + "html": "

    foo bar

    \n", + "example": 381, + "start_line": 6588, + "end_line": 6592, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6371, - "section": "Emphasis and strong emphasis", - "html": "

    __ foo bar__

    \n", "markdown": "__ foo bar__\n", - "example": 363, - "start_line": 6367 + "html": "

    __ foo bar__

    \n", + "example": 382, + "start_line": 6598, + "end_line": 6602, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6381, - "section": "Emphasis and strong emphasis", - "html": "

    __\nfoo bar__

    \n", "markdown": "__\nfoo bar__\n", - "example": 364, - "start_line": 6375 + "html": "

    __\nfoo bar__

    \n", + "example": 383, + "start_line": 6606, + "end_line": 6612, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6391, - "section": "Emphasis and strong emphasis", - "html": "

    a__"foo"__

    \n", "markdown": "a__\"foo\"__\n", - "example": 365, - "start_line": 6387 + "html": "

    a__"foo"__

    \n", + "example": 384, + "start_line": 6618, + "end_line": 6622, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6400, - "section": "Emphasis and strong emphasis", - "html": "

    foo__bar__

    \n", "markdown": "foo__bar__\n", - "example": 366, - "start_line": 6396 + "html": "

    foo__bar__

    \n", + "example": 385, + "start_line": 6627, + "end_line": 6631, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6407, - "section": "Emphasis and strong emphasis", - "html": "

    5__6__78

    \n", "markdown": "5__6__78\n", - "example": 367, - "start_line": 6403 + "html": "

    5__6__78

    \n", + "example": 386, + "start_line": 6634, + "end_line": 6638, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6414, - "section": "Emphasis and strong emphasis", - "html": "

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

    \n", "markdown": "пристаням__стремятся__\n", - "example": 368, - "start_line": 6410, + "html": "

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

    \n", + "example": 387, + "start_line": 6641, + "end_line": 6645, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6421, - "section": "Emphasis and strong emphasis", - "html": "

    foo, bar, baz

    \n", "markdown": "__foo, __bar__, baz__\n", - "example": 369, - "start_line": 6417, + "html": "

    foo, bar, baz

    \n", + "example": 388, + "start_line": 6648, + "end_line": 6652, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6432, - "section": "Emphasis and strong emphasis", - "html": "

    foo-(bar)

    \n", "markdown": "foo-__(bar)__\n", - "example": 370, - "start_line": 6428 + "html": "

    foo-(bar)

    \n", + "example": 389, + "start_line": 6659, + "end_line": 6663, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6445, - "section": "Emphasis and strong emphasis", - "html": "

    **foo bar **

    \n", "markdown": "**foo bar **\n", - "example": 371, - "start_line": 6441, + "html": "

    **foo bar **

    \n", + "example": 390, + "start_line": 6672, + "end_line": 6676, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6458, - "section": "Emphasis and strong emphasis", - "html": "

    **(**foo)

    \n", "markdown": "**(**foo)\n", - "example": 372, - "start_line": 6454, + "html": "

    **(**foo)

    \n", + "example": 391, + "start_line": 6685, + "end_line": 6689, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6468, - "section": "Emphasis and strong emphasis", - "html": "

    (foo)

    \n", "markdown": "*(**foo**)*\n", - "example": 373, - "start_line": 6464 + "html": "

    (foo)

    \n", + "example": 392, + "start_line": 6695, + "end_line": 6699, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6477, - "section": "Emphasis and strong emphasis", - "html": "

    Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)

    \n", "markdown": "**Gomphocarpus (*Gomphocarpus physocarpus*, syn.\n*Asclepias physocarpa*)**\n", - "example": 374, - "start_line": 6471 + "html": "

    Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)

    \n", + "example": 393, + "start_line": 6702, + "end_line": 6708, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6484, - "section": "Emphasis and strong emphasis", - "html": "

    foo "bar" foo

    \n", "markdown": "**foo \"*bar*\" foo**\n", - "example": 375, - "start_line": 6480 + "html": "

    foo "bar" foo

    \n", + "example": 394, + "start_line": 6711, + "end_line": 6715, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6493, - "section": "Emphasis and strong emphasis", - "html": "

    foobar

    \n", "markdown": "**foo**bar\n", - "example": 376, - "start_line": 6489 + "html": "

    foobar

    \n", + "example": 395, + "start_line": 6720, + "end_line": 6724, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6505, - "section": "Emphasis and strong emphasis", - "html": "

    __foo bar __

    \n", "markdown": "__foo bar __\n", - "example": 377, - "start_line": 6501 + "html": "

    __foo bar __

    \n", + "example": 396, + "start_line": 6732, + "end_line": 6736, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6515, - "section": "Emphasis and strong emphasis", - "html": "

    __(__foo)

    \n", "markdown": "__(__foo)\n", - "example": 378, - "start_line": 6511, + "html": "

    __(__foo)

    \n", + "example": 397, + "start_line": 6742, + "end_line": 6746, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6525, - "section": "Emphasis and strong emphasis", - "html": "

    (foo)

    \n", "markdown": "_(__foo__)_\n", - "example": 379, - "start_line": 6521 + "html": "

    (foo)

    \n", + "example": 398, + "start_line": 6752, + "end_line": 6756, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6534, - "section": "Emphasis and strong emphasis", - "html": "

    __foo__bar

    \n", "markdown": "__foo__bar\n", - "example": 380, - "start_line": 6530, + "html": "

    __foo__bar

    \n", + "example": 399, + "start_line": 6761, + "end_line": 6765, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6541, - "section": "Emphasis and strong emphasis", - "html": "

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

    \n", "markdown": "__пристаням__стремятся\n", - "example": 381, - "start_line": 6537, + "html": "

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

    \n", + "example": 400, + "start_line": 6768, + "end_line": 6772, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6548, - "section": "Emphasis and strong emphasis", - "html": "

    foo__bar__baz

    \n", "markdown": "__foo__bar__baz__\n", - "example": 382, - "start_line": 6544, + "html": "

    foo__bar__baz

    \n", + "example": 401, + "start_line": 6775, + "end_line": 6779, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6559, - "section": "Emphasis and strong emphasis", - "html": "

    (bar).

    \n", "markdown": "__(bar)__.\n", - "example": 383, - "start_line": 6555 + "html": "

    (bar).

    \n", + "example": 402, + "start_line": 6786, + "end_line": 6790, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6571, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "*foo [bar](/url)*\n", - "example": 384, - "start_line": 6567 + "html": "

    foo bar

    \n", + "example": 403, + "start_line": 6798, + "end_line": 6802, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6580, - "section": "Emphasis and strong emphasis", - "html": "

    foo\nbar

    \n", "markdown": "*foo\nbar*\n", - "example": 385, - "start_line": 6574 + "html": "

    foo\nbar

    \n", + "example": 404, + "start_line": 6805, + "end_line": 6811, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6590, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar baz

    \n", "markdown": "_foo __bar__ baz_\n", - "example": 386, - "start_line": 6586 + "html": "

    foo bar baz

    \n", + "example": 405, + "start_line": 6817, + "end_line": 6821, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6597, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar baz

    \n", "markdown": "_foo _bar_ baz_\n", - "example": 387, - "start_line": 6593, + "html": "

    foo bar baz

    \n", + "example": 406, + "start_line": 6824, + "end_line": 6828, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6604, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "__foo_ bar_\n", - "example": 388, - "start_line": 6600, + "html": "

    foo bar

    \n", + "example": 407, + "start_line": 6831, + "end_line": 6835, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6611, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "*foo *bar**\n", - "example": 389, - "start_line": 6607 + "html": "

    foo bar

    \n", + "example": 408, + "start_line": 6838, + "end_line": 6842, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6618, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar baz

    \n", "markdown": "*foo **bar** baz*\n", - "example": 390, - "start_line": 6614 + "html": "

    foo bar baz

    \n", + "example": 409, + "start_line": 6845, + "end_line": 6849, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6624, - "section": "Emphasis and strong emphasis", - "html": "

    foobarbaz

    \n", "markdown": "*foo**bar**baz*\n", - "example": 391, - "start_line": 6620 + "html": "

    foobarbaz

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

    foo**bar

    \n", + "example": 411, + "start_line": 6875, + "end_line": 6879, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6649, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "***foo** bar*\n", - "example": 392, - "start_line": 6645, + "html": "

    foo bar

    \n", + "example": 412, + "start_line": 6888, + "end_line": 6892, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6656, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "*foo **bar***\n", - "example": 393, - "start_line": 6652, + "html": "

    foo bar

    \n", + "example": 413, + "start_line": 6895, + "end_line": 6899, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6663, - "section": "Emphasis and strong emphasis", - "html": "

    foobar

    \n", "markdown": "*foo**bar***\n", - "example": 394, - "start_line": 6659, + "html": "

    foobar

    \n", + "example": 414, + "start_line": 6902, + "end_line": 6906, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6672, + "markdown": "foo***bar***baz\n", + "html": "

    foobarbaz

    \n", + "example": 415, + "start_line": 6913, + "end_line": 6917, "section": "Emphasis and strong emphasis", - "html": "

    foo bar baz bim bop

    \n", - "markdown": "*foo **bar *baz* bim** bop*\n", - "example": 395, - "start_line": 6668, "shouldFail": true }, { - "end_line": 6679, + "markdown": "foo******bar*********baz\n", + "html": "

    foobar***baz

    \n", + "example": 416, + "start_line": 6919, + "end_line": 6923, "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", - "markdown": "*foo [*bar*](/url)*\n", - "example": 396, - "start_line": 6675 + "shouldFail": true + }, + { + "markdown": "*foo **bar *baz* bim** bop*\n", + "html": "

    foo bar baz bim bop

    \n", + "example": 417, + "start_line": 6928, + "end_line": 6932, + "section": "Emphasis and strong emphasis", + "shouldFail": true }, { - "end_line": 6688, + "markdown": "*foo [*bar*](/url)*\n", + "html": "

    foo bar

    \n", + "example": 418, + "start_line": 6935, + "end_line": 6939, "section": "Emphasis and strong emphasis", - "html": "

    ** is not an empty emphasis

    \n", + "shouldFail": true + }, + { "markdown": "** is not an empty emphasis\n", - "example": 397, - "start_line": 6684 + "html": "

    ** is not an empty emphasis

    \n", + "example": 419, + "start_line": 6944, + "end_line": 6948, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6695, - "section": "Emphasis and strong emphasis", - "html": "

    **** is not an empty strong emphasis

    \n", "markdown": "**** is not an empty strong emphasis\n", - "example": 398, - "start_line": 6691 + "html": "

    **** is not an empty strong emphasis

    \n", + "example": 420, + "start_line": 6951, + "end_line": 6955, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6708, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "**foo [bar](/url)**\n", - "example": 399, - "start_line": 6704 + "html": "

    foo bar

    \n", + "example": 421, + "start_line": 6964, + "end_line": 6968, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6717, - "section": "Emphasis and strong emphasis", - "html": "

    foo\nbar

    \n", "markdown": "**foo\nbar**\n", - "example": 400, - "start_line": 6711 + "html": "

    foo\nbar

    \n", + "example": 422, + "start_line": 6971, + "end_line": 6977, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6727, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar baz

    \n", "markdown": "__foo _bar_ baz__\n", - "example": 401, - "start_line": 6723 + "html": "

    foo bar baz

    \n", + "example": 423, + "start_line": 6983, + "end_line": 6987, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6734, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar baz

    \n", "markdown": "__foo __bar__ baz__\n", - "example": 402, - "start_line": 6730, + "html": "

    foo bar baz

    \n", + "example": 424, + "start_line": 6990, + "end_line": 6994, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6741, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "____foo__ bar__\n", - "example": 403, - "start_line": 6737, + "html": "

    foo bar

    \n", + "example": 425, + "start_line": 6997, + "end_line": 7001, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6748, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "**foo **bar****\n", - "example": 404, - "start_line": 6744 + "html": "

    foo bar

    \n", + "example": 426, + "start_line": 7004, + "end_line": 7008, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6755, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar baz

    \n", "markdown": "**foo *bar* baz**\n", - "example": 405, - "start_line": 6751 + "html": "

    foo bar baz

    \n", + "example": 427, + "start_line": 7011, + "end_line": 7015, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6762, - "section": "Emphasis and strong emphasis", - "html": "

    foobarbaz

    \n", "markdown": "**foo*bar*baz**\n", - "example": 406, - "start_line": 6758 + "html": "

    foobarbaz

    \n", + "example": 428, + "start_line": 7018, + "end_line": 7022, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6769, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "***foo* bar**\n", - "example": 407, - "start_line": 6765 + "html": "

    foo bar

    \n", + "example": 429, + "start_line": 7025, + "end_line": 7029, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6776, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "**foo *bar***\n", - "example": 408, - "start_line": 6772 + "html": "

    foo bar

    \n", + "example": 430, + "start_line": 7032, + "end_line": 7036, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6787, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar baz\nbim bop

    \n", "markdown": "**foo *bar **baz**\nbim* bop**\n", - "example": 409, - "start_line": 6781, + "html": "

    foo bar baz\nbim bop

    \n", + "example": 431, + "start_line": 7041, + "end_line": 7047, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6794, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar

    \n", "markdown": "**foo [*bar*](/url)**\n", - "example": 410, - "start_line": 6790 + "html": "

    foo bar

    \n", + "example": 432, + "start_line": 7050, + "end_line": 7054, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6803, - "section": "Emphasis and strong emphasis", - "html": "

    __ is not an empty emphasis

    \n", "markdown": "__ is not an empty emphasis\n", - "example": 411, - "start_line": 6799 + "html": "

    __ is not an empty emphasis

    \n", + "example": 433, + "start_line": 7059, + "end_line": 7063, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6810, - "section": "Emphasis and strong emphasis", - "html": "

    ____ is not an empty strong emphasis

    \n", "markdown": "____ is not an empty strong emphasis\n", - "example": 412, - "start_line": 6806 + "html": "

    ____ is not an empty strong emphasis

    \n", + "example": 434, + "start_line": 7066, + "end_line": 7070, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6820, - "section": "Emphasis and strong emphasis", - "html": "

    foo ***

    \n", "markdown": "foo ***\n", - "example": 413, - "start_line": 6816 + "html": "

    foo ***

    \n", + "example": 435, + "start_line": 7076, + "end_line": 7080, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6827, - "section": "Emphasis and strong emphasis", - "html": "

    foo *

    \n", "markdown": "foo *\\**\n", - "example": 414, - "start_line": 6823 + "html": "

    foo *

    \n", + "example": 436, + "start_line": 7083, + "end_line": 7087, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6834, - "section": "Emphasis and strong emphasis", - "html": "

    foo _

    \n", "markdown": "foo *_*\n", - "example": 415, - "start_line": 6830 + "html": "

    foo _

    \n", + "example": 437, + "start_line": 7090, + "end_line": 7094, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6841, - "section": "Emphasis and strong emphasis", - "html": "

    foo *****

    \n", "markdown": "foo *****\n", - "example": 416, - "start_line": 6837 + "html": "

    foo *****

    \n", + "example": 438, + "start_line": 7097, + "end_line": 7101, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6848, - "section": "Emphasis and strong emphasis", - "html": "

    foo *

    \n", "markdown": "foo **\\***\n", - "example": 417, - "start_line": 6844 + "html": "

    foo *

    \n", + "example": 439, + "start_line": 7104, + "end_line": 7108, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6855, - "section": "Emphasis and strong emphasis", - "html": "

    foo _

    \n", "markdown": "foo **_**\n", - "example": 418, - "start_line": 6851 + "html": "

    foo _

    \n", + "example": 440, + "start_line": 7111, + "end_line": 7115, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6866, - "section": "Emphasis and strong emphasis", - "html": "

    *foo

    \n", "markdown": "**foo*\n", - "example": 419, - "start_line": 6862, + "html": "

    *foo

    \n", + "example": 441, + "start_line": 7122, + "end_line": 7126, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6873, - "section": "Emphasis and strong emphasis", - "html": "

    foo*

    \n", "markdown": "*foo**\n", - "example": 420, - "start_line": 6869, + "html": "

    foo*

    \n", + "example": 442, + "start_line": 7129, + "end_line": 7133, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6880, - "section": "Emphasis and strong emphasis", - "html": "

    *foo

    \n", "markdown": "***foo**\n", - "example": 421, - "start_line": 6876, + "html": "

    *foo

    \n", + "example": 443, + "start_line": 7136, + "end_line": 7140, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6887, - "section": "Emphasis and strong emphasis", - "html": "

    ***foo

    \n", "markdown": "****foo*\n", - "example": 422, - "start_line": 6883, + "html": "

    ***foo

    \n", + "example": 444, + "start_line": 7143, + "end_line": 7147, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6894, - "section": "Emphasis and strong emphasis", - "html": "

    foo*

    \n", "markdown": "**foo***\n", - "example": 423, - "start_line": 6890, + "html": "

    foo*

    \n", + "example": 445, + "start_line": 7150, + "end_line": 7154, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6901, - "section": "Emphasis and strong emphasis", - "html": "

    foo***

    \n", "markdown": "*foo****\n", - "example": 424, - "start_line": 6897, + "html": "

    foo***

    \n", + "example": 446, + "start_line": 7157, + "end_line": 7161, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6911, - "section": "Emphasis and strong emphasis", - "html": "

    foo ___

    \n", "markdown": "foo ___\n", - "example": 425, - "start_line": 6907 + "html": "

    foo ___

    \n", + "example": 447, + "start_line": 7167, + "end_line": 7171, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6918, - "section": "Emphasis and strong emphasis", - "html": "

    foo _

    \n", "markdown": "foo _\\__\n", - "example": 426, - "start_line": 6914 + "html": "

    foo _

    \n", + "example": 448, + "start_line": 7174, + "end_line": 7178, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6925, - "section": "Emphasis and strong emphasis", - "html": "

    foo *

    \n", "markdown": "foo _*_\n", - "example": 427, - "start_line": 6921 + "html": "

    foo *

    \n", + "example": 449, + "start_line": 7181, + "end_line": 7185, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6932, - "section": "Emphasis and strong emphasis", - "html": "

    foo _____

    \n", "markdown": "foo _____\n", - "example": 428, - "start_line": 6928 + "html": "

    foo _____

    \n", + "example": 450, + "start_line": 7188, + "end_line": 7192, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6939, - "section": "Emphasis and strong emphasis", - "html": "

    foo _

    \n", "markdown": "foo __\\___\n", - "example": 429, - "start_line": 6935 + "html": "

    foo _

    \n", + "example": 451, + "start_line": 7195, + "end_line": 7199, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6946, - "section": "Emphasis and strong emphasis", - "html": "

    foo *

    \n", "markdown": "foo __*__\n", - "example": 430, - "start_line": 6942 + "html": "

    foo *

    \n", + "example": 452, + "start_line": 7202, + "end_line": 7206, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6953, - "section": "Emphasis and strong emphasis", - "html": "

    _foo

    \n", "markdown": "__foo_\n", - "example": 431, - "start_line": 6949, + "html": "

    _foo

    \n", + "example": 453, + "start_line": 7209, + "end_line": 7213, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6964, - "section": "Emphasis and strong emphasis", - "html": "

    foo_

    \n", "markdown": "_foo__\n", - "example": 432, - "start_line": 6960, + "html": "

    foo_

    \n", + "example": 454, + "start_line": 7220, + "end_line": 7224, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6971, - "section": "Emphasis and strong emphasis", - "html": "

    _foo

    \n", "markdown": "___foo__\n", - "example": 433, - "start_line": 6967, - "shouldFail": true + "html": "

    _foo

    \n", + "example": 455, + "start_line": 7227, + "end_line": 7231, + "section": "Emphasis and strong emphasis" }, { - "end_line": 6978, - "section": "Emphasis and strong emphasis", - "html": "

    ___foo

    \n", "markdown": "____foo_\n", - "example": 434, - "start_line": 6974, + "html": "

    ___foo

    \n", + "example": 456, + "start_line": 7234, + "end_line": 7238, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6985, - "section": "Emphasis and strong emphasis", - "html": "

    foo_

    \n", "markdown": "__foo___\n", - "example": 435, - "start_line": 6981, + "html": "

    foo_

    \n", + "example": 457, + "start_line": 7241, + "end_line": 7245, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 6992, - "section": "Emphasis and strong emphasis", - "html": "

    foo___

    \n", "markdown": "_foo____\n", - "example": 436, - "start_line": 6988, + "html": "

    foo___

    \n", + "example": 458, + "start_line": 7248, + "end_line": 7252, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 7002, - "section": "Emphasis and strong emphasis", - "html": "

    foo

    \n", "markdown": "**foo**\n", - "example": 437, - "start_line": 6998 + "html": "

    foo

    \n", + "example": 459, + "start_line": 7258, + "end_line": 7262, + "section": "Emphasis and strong emphasis" }, { - "end_line": 7009, - "section": "Emphasis and strong emphasis", - "html": "

    foo

    \n", "markdown": "*_foo_*\n", - "example": 438, - "start_line": 7005 + "html": "

    foo

    \n", + "example": 460, + "start_line": 7265, + "end_line": 7269, + "section": "Emphasis and strong emphasis" }, { - "end_line": 7016, - "section": "Emphasis and strong emphasis", - "html": "

    foo

    \n", "markdown": "__foo__\n", - "example": 439, - "start_line": 7012 + "html": "

    foo

    \n", + "example": 461, + "start_line": 7272, + "end_line": 7276, + "section": "Emphasis and strong emphasis" }, { - "end_line": 7023, - "section": "Emphasis and strong emphasis", - "html": "

    foo

    \n", "markdown": "_*foo*_\n", - "example": 440, - "start_line": 7019 + "html": "

    foo

    \n", + "example": 462, + "start_line": 7279, + "end_line": 7283, + "section": "Emphasis and strong emphasis" }, { - "end_line": 7033, - "section": "Emphasis and strong emphasis", - "html": "

    foo

    \n", "markdown": "****foo****\n", - "example": 441, - "start_line": 7029 + "html": "

    foo

    \n", + "example": 463, + "start_line": 7289, + "end_line": 7293, + "section": "Emphasis and strong emphasis" }, { - "end_line": 7040, - "section": "Emphasis and strong emphasis", - "html": "

    foo

    \n", "markdown": "____foo____\n", - "example": 442, - "start_line": 7036 + "html": "

    foo

    \n", + "example": 464, + "start_line": 7296, + "end_line": 7300, + "section": "Emphasis and strong emphasis" }, { - "end_line": 7051, - "section": "Emphasis and strong emphasis", - "html": "

    foo

    \n", "markdown": "******foo******\n", - "example": 443, - "start_line": 7047, + "html": "

    foo

    \n", + "example": 465, + "start_line": 7307, + "end_line": 7311, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 7060, - "section": "Emphasis and strong emphasis", - "html": "

    foo

    \n", "markdown": "***foo***\n", - "example": 444, - "start_line": 7056, + "html": "

    foo

    \n", + "example": 466, + "start_line": 7316, + "end_line": 7320, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 7067, - "section": "Emphasis and strong emphasis", - "html": "

    foo

    \n", "markdown": "_____foo_____\n", - "example": 445, - "start_line": 7063, + "html": "

    foo

    \n", + "example": 467, + "start_line": 7323, + "end_line": 7327, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 7076, - "section": "Emphasis and strong emphasis", - "html": "

    foo _bar baz_

    \n", "markdown": "*foo _bar* baz_\n", - "example": 446, - "start_line": 7072 + "html": "

    foo _bar baz_

    \n", + "example": 468, + "start_line": 7332, + "end_line": 7336, + "section": "Emphasis and strong emphasis" }, { - "end_line": 7083, - "section": "Emphasis and strong emphasis", - "html": "

    foo bar *baz bim bam

    \n", "markdown": "*foo __bar *baz bim__ bam*\n", - "example": 447, - "start_line": 7079 + "html": "

    foo bar *baz bim bam

    \n", + "example": 469, + "start_line": 7339, + "end_line": 7343, + "section": "Emphasis and strong emphasis" }, { - "end_line": 7092, - "section": "Emphasis and strong emphasis", - "html": "

    **foo bar baz

    \n", "markdown": "**foo **bar baz**\n", - "example": 448, - "start_line": 7088, + "html": "

    **foo bar baz

    \n", + "example": 470, + "start_line": 7348, + "end_line": 7352, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 7099, - "section": "Emphasis and strong emphasis", - "html": "

    *foo bar baz

    \n", "markdown": "*foo *bar baz*\n", - "example": 449, - "start_line": 7095, + "html": "

    *foo bar baz

    \n", + "example": 471, + "start_line": 7355, + "end_line": 7359, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 7108, - "section": "Emphasis and strong emphasis", - "html": "

    *bar*

    \n", "markdown": "*[bar*](/url)\n", - "example": 450, - "start_line": 7104 + "html": "

    *bar*

    \n", + "example": 472, + "start_line": 7364, + "end_line": 7368, + "section": "Emphasis and strong emphasis" }, { - "end_line": 7115, - "section": "Emphasis and strong emphasis", - "html": "

    _foo bar_

    \n", "markdown": "_foo [bar_](/url)\n", - "example": 451, - "start_line": 7111 + "html": "

    _foo bar_

    \n", + "example": 473, + "start_line": 7371, + "end_line": 7375, + "section": "Emphasis and strong emphasis" }, { - "end_line": 7122, - "section": "Emphasis and strong emphasis", - "html": "

    *

    \n", "markdown": "*\n", - "example": 452, - "start_line": 7118 + "html": "

    *

    \n", + "example": 474, + "start_line": 7378, + "end_line": 7382, + "section": "Emphasis and strong emphasis" }, { - "end_line": 7129, - "section": "Emphasis and strong emphasis", - "html": "

    **

    \n", "markdown": "**\n", - "example": 453, - "start_line": 7125, + "html": "

    **

    \n", + "example": 475, + "start_line": 7385, + "end_line": 7389, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 7136, - "section": "Emphasis and strong emphasis", - "html": "

    __

    \n", "markdown": "__\n", - "example": 454, - "start_line": 7132, + "html": "

    __

    \n", + "example": 476, + "start_line": 7392, + "end_line": 7396, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 7143, - "section": "Emphasis and strong emphasis", - "html": "

    a *

    \n", "markdown": "*a `*`*\n", - "example": 455, - "start_line": 7139 + "html": "

    a *

    \n", + "example": 477, + "start_line": 7399, + "end_line": 7403, + "section": "Emphasis and strong emphasis", + "shouldFail": true }, { - "end_line": 7150, - "section": "Emphasis and strong emphasis", - "html": "

    a _

    \n", "markdown": "_a `_`_\n", - "example": 456, - "start_line": 7146 + "html": "

    a _

    \n", + "example": 478, + "start_line": 7406, + "end_line": 7410, + "section": "Emphasis and strong emphasis" }, { - "end_line": 7157, - "section": "Emphasis and strong emphasis", - "html": "

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

    \n", "markdown": "**a\n", - "example": 457, - "start_line": 7153, + "html": "

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

    \n", + "example": 479, + "start_line": 7413, + "end_line": 7417, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 7164, - "section": "Emphasis and strong emphasis", - "html": "

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

    \n", "markdown": "__a\n", - "example": 458, - "start_line": 7160, + "html": "

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

    \n", + "example": 480, + "start_line": 7420, + "end_line": 7424, + "section": "Emphasis and strong emphasis", "shouldFail": true }, { - "end_line": 7245, - "section": "Links", - "html": "

    link

    \n", "markdown": "[link](/uri \"title\")\n", - "example": 459, - "start_line": 7241 + "html": "

    link

    \n", + "example": 481, + "start_line": 7503, + "end_line": 7507, + "section": "Links" }, { - "end_line": 7254, - "section": "Links", - "html": "

    link

    \n", "markdown": "[link](/uri)\n", - "example": 460, - "start_line": 7250 + "html": "

    link

    \n", + "example": 482, + "start_line": 7512, + "end_line": 7516, + "section": "Links" }, { - "end_line": 7263, - "section": "Links", - "html": "

    link

    \n", "markdown": "[link]()\n", - "example": 461, - "start_line": 7259 + "html": "

    link

    \n", + "example": 483, + "start_line": 7521, + "end_line": 7525, + "section": "Links" }, { - "end_line": 7270, - "section": "Links", - "html": "

    link

    \n", "markdown": "[link](<>)\n", - "example": 462, - "start_line": 7266 + "html": "

    link

    \n", + "example": 484, + "start_line": 7528, + "end_line": 7532, + "section": "Links" }, { - "end_line": 7280, - "section": "Links", - "html": "

    [link](/my uri)

    \n", "markdown": "[link](/my uri)\n", - "example": 463, - "start_line": 7276 + "html": "

    [link](/my uri)

    \n", + "example": 485, + "start_line": 7537, + "end_line": 7541, + "section": "Links" }, { - "end_line": 7287, - "section": "Links", - "html": "

    [link](</my uri>)

    \n", "markdown": "[link](
    )\n", - "example": 464, - "start_line": 7283 + "html": "

    link

    \n", + "example": 486, + "start_line": 7543, + "end_line": 7547, + "section": "Links", + "shouldFail": true }, { - "end_line": 7296, - "section": "Links", - "html": "

    [link](foo\nbar)

    \n", "markdown": "[link](foo\nbar)\n", - "example": 465, - "start_line": 7290 + "html": "

    [link](foo\nbar)

    \n", + "example": 487, + "start_line": 7552, + "end_line": 7558, + "section": "Links" }, { - "end_line": 7305, - "section": "Links", - "html": "

    [link]()

    \n", "markdown": "[link]()\n", - "example": 466, - "start_line": 7299 + "html": "

    [link]()

    \n", + "example": 488, + "start_line": 7560, + "end_line": 7566, + "section": "Links" }, { - "end_line": 7313, + "markdown": "[a]()\n", + "html": "

    a

    \n", + "example": 489, + "start_line": 7571, + "end_line": 7575, "section": "Links", - "html": "

    link

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

    [link](<foo>)

    \n", + "example": 490, + "start_line": 7579, + "end_line": 7583, "section": "Links", - "html": "

    link

    \n", - "markdown": "[link](foo(and(bar)))\n", - "example": 468, - "start_line": 7318 + "shouldFail": true }, { - "end_line": 7331, + "markdown": "[a](\n[a](c)\n", + "html": "

    [a](<b)c\n[a](<b)c>\n[a](c)

    \n", + "example": 491, + "start_line": 7588, + "end_line": 7596, "section": "Links", - "html": "

    link

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

    link

    \n", + "example": 492, + "start_line": 7600, + "end_line": 7604, + "section": "Links" + }, + { + "markdown": "[link](foo(and(bar)))\n", + "html": "

    link

    \n", + "example": 493, + "start_line": 7609, + "end_line": 7613, + "section": "Links" + }, + { + "markdown": "[link](foo\\(and\\(bar\\))\n", "html": "

    link

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

    link

    \n", + "example": 495, + "start_line": 7625, + "end_line": 7629, + "section": "Links" }, { - "end_line": 7348, - "section": "Links", - "html": "

    link

    \n", "markdown": "[link](foo\\)\\:)\n", - "example": 471, - "start_line": 7344 + "html": "

    link

    \n", + "example": 496, + "start_line": 7635, + "end_line": 7639, + "section": "Links" }, { - "end_line": 7363, - "section": "Links", - "html": "

    link

    \n

    link

    \n

    link

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

    link

    \n

    link

    \n

    link

    \n", + "example": 497, + "start_line": 7644, + "end_line": 7654, + "section": "Links" }, { - "end_line": 7373, - "section": "Links", - "html": "

    link

    \n", "markdown": "[link](foo\\bar)\n", - "example": 473, - "start_line": 7369 + "html": "

    link

    \n", + "example": 498, + "start_line": 7660, + "end_line": 7664, + "section": "Links" }, { - "end_line": 7389, - "section": "Links", - "html": "

    link

    \n", "markdown": "[link](foo%20bä)\n", - "example": 474, - "start_line": 7385, + "html": "

    link

    \n", + "example": 499, + "start_line": 7676, + "end_line": 7680, + "section": "Links", "shouldFail": true }, { - "end_line": 7400, - "section": "Links", - "html": "

    link

    \n", "markdown": "[link](\"title\")\n", - "example": 475, - "start_line": 7396 + "html": "

    link

    \n", + "example": 500, + "start_line": 7687, + "end_line": 7691, + "section": "Links" }, { - "end_line": 7413, - "section": "Links", - "html": "

    link\nlink\nlink

    \n", "markdown": "[link](/url \"title\")\n[link](/url 'title')\n[link](/url (title))\n", - "example": 476, - "start_line": 7405 + "html": "

    link\nlink\nlink

    \n", + "example": 501, + "start_line": 7696, + "end_line": 7704, + "section": "Links" }, { - "end_line": 7423, - "section": "Links", - "html": "

    link

    \n", "markdown": "[link](/url \"title \\\""\")\n", - "example": 477, - "start_line": 7419 + "html": "

    link

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

    link

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

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

    \n", "markdown": "[link](/url \"title \"and\" title\")\n", - "example": 479, - "start_line": 7438 + "html": "

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

    \n", + "example": 504, + "start_line": 7729, + "end_line": 7733, + "section": "Links" }, { - "end_line": 7451, - "section": "Links", - "html": "

    link

    \n", "markdown": "[link](/url 'title \"and\" title')\n", - "example": 480, - "start_line": 7447 + "html": "

    link

    \n", + "example": 505, + "start_line": 7738, + "end_line": 7742, + "section": "Links" }, { - "end_line": 7476, - "section": "Links", - "html": "

    link

    \n", "markdown": "[link]( /uri\n \"title\" )\n", - "example": 481, - "start_line": 7471 + "html": "

    link

    \n", + "example": 506, + "start_line": 7762, + "end_line": 7767, + "section": "Links" }, { - "end_line": 7486, - "section": "Links", - "html": "

    [link] (/uri)

    \n", "markdown": "[link] (/uri)\n", - "example": 482, - "start_line": 7482 + "html": "

    [link] (/uri)

    \n", + "example": 507, + "start_line": 7773, + "end_line": 7777, + "section": "Links" }, { - "end_line": 7496, - "section": "Links", - "html": "

    link [foo [bar]]

    \n", "markdown": "[link [foo [bar]]](/uri)\n", - "example": 483, - "start_line": 7492, + "html": "

    link [foo [bar]]

    \n", + "example": 508, + "start_line": 7783, + "end_line": 7787, + "section": "Links", "shouldFail": true }, { - "end_line": 7503, - "section": "Links", - "html": "

    [link] bar](/uri)

    \n", "markdown": "[link] bar](/uri)\n", - "example": 484, - "start_line": 7499 + "html": "

    [link] bar](/uri)

    \n", + "example": 509, + "start_line": 7790, + "end_line": 7794, + "section": "Links" }, { - "end_line": 7510, - "section": "Links", - "html": "

    [link bar

    \n", "markdown": "[link [bar](/uri)\n", - "example": 485, - "start_line": 7506 + "html": "

    [link bar

    \n", + "example": 510, + "start_line": 7797, + "end_line": 7801, + "section": "Links" }, { - "end_line": 7517, - "section": "Links", - "html": "

    link [bar

    \n", "markdown": "[link \\[bar](/uri)\n", - "example": 486, - "start_line": 7513 + "html": "

    link [bar

    \n", + "example": 511, + "start_line": 7804, + "end_line": 7808, + "section": "Links" }, { - "end_line": 7526, - "section": "Links", - "html": "

    link foo bar #

    \n", "markdown": "[link *foo **bar** `#`*](/uri)\n", - "example": 487, - "start_line": 7522 + "html": "

    link foo bar #

    \n", + "example": 512, + "start_line": 7813, + "end_line": 7817, + "section": "Links" }, { - "end_line": 7533, - "section": "Links", - "html": "

    \"moon\"

    \n", "markdown": "[![moon](moon.jpg)](/uri)\n", - "example": 488, - "start_line": 7529 + "html": "

    \"moon\"

    \n", + "example": 513, + "start_line": 7820, + "end_line": 7824, + "section": "Links" }, { - "end_line": 7542, - "section": "Links", - "html": "

    [foo bar](/uri)

    \n", "markdown": "[foo [bar](/uri)](/uri)\n", - "example": 489, - "start_line": 7538, + "html": "

    [foo bar](/uri)

    \n", + "example": 514, + "start_line": 7829, + "end_line": 7833, + "section": "Links", "shouldFail": true }, { - "end_line": 7549, - "section": "Links", - "html": "

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

    \n", "markdown": "[foo *[bar [baz](/uri)](/uri)*](/uri)\n", - "example": 490, - "start_line": 7545, + "html": "

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

    \n", + "example": 515, + "start_line": 7836, + "end_line": 7840, + "section": "Links", "shouldFail": true }, { - "end_line": 7556, - "section": "Links", - "html": "

    \"[foo](uri2)\"

    \n", "markdown": "![[[foo](uri1)](uri2)](uri3)\n", - "example": 491, - "start_line": 7552, + "html": "

    \"[foo](uri2)\"

    \n", + "example": 516, + "start_line": 7843, + "end_line": 7847, + "section": "Links", "shouldFail": true }, { - "end_line": 7566, - "section": "Links", - "html": "

    *foo*

    \n", "markdown": "*[foo*](/uri)\n", - "example": 492, - "start_line": 7562 + "html": "

    *foo*

    \n", + "example": 517, + "start_line": 7853, + "end_line": 7857, + "section": "Links" }, { - "end_line": 7573, - "section": "Links", - "html": "

    foo *bar

    \n", "markdown": "[foo *bar](baz*)\n", - "example": 493, - "start_line": 7569 + "html": "

    foo *bar

    \n", + "example": 518, + "start_line": 7860, + "end_line": 7864, + "section": "Links" }, { - "end_line": 7583, - "section": "Links", - "html": "

    foo [bar baz]

    \n", "markdown": "*foo [bar* baz]\n", - "example": 494, - "start_line": 7579 + "html": "

    foo [bar baz]

    \n", + "example": 519, + "start_line": 7870, + "end_line": 7874, + "section": "Links" }, { - "end_line": 7593, - "section": "Links", - "html": "

    [foo

    \n", "markdown": "[foo \n", - "example": 495, - "start_line": 7589, + "html": "

    [foo

    \n", + "example": 520, + "start_line": 7880, + "end_line": 7884, + "section": "Links", "shouldFail": true }, { - "end_line": 7600, - "section": "Links", - "html": "

    [foo](/uri)

    \n", "markdown": "[foo`](/uri)`\n", - "example": 496, - "start_line": 7596, + "html": "

    [foo](/uri)

    \n", + "example": 521, + "start_line": 7887, + "end_line": 7891, + "section": "Links", "shouldFail": true }, { - "end_line": 7607, - "section": "Links", - "html": "

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

    \n", "markdown": "[foo\n", - "example": 497, - "start_line": 7603, + "html": "

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

    \n", + "example": 522, + "start_line": 7894, + "end_line": 7898, + "section": "Links", "shouldFail": true }, { - "end_line": 7647, - "section": "Links", - "html": "

    foo

    \n", "markdown": "[foo][bar]\n\n[bar]: /url \"title\"\n", - "example": 498, - "start_line": 7641 + "html": "

    foo

    \n", + "example": 523, + "start_line": 7932, + "end_line": 7938, + "section": "Links" }, { - "end_line": 7662, - "section": "Links", - "html": "

    link [foo [bar]]

    \n", "markdown": "[link [foo [bar]]][ref]\n\n[ref]: /uri\n", - "example": 499, - "start_line": 7656, + "html": "

    link [foo [bar]]

    \n", + "example": 524, + "start_line": 7947, + "end_line": 7953, + "section": "Links", "shouldFail": true }, { - "end_line": 7671, - "section": "Links", - "html": "

    link [bar

    \n", "markdown": "[link \\[bar][ref]\n\n[ref]: /uri\n", - "example": 500, - "start_line": 7665 + "html": "

    link [bar

    \n", + "example": 525, + "start_line": 7956, + "end_line": 7962, + "section": "Links" }, { - "end_line": 7682, - "section": "Links", - "html": "

    link foo bar #

    \n", "markdown": "[link *foo **bar** `#`*][ref]\n\n[ref]: /uri\n", - "example": 501, - "start_line": 7676 + "html": "

    link foo bar #

    \n", + "example": 526, + "start_line": 7967, + "end_line": 7973, + "section": "Links" }, { - "end_line": 7691, - "section": "Links", - "html": "

    \"moon\"

    \n", "markdown": "[![moon](moon.jpg)][ref]\n\n[ref]: /uri\n", - "example": 502, - "start_line": 7685 + "html": "

    \"moon\"

    \n", + "example": 527, + "start_line": 7976, + "end_line": 7982, + "section": "Links" }, { - "end_line": 7702, - "section": "Links", - "html": "

    [foo bar]ref

    \n", "markdown": "[foo [bar](/uri)][ref]\n\n[ref]: /uri\n", - "example": 503, - "start_line": 7696, + "html": "

    [foo bar]ref

    \n", + "example": 528, + "start_line": 7987, + "end_line": 7993, + "section": "Links", "shouldFail": true }, { - "end_line": 7711, - "section": "Links", - "html": "

    [foo bar baz]ref

    \n", "markdown": "[foo *bar [baz][ref]*][ref]\n\n[ref]: /uri\n", - "example": 504, - "start_line": 7705, + "html": "

    [foo bar baz]ref

    \n", + "example": 529, + "start_line": 7996, + "end_line": 8002, + "section": "Links", "shouldFail": true }, { - "end_line": 7726, - "section": "Links", - "html": "

    *foo*

    \n", "markdown": "*[foo*][ref]\n\n[ref]: /uri\n", - "example": 505, - "start_line": 7720 + "html": "

    *foo*

    \n", + "example": 530, + "start_line": 8011, + "end_line": 8017, + "section": "Links" }, { - "end_line": 7735, - "section": "Links", - "html": "

    foo *bar

    \n", "markdown": "[foo *bar][ref]\n\n[ref]: /uri\n", - "example": 506, - "start_line": 7729 + "html": "

    foo *bar

    \n", + "example": 531, + "start_line": 8020, + "end_line": 8026, + "section": "Links" }, { - "end_line": 7747, - "section": "Links", - "html": "

    [foo

    \n", "markdown": "[foo \n\n[ref]: /uri\n", - "example": 507, - "start_line": 7741, + "html": "

    [foo

    \n", + "example": 532, + "start_line": 8032, + "end_line": 8038, + "section": "Links", "shouldFail": true }, { - "end_line": 7756, - "section": "Links", - "html": "

    [foo][ref]

    \n", "markdown": "[foo`][ref]`\n\n[ref]: /uri\n", - "example": 508, - "start_line": 7750, + "html": "

    [foo][ref]

    \n", + "example": 533, + "start_line": 8041, + "end_line": 8047, + "section": "Links", "shouldFail": true }, { - "end_line": 7765, - "section": "Links", - "html": "

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

    \n", "markdown": "[foo\n\n[ref]: /uri\n", - "example": 509, - "start_line": 7759, + "html": "

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

    \n", + "example": 534, + "start_line": 8050, + "end_line": 8056, + "section": "Links", "shouldFail": true }, { - "end_line": 7776, - "section": "Links", - "html": "

    foo

    \n", "markdown": "[foo][BaR]\n\n[bar]: /url \"title\"\n", - "example": 510, - "start_line": 7770 + "html": "

    foo

    \n", + "example": 535, + "start_line": 8061, + "end_line": 8067, + "section": "Links" }, { - "end_line": 7787, - "section": "Links", - "html": "

    Толпой is a Russian word.

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

    Толпой is a Russian word.

    \n", + "example": 536, + "start_line": 8072, + "end_line": 8078, + "section": "Links" }, { - "end_line": 7800, - "section": "Links", - "html": "

    Baz

    \n", "markdown": "[Foo\n bar]: /url\n\n[Baz][Foo bar]\n", - "example": 512, - "start_line": 7793 + "html": "

    Baz

    \n", + "example": 537, + "start_line": 8084, + "end_line": 8091, + "section": "Links" }, { - "end_line": 7812, - "section": "Links", - "html": "

    [foo] bar

    \n", "markdown": "[foo] [bar]\n\n[bar]: /url \"title\"\n", - "example": 513, - "start_line": 7806 + "html": "

    [foo] bar

    \n", + "example": 538, + "start_line": 8097, + "end_line": 8103, + "section": "Links" }, { - "end_line": 7823, - "section": "Links", - "html": "

    [foo]\nbar

    \n", "markdown": "[foo]\n[bar]\n\n[bar]: /url \"title\"\n", - "example": 514, - "start_line": 7815 + "html": "

    [foo]\nbar

    \n", + "example": 539, + "start_line": 8106, + "end_line": 8114, + "section": "Links" }, { - "end_line": 7864, - "section": "Links", - "html": "

    bar

    \n", "markdown": "[foo]: /url1\n\n[foo]: /url2\n\n[bar][foo]\n", - "example": 515, - "start_line": 7856 + "html": "

    bar

    \n", + "example": 540, + "start_line": 8147, + "end_line": 8155, + "section": "Links" }, { - "end_line": 7877, - "section": "Links", - "html": "

    [bar][foo!]

    \n", "markdown": "[bar][foo\\!]\n\n[foo!]: /url\n", - "example": 516, - "start_line": 7871 + "html": "

    [bar][foo!]

    \n", + "example": 541, + "start_line": 8162, + "end_line": 8168, + "section": "Links" }, { - "end_line": 7890, - "section": "Links", - "html": "

    [foo][ref[]

    \n

    [ref[]: /uri

    \n", "markdown": "[foo][ref[]\n\n[ref[]: /uri\n", - "example": 517, - "start_line": 7883 + "html": "

    [foo][ref[]

    \n

    [ref[]: /uri

    \n", + "example": 542, + "start_line": 8174, + "end_line": 8181, + "section": "Links" }, { - "end_line": 7900, - "section": "Links", - "html": "

    [foo][ref[bar]]

    \n

    [ref[bar]]: /uri

    \n", "markdown": "[foo][ref[bar]]\n\n[ref[bar]]: /uri\n", - "example": 518, - "start_line": 7893 + "html": "

    [foo][ref[bar]]

    \n

    [ref[bar]]: /uri

    \n", + "example": 543, + "start_line": 8184, + "end_line": 8191, + "section": "Links" }, { - "end_line": 7910, - "section": "Links", - "html": "

    [[[foo]]]

    \n

    [[[foo]]]: /url

    \n", "markdown": "[[[foo]]]\n\n[[[foo]]]: /url\n", - "example": 519, - "start_line": 7903 + "html": "

    [[[foo]]]

    \n

    [[[foo]]]: /url

    \n", + "example": 544, + "start_line": 8194, + "end_line": 8201, + "section": "Links" }, { - "end_line": 7919, - "section": "Links", - "html": "

    foo

    \n", "markdown": "[foo][ref\\[]\n\n[ref\\[]: /uri\n", - "example": 520, - "start_line": 7913 + "html": "

    foo

    \n", + "example": 545, + "start_line": 8204, + "end_line": 8210, + "section": "Links" }, { - "end_line": 7930, - "section": "Links", - "html": "

    bar\\

    \n", "markdown": "[bar\\\\]: /uri\n\n[bar\\\\]\n", - "example": 521, - "start_line": 7924 + "html": "

    bar\\

    \n", + "example": 546, + "start_line": 8215, + "end_line": 8221, + "section": "Links" }, { - "end_line": 7942, - "section": "Links", - "html": "

    []

    \n

    []: /uri

    \n", "markdown": "[]\n\n[]: /uri\n", - "example": 522, - "start_line": 7935 + "html": "

    []

    \n

    []: /uri

    \n", + "example": 547, + "start_line": 8226, + "end_line": 8233, + "section": "Links" }, { - "end_line": 7956, - "section": "Links", - "html": "

    [\n]

    \n

    [\n]: /uri

    \n", "markdown": "[\n ]\n\n[\n ]: /uri\n", - "example": 523, - "start_line": 7945 + "html": "

    [\n]

    \n

    [\n]: /uri

    \n", + "example": 548, + "start_line": 8236, + "end_line": 8247, + "section": "Links" }, { - "end_line": 7974, - "section": "Links", - "html": "

    foo

    \n", "markdown": "[foo][]\n\n[foo]: /url \"title\"\n", - "example": 524, - "start_line": 7968 + "html": "

    foo

    \n", + "example": 549, + "start_line": 8259, + "end_line": 8265, + "section": "Links" }, { - "end_line": 7983, - "section": "Links", - "html": "

    foo bar

    \n", "markdown": "[*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", - "example": 525, - "start_line": 7977 + "html": "

    foo bar

    \n", + "example": 550, + "start_line": 8268, + "end_line": 8274, + "section": "Links" }, { - "end_line": 7994, - "section": "Links", - "html": "

    Foo

    \n", "markdown": "[Foo][]\n\n[foo]: /url \"title\"\n", - "example": 526, - "start_line": 7988 + "html": "

    Foo

    \n", + "example": 551, + "start_line": 8279, + "end_line": 8285, + "section": "Links" }, { - "end_line": 8009, - "section": "Links", - "html": "

    foo\n[]

    \n", "markdown": "[foo] \n[]\n\n[foo]: /url \"title\"\n", - "example": 527, - "start_line": 8001 + "html": "

    foo\n[]

    \n", + "example": 552, + "start_line": 8292, + "end_line": 8300, + "section": "Links" }, { - "end_line": 8027, - "section": "Links", - "html": "

    foo

    \n", "markdown": "[foo]\n\n[foo]: /url \"title\"\n", - "example": 528, - "start_line": 8021 + "html": "

    foo

    \n", + "example": 553, + "start_line": 8312, + "end_line": 8318, + "section": "Links" }, { - "end_line": 8036, - "section": "Links", - "html": "

    foo bar

    \n", "markdown": "[*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", - "example": 529, - "start_line": 8030 + "html": "

    foo bar

    \n", + "example": 554, + "start_line": 8321, + "end_line": 8327, + "section": "Links" }, { - "end_line": 8045, - "section": "Links", - "html": "

    [foo bar]

    \n", "markdown": "[[*foo* bar]]\n\n[*foo* bar]: /url \"title\"\n", - "example": 530, - "start_line": 8039 + "html": "

    [foo bar]

    \n", + "example": 555, + "start_line": 8330, + "end_line": 8336, + "section": "Links" }, { - "end_line": 8054, - "section": "Links", - "html": "

    [[bar foo

    \n", "markdown": "[[bar [foo]\n\n[foo]: /url\n", - "example": 531, - "start_line": 8048 + "html": "

    [[bar foo

    \n", + "example": 556, + "start_line": 8339, + "end_line": 8345, + "section": "Links" }, { - "end_line": 8065, - "section": "Links", - "html": "

    Foo

    \n", "markdown": "[Foo]\n\n[foo]: /url \"title\"\n", - "example": 532, - "start_line": 8059 + "html": "

    Foo

    \n", + "example": 557, + "start_line": 8350, + "end_line": 8356, + "section": "Links" }, { - "end_line": 8076, - "section": "Links", - "html": "

    foo bar

    \n", "markdown": "[foo] bar\n\n[foo]: /url\n", - "example": 533, - "start_line": 8070 + "html": "

    foo bar

    \n", + "example": 558, + "start_line": 8361, + "end_line": 8367, + "section": "Links" }, { - "end_line": 8088, - "section": "Links", - "html": "

    [foo]

    \n", "markdown": "\\[foo]\n\n[foo]: /url \"title\"\n", - "example": 534, - "start_line": 8082 + "html": "

    [foo]

    \n", + "example": 559, + "start_line": 8373, + "end_line": 8379, + "section": "Links" }, { - "end_line": 8100, - "section": "Links", - "html": "

    *foo*

    \n", "markdown": "[foo*]: /url\n\n*[foo*]\n", - "example": 535, - "start_line": 8094 + "html": "

    *foo*

    \n", + "example": 560, + "start_line": 8385, + "end_line": 8391, + "section": "Links" }, { - "end_line": 8113, - "section": "Links", - "html": "

    foo

    \n", "markdown": "[foo][bar]\n\n[foo]: /url1\n[bar]: /url2\n", - "example": 536, - "start_line": 8106 + "html": "

    foo

    \n", + "example": 561, + "start_line": 8397, + "end_line": 8404, + "section": "Links" }, { - "end_line": 8121, - "section": "Links", - "html": "

    foo

    \n", "markdown": "[foo][]\n\n[foo]: /url1\n", - "example": 537, - "start_line": 8115 + "html": "

    foo

    \n", + "example": 562, + "start_line": 8406, + "end_line": 8412, + "section": "Links" }, { - "end_line": 8131, - "section": "Links", - "html": "

    foo

    \n", "markdown": "[foo]()\n\n[foo]: /url1\n", - "example": 538, - "start_line": 8125 + "html": "

    foo

    \n", + "example": 563, + "start_line": 8416, + "end_line": 8422, + "section": "Links" }, { - "end_line": 8139, - "section": "Links", - "html": "

    foo(not a link)

    \n", "markdown": "[foo](not a link)\n\n[foo]: /url1\n", - "example": 539, - "start_line": 8133 + "html": "

    foo(not a link)

    \n", + "example": 564, + "start_line": 8424, + "end_line": 8430, + "section": "Links" }, { - "end_line": 8150, - "section": "Links", - "html": "

    [foo]bar

    \n", "markdown": "[foo][bar][baz]\n\n[baz]: /url\n", - "example": 540, - "start_line": 8144 + "html": "

    [foo]bar

    \n", + "example": 565, + "start_line": 8435, + "end_line": 8441, + "section": "Links" }, { - "end_line": 8163, - "section": "Links", - "html": "

    foobaz

    \n", "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[bar]: /url2\n", - "example": 541, - "start_line": 8156 + "html": "

    foobaz

    \n", + "example": 566, + "start_line": 8447, + "end_line": 8454, + "section": "Links" }, { - "end_line": 8176, - "section": "Links", - "html": "

    [foo]bar

    \n", "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[foo]: /url2\n", - "example": 542, - "start_line": 8169 + "html": "

    [foo]bar

    \n", + "example": 567, + "start_line": 8460, + "end_line": 8467, + "section": "Links" }, { - "end_line": 8196, - "section": "Images", - "html": "

    \"foo\"

    \n", "markdown": "![foo](/url \"title\")\n", - "example": 543, - "start_line": 8192 + "html": "

    \"foo\"

    \n", + "example": 568, + "start_line": 8483, + "end_line": 8487, + "section": "Images" }, { - "end_line": 8205, - "section": "Images", - "html": "

    \"foo

    \n", "markdown": "![foo *bar*]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", - "example": 544, - "start_line": 8199, + "html": "

    \"foo

    \n", + "example": 569, + "start_line": 8490, + "end_line": 8496, + "section": "Images", "shouldFail": true }, { - "end_line": 8212, - "section": "Images", - "html": "

    \"foo

    \n", "markdown": "![foo ![bar](/url)](/url2)\n", - "example": 545, - "start_line": 8208, + "html": "

    \"foo

    \n", + "example": 570, + "start_line": 8499, + "end_line": 8503, + "section": "Images", "shouldFail": true }, { - "end_line": 8219, - "section": "Images", - "html": "

    \"foo

    \n", "markdown": "![foo [bar](/url)](/url2)\n", - "example": 546, - "start_line": 8215, + "html": "

    \"foo

    \n", + "example": 571, + "start_line": 8506, + "end_line": 8510, + "section": "Images", "shouldFail": true }, { - "end_line": 8235, - "section": "Images", - "html": "

    \"foo

    \n", "markdown": "![foo *bar*][]\n\n[foo *bar*]: train.jpg \"train & tracks\"\n", - "example": 547, - "start_line": 8229, + "html": "

    \"foo

    \n", + "example": 572, + "start_line": 8520, + "end_line": 8526, + "section": "Images", "shouldFail": true }, { - "end_line": 8244, - "section": "Images", - "html": "

    \"foo

    \n", "markdown": "![foo *bar*][foobar]\n\n[FOOBAR]: train.jpg \"train & tracks\"\n", - "example": 548, - "start_line": 8238, + "html": "

    \"foo

    \n", + "example": 573, + "start_line": 8529, + "end_line": 8535, + "section": "Images", "shouldFail": true }, { - "end_line": 8251, - "section": "Images", - "html": "

    \"foo\"

    \n", "markdown": "![foo](train.jpg)\n", - "example": 549, - "start_line": 8247 + "html": "

    \"foo\"

    \n", + "example": 574, + "start_line": 8538, + "end_line": 8542, + "section": "Images" }, { - "end_line": 8258, - "section": "Images", - "html": "

    My \"foo

    \n", "markdown": "My ![foo bar](/path/to/train.jpg \"title\" )\n", - "example": 550, - "start_line": 8254 + "html": "

    My \"foo

    \n", + "example": 575, + "start_line": 8545, + "end_line": 8549, + "section": "Images" }, { - "end_line": 8265, - "section": "Images", - "html": "

    \"foo\"

    \n", "markdown": "![foo]()\n", - "example": 551, - "start_line": 8261 + "html": "

    \"foo\"

    \n", + "example": 576, + "start_line": 8552, + "end_line": 8556, + "section": "Images" }, { - "end_line": 8272, - "section": "Images", - "html": "

    \"\"

    \n", "markdown": "![](/url)\n", - "example": 552, - "start_line": 8268 + "html": "

    \"\"

    \n", + "example": 577, + "start_line": 8559, + "end_line": 8563, + "section": "Images" }, { - "end_line": 8283, - "section": "Images", - "html": "

    \"foo\"

    \n", "markdown": "![foo][bar]\n\n[bar]: /url\n", - "example": 553, - "start_line": 8277 + "html": "

    \"foo\"

    \n", + "example": 578, + "start_line": 8568, + "end_line": 8574, + "section": "Images" }, { - "end_line": 8292, - "section": "Images", - "html": "

    \"foo\"

    \n", "markdown": "![foo][bar]\n\n[BAR]: /url\n", - "example": 554, - "start_line": 8286 + "html": "

    \"foo\"

    \n", + "example": 579, + "start_line": 8577, + "end_line": 8583, + "section": "Images" }, { - "end_line": 8303, - "section": "Images", - "html": "

    \"foo\"

    \n", "markdown": "![foo][]\n\n[foo]: /url \"title\"\n", - "example": 555, - "start_line": 8297 + "html": "

    \"foo\"

    \n", + "example": 580, + "start_line": 8588, + "end_line": 8594, + "section": "Images" }, { - "end_line": 8312, - "section": "Images", - "html": "

    \"foo

    \n", "markdown": "![*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", - "example": 556, - "start_line": 8306, + "html": "

    \"foo

    \n", + "example": 581, + "start_line": 8597, + "end_line": 8603, + "section": "Images", "shouldFail": true }, { - "end_line": 8323, - "section": "Images", - "html": "

    \"Foo\"

    \n", "markdown": "![Foo][]\n\n[foo]: /url \"title\"\n", - "example": 557, - "start_line": 8317 + "html": "

    \"Foo\"

    \n", + "example": 582, + "start_line": 8608, + "end_line": 8614, + "section": "Images" }, { - "end_line": 8337, - "section": "Images", - "html": "

    \"foo\"\n[]

    \n", "markdown": "![foo] \n[]\n\n[foo]: /url \"title\"\n", - "example": 558, - "start_line": 8329 + "html": "

    \"foo\"\n[]

    \n", + "example": 583, + "start_line": 8620, + "end_line": 8628, + "section": "Images" }, { - "end_line": 8348, - "section": "Images", - "html": "

    \"foo\"

    \n", "markdown": "![foo]\n\n[foo]: /url \"title\"\n", - "example": 559, - "start_line": 8342 + "html": "

    \"foo\"

    \n", + "example": 584, + "start_line": 8633, + "end_line": 8639, + "section": "Images" }, { - "end_line": 8357, - "section": "Images", - "html": "

    \"foo

    \n", "markdown": "![*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", - "example": 560, - "start_line": 8351, + "html": "

    \"foo

    \n", + "example": 585, + "start_line": 8642, + "end_line": 8648, + "section": "Images", "shouldFail": true }, { - "end_line": 8369, - "section": "Images", - "html": "

    ![[foo]]

    \n

    [[foo]]: /url "title"

    \n", "markdown": "![[foo]]\n\n[[foo]]: /url \"title\"\n", - "example": 561, - "start_line": 8362 + "html": "

    ![[foo]]

    \n

    [[foo]]: /url "title"

    \n", + "example": 586, + "start_line": 8653, + "end_line": 8660, + "section": "Images" }, { - "end_line": 8380, - "section": "Images", - "html": "

    \"Foo\"

    \n", "markdown": "![Foo]\n\n[foo]: /url \"title\"\n", - "example": 562, - "start_line": 8374 + "html": "

    \"Foo\"

    \n", + "example": 587, + "start_line": 8665, + "end_line": 8671, + "section": "Images" }, { - "end_line": 8392, - "section": "Images", - "html": "

    ![foo]

    \n", "markdown": "!\\[foo]\n\n[foo]: /url \"title\"\n", - "example": 563, - "start_line": 8386 + "html": "

    ![foo]

    \n", + "example": 588, + "start_line": 8677, + "end_line": 8683, + "section": "Images" }, { - "end_line": 8404, - "section": "Images", - "html": "

    !foo

    \n", "markdown": "\\![foo]\n\n[foo]: /url \"title\"\n", - "example": 564, - "start_line": 8398 + "html": "

    !foo

    \n", + "example": 589, + "start_line": 8689, + "end_line": 8695, + "section": "Images" }, { - "end_line": 8435, - "section": "Autolinks", - "html": "

    http://foo.bar.baz

    \n", "markdown": "\n", - "example": 565, - "start_line": 8431 + "html": "

    http://foo.bar.baz

    \n", + "example": 590, + "start_line": 8722, + "end_line": 8726, + "section": "Autolinks" }, { - "end_line": 8442, - "section": "Autolinks", - "html": "

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

    \n", "markdown": "\n", - "example": 566, - "start_line": 8438 + "html": "

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

    \n", + "example": 591, + "start_line": 8729, + "end_line": 8733, + "section": "Autolinks" }, { - "end_line": 8449, - "section": "Autolinks", - "html": "

    irc://foo.bar:2233/baz

    \n", "markdown": "\n", - "example": 567, - "start_line": 8445 + "html": "

    irc://foo.bar:2233/baz

    \n", + "example": 592, + "start_line": 8736, + "end_line": 8740, + "section": "Autolinks" }, { - "end_line": 8458, - "section": "Autolinks", - "html": "

    MAILTO:FOO@BAR.BAZ

    \n", "markdown": "\n", - "example": 568, - "start_line": 8454 + "html": "

    MAILTO:FOO@BAR.BAZ

    \n", + "example": 593, + "start_line": 8745, + "end_line": 8749, + "section": "Autolinks" }, { - "end_line": 8470, - "section": "Autolinks", - "html": "

    a+b+c:d

    \n", "markdown": "\n", - "example": 569, - "start_line": 8466 + "html": "

    a+b+c:d

    \n", + "example": 594, + "start_line": 8757, + "end_line": 8761, + "section": "Autolinks" }, { - "end_line": 8477, - "section": "Autolinks", - "html": "

    made-up-scheme://foo,bar

    \n", "markdown": "\n", - "example": 570, - "start_line": 8473 + "html": "

    made-up-scheme://foo,bar

    \n", + "example": 595, + "start_line": 8764, + "end_line": 8768, + "section": "Autolinks" }, { - "end_line": 8484, - "section": "Autolinks", - "html": "

    http://../

    \n", "markdown": "\n", - "example": 571, - "start_line": 8480 + "html": "

    http://../

    \n", + "example": 596, + "start_line": 8771, + "end_line": 8775, + "section": "Autolinks" }, { - "end_line": 8491, - "section": "Autolinks", - "html": "

    localhost:5001/foo

    \n", "markdown": "\n", - "example": 572, - "start_line": 8487 + "html": "

    localhost:5001/foo

    \n", + "example": 597, + "start_line": 8778, + "end_line": 8782, + "section": "Autolinks" }, { - "end_line": 8500, - "section": "Autolinks", - "html": "

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

    \n", "markdown": "\n", - "example": 573, - "start_line": 8496, + "html": "

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

    \n", + "example": 598, + "start_line": 8787, + "end_line": 8791, + "section": "Autolinks", "shouldFail": true }, { - "end_line": 8509, - "section": "Autolinks", - "html": "

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

    \n", "markdown": "\n", - "example": 574, - "start_line": 8505 + "html": "

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

    \n", + "example": 599, + "start_line": 8796, + "end_line": 8800, + "section": "Autolinks" }, { - "end_line": 8531, - "section": "Autolinks", - "html": "

    foo@bar.example.com

    \n", "markdown": "\n", - "example": 575, - "start_line": 8527 + "html": "

    foo@bar.example.com

    \n", + "example": 600, + "start_line": 8818, + "end_line": 8822, + "section": "Autolinks" }, { - "end_line": 8538, - "section": "Autolinks", - "html": "

    foo+special@Bar.baz-bar0.com

    \n", "markdown": "\n", - "example": 576, - "start_line": 8534 + "html": "

    foo+special@Bar.baz-bar0.com

    \n", + "example": 601, + "start_line": 8825, + "end_line": 8829, + "section": "Autolinks" }, { - "end_line": 8547, - "section": "Autolinks", - "html": "

    <foo+@bar.example.com>

    \n", "markdown": "\n", - "example": 577, - "start_line": 8543 + "html": "

    <foo+@bar.example.com>

    \n", + "example": 602, + "start_line": 8834, + "end_line": 8838, + "section": "Autolinks" }, { - "end_line": 8556, - "section": "Autolinks", - "html": "

    <>

    \n", "markdown": "<>\n", - "example": 578, - "start_line": 8552 + "html": "

    <>

    \n", + "example": 603, + "start_line": 8843, + "end_line": 8847, + "section": "Autolinks" }, { - "end_line": 8563, - "section": "Autolinks", - "html": "

    < http://foo.bar >

    \n", "markdown": "< http://foo.bar >\n", - "example": 579, - "start_line": 8559, + "html": "

    < http://foo.bar >

    \n", + "example": 604, + "start_line": 8850, + "end_line": 8854, + "section": "Autolinks", "shouldFail": true }, { - "end_line": 8570, - "section": "Autolinks", - "html": "

    <m:abc>

    \n", "markdown": "\n", - "example": 580, - "start_line": 8566 + "html": "

    <m:abc>

    \n", + "example": 605, + "start_line": 8857, + "end_line": 8861, + "section": "Autolinks" }, { - "end_line": 8577, - "section": "Autolinks", - "html": "

    <foo.bar.baz>

    \n", "markdown": "\n", - "example": 581, - "start_line": 8573 + "html": "

    <foo.bar.baz>

    \n", + "example": 606, + "start_line": 8864, + "end_line": 8868, + "section": "Autolinks" }, { - "end_line": 8584, - "section": "Autolinks", - "html": "

    http://example.com

    \n", "markdown": "http://example.com\n", - "example": 582, - "start_line": 8580, + "html": "

    http://example.com

    \n", + "example": 607, + "start_line": 8871, + "end_line": 8875, + "section": "Autolinks", "shouldFail": true }, { - "end_line": 8591, - "section": "Autolinks", - "html": "

    foo@bar.example.com

    \n", "markdown": "foo@bar.example.com\n", - "example": 583, - "start_line": 8587, + "html": "

    foo@bar.example.com

    \n", + "example": 608, + "start_line": 8878, + "end_line": 8882, + "section": "Autolinks", "shouldFail": true }, { - "end_line": 8673, - "section": "Raw HTML", - "html": "

    \n", "markdown": "\n", - "example": 584, - "start_line": 8669 + "html": "

    \n", + "example": 609, + "start_line": 8960, + "end_line": 8964, + "section": "Raw HTML" }, { - "end_line": 8682, - "section": "Raw HTML", - "html": "

    \n", "markdown": "\n", - "example": 585, - "start_line": 8678 + "html": "

    \n", + "example": 610, + "start_line": 8969, + "end_line": 8973, + "section": "Raw HTML" }, { - "end_line": 8693, - "section": "Raw HTML", - "html": "

    \n", "markdown": "\n", - "example": 586, - "start_line": 8687 + "html": "

    \n", + "example": 611, + "start_line": 8978, + "end_line": 8984, + "section": "Raw HTML" }, { - "end_line": 8704, - "section": "Raw HTML", - "html": "

    \n", "markdown": "\n", - "example": 587, - "start_line": 8698 + "html": "

    \n", + "example": 612, + "start_line": 8989, + "end_line": 8995, + "section": "Raw HTML" }, { - "end_line": 8713, - "section": "Raw HTML", - "html": "

    Foo

    \n", "markdown": "Foo \n", - "example": 588, - "start_line": 8709 + "html": "

    Foo

    \n", + "example": 613, + "start_line": 9000, + "end_line": 9004, + "section": "Raw HTML" }, { - "end_line": 8722, - "section": "Raw HTML", - "html": "

    <33> <__>

    \n", "markdown": "<33> <__>\n", - "example": 589, - "start_line": 8718 + "html": "

    <33> <__>

    \n", + "example": 614, + "start_line": 9009, + "end_line": 9013, + "section": "Raw HTML" }, { - "end_line": 8731, - "section": "Raw HTML", - "html": "

    <a h*#ref="hi">

    \n", "markdown": "
    \n", - "example": 590, - "start_line": 8727 + "html": "

    <a h*#ref="hi">

    \n", + "example": 615, + "start_line": 9018, + "end_line": 9022, + "section": "Raw HTML" }, { - "end_line": 8740, - "section": "Raw HTML", - "html": "

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

    \n", "markdown": "
    \n", - "example": 591, - "start_line": 8736 + "html": "

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

    \n", + "example": 616, + "start_line": 9027, + "end_line": 9031, + "section": "Raw HTML" }, { - "end_line": 8751, - "section": "Raw HTML", - "html": "

    < a><\nfoo><bar/ >

    \n", - "markdown": "< a><\nfoo>\n", - "example": 592, - "start_line": 8745 + "markdown": "< a><\nfoo>\n\n", + "html": "

    < a><\nfoo><bar/ >\n<foo bar=baz\nbim!bop />

    \n", + "example": 617, + "start_line": 9036, + "end_line": 9046, + "section": "Raw HTML" }, { - "end_line": 8760, - "section": "Raw HTML", - "html": "

    <a href='bar'title=title>

    \n", "markdown": "
    \n", - "example": 593, - "start_line": 8756 + "html": "

    <a href='bar'title=title>

    \n", + "example": 618, + "start_line": 9051, + "end_line": 9055, + "section": "Raw HTML" }, { - "end_line": 8769, - "section": "Raw HTML", - "html": "

    \n", "markdown": "\n", - "example": 594, - "start_line": 8765 + "html": "

    \n", + "example": 619, + "start_line": 9060, + "end_line": 9064, + "section": "Raw HTML" }, { - "end_line": 8778, - "section": "Raw HTML", - "html": "

    </a href="foo">

    \n", "markdown": "\n", - "example": 595, - "start_line": 8774 + "html": "

    </a href="foo">

    \n", + "example": 620, + "start_line": 9069, + "end_line": 9073, + "section": "Raw HTML" }, { - "end_line": 8789, - "section": "Raw HTML", - "html": "

    foo

    \n", "markdown": "foo \n", - "example": 596, - "start_line": 8783 + "html": "

    foo

    \n", + "example": 621, + "start_line": 9078, + "end_line": 9084, + "section": "Raw HTML" }, { - "end_line": 8796, - "section": "Raw HTML", - "html": "

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

    \n", "markdown": "foo \n", - "example": 597, - "start_line": 8792, + "html": "

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

    \n", + "example": 622, + "start_line": 9087, + "end_line": 9091, + "section": "Raw HTML", "shouldFail": true }, { - "end_line": 8808, - "section": "Raw HTML", - "html": "

    foo <!--> foo -->

    \n

    foo <!-- foo--->

    \n", "markdown": "foo foo -->\n\nfoo \n", - "example": 598, - "start_line": 8801, + "html": "

    foo <!--> foo -->

    \n

    foo <!-- foo--->

    \n", + "example": 623, + "start_line": 9096, + "end_line": 9103, + "section": "Raw HTML", "shouldFail": true }, { - "end_line": 8817, - "section": "Raw HTML", - "html": "

    foo

    \n", "markdown": "foo \n", - "example": 599, - "start_line": 8813 + "html": "

    foo

    \n", + "example": 624, + "start_line": 9108, + "end_line": 9112, + "section": "Raw HTML" }, { - "end_line": 8826, - "section": "Raw HTML", - "html": "

    foo

    \n", "markdown": "foo \n", - "example": 600, - "start_line": 8822 + "html": "

    foo

    \n", + "example": 625, + "start_line": 9117, + "end_line": 9121, + "section": "Raw HTML" }, { - "end_line": 8835, - "section": "Raw HTML", - "html": "

    foo &<]]>

    \n", "markdown": "foo &<]]>\n", - "example": 601, - "start_line": 8831 + "html": "

    foo &<]]>

    \n", + "example": 626, + "start_line": 9126, + "end_line": 9130, + "section": "Raw HTML" }, { - "end_line": 8845, - "section": "Raw HTML", - "html": "

    foo

    \n", "markdown": "foo \n", - "example": 602, - "start_line": 8841 + "html": "

    foo

    \n", + "example": 627, + "start_line": 9136, + "end_line": 9140, + "section": "Raw HTML" }, { - "end_line": 8854, - "section": "Raw HTML", - "html": "

    foo

    \n", "markdown": "foo \n", - "example": 603, - "start_line": 8850 + "html": "

    foo

    \n", + "example": 628, + "start_line": 9145, + "end_line": 9149, + "section": "Raw HTML" }, { - "end_line": 8861, - "section": "Raw HTML", - "html": "

    <a href=""">

    \n", "markdown": "
    \n", - "example": 604, - "start_line": 8857 + "html": "

    <a href=""">

    \n", + "example": 629, + "start_line": 9152, + "end_line": 9156, + "section": "Raw HTML" }, { - "end_line": 8877, - "section": "Hard line breaks", - "html": "

    foo
    \nbaz

    \n", "markdown": "foo \nbaz\n", - "example": 605, - "start_line": 8871 + "html": "

    foo
    \nbaz

    \n", + "example": 630, + "start_line": 9166, + "end_line": 9172, + "section": "Hard line breaks" }, { - "end_line": 8889, - "section": "Hard line breaks", - "html": "

    foo
    \nbaz

    \n", "markdown": "foo\\\nbaz\n", - "example": 606, - "start_line": 8883 + "html": "

    foo
    \nbaz

    \n", + "example": 631, + "start_line": 9178, + "end_line": 9184, + "section": "Hard line breaks" }, { - "end_line": 8900, - "section": "Hard line breaks", - "html": "

    foo
    \nbaz

    \n", "markdown": "foo \nbaz\n", - "example": 607, - "start_line": 8894 + "html": "

    foo
    \nbaz

    \n", + "example": 632, + "start_line": 9189, + "end_line": 9195, + "section": "Hard line breaks" }, { - "end_line": 8911, - "section": "Hard line breaks", - "html": "

    foo
    \nbar

    \n", "markdown": "foo \n bar\n", - "example": 608, - "start_line": 8905 + "html": "

    foo
    \nbar

    \n", + "example": 633, + "start_line": 9200, + "end_line": 9206, + "section": "Hard line breaks" }, { - "end_line": 8920, - "section": "Hard line breaks", - "html": "

    foo
    \nbar

    \n", "markdown": "foo\\\n bar\n", - "example": 609, - "start_line": 8914 + "html": "

    foo
    \nbar

    \n", + "example": 634, + "start_line": 9209, + "end_line": 9215, + "section": "Hard line breaks" }, { - "end_line": 8932, - "section": "Hard line breaks", - "html": "

    foo
    \nbar

    \n", "markdown": "*foo \nbar*\n", - "example": 610, - "start_line": 8926 + "html": "

    foo
    \nbar

    \n", + "example": 635, + "start_line": 9221, + "end_line": 9227, + "section": "Hard line breaks" }, { - "end_line": 8941, - "section": "Hard line breaks", - "html": "

    foo
    \nbar

    \n", "markdown": "*foo\\\nbar*\n", - "example": 611, - "start_line": 8935 + "html": "

    foo
    \nbar

    \n", + "example": 636, + "start_line": 9230, + "end_line": 9236, + "section": "Hard line breaks" }, { - "end_line": 8951, - "section": "Hard line breaks", - "html": "

    code span

    \n", - "markdown": "`code \nspan`\n", - "example": 612, - "start_line": 8946 + "markdown": "`code \nspan`\n", + "html": "

    code span

    \n", + "example": 637, + "start_line": 9241, + "end_line": 9246, + "section": "Hard line breaks" }, { - "end_line": 8959, - "section": "Hard line breaks", - "html": "

    code\\ span

    \n", "markdown": "`code\\\nspan`\n", - "example": 613, - "start_line": 8954 + "html": "

    code\\ span

    \n", + "example": 638, + "start_line": 9249, + "end_line": 9254, + "section": "Hard line breaks" }, { - "end_line": 8970, - "section": "Hard line breaks", - "html": "

    \n", "markdown": "\n", - "example": 614, - "start_line": 8964 + "html": "

    \n", + "example": 639, + "start_line": 9259, + "end_line": 9265, + "section": "Hard line breaks" }, { - "end_line": 8979, - "section": "Hard line breaks", - "html": "

    \n", "markdown": "\n", - "example": 615, - "start_line": 8973 + "html": "

    \n", + "example": 640, + "start_line": 9268, + "end_line": 9274, + "section": "Hard line breaks" }, { - "end_line": 8990, - "section": "Hard line breaks", - "html": "

    foo\\

    \n", "markdown": "foo\\\n", - "example": 616, - "start_line": 8986 + "html": "

    foo\\

    \n", + "example": 641, + "start_line": 9281, + "end_line": 9285, + "section": "Hard line breaks" }, { - "end_line": 8997, - "section": "Hard line breaks", - "html": "

    foo

    \n", "markdown": "foo \n", - "example": 617, - "start_line": 8993 + "html": "

    foo

    \n", + "example": 642, + "start_line": 9288, + "end_line": 9292, + "section": "Hard line breaks" }, { - "end_line": 9004, - "section": "Hard line breaks", - "html": "

    foo\\

    \n", "markdown": "### foo\\\n", - "example": 618, - "start_line": 9000 + "html": "

    foo\\

    \n", + "example": 643, + "start_line": 9295, + "end_line": 9299, + "section": "Hard line breaks" }, { - "end_line": 9011, - "section": "Hard line breaks", - "html": "

    foo

    \n", "markdown": "### foo \n", - "example": 619, - "start_line": 9007 + "html": "

    foo

    \n", + "example": 644, + "start_line": 9302, + "end_line": 9306, + "section": "Hard line breaks" }, { - "end_line": 9028, - "section": "Soft line breaks", - "html": "

    foo\nbaz

    \n", "markdown": "foo\nbaz\n", - "example": 620, - "start_line": 9022 + "html": "

    foo\nbaz

    \n", + "example": 645, + "start_line": 9317, + "end_line": 9323, + "section": "Soft line breaks" }, { - "end_line": 9040, - "section": "Soft line breaks", - "html": "

    foo\nbaz

    \n", "markdown": "foo \n baz\n", - "example": 621, - "start_line": 9034 + "html": "

    foo\nbaz

    \n", + "example": 646, + "start_line": 9329, + "end_line": 9335, + "section": "Soft line breaks" }, { - "end_line": 9058, - "section": "Textual content", - "html": "

    hello $.;'there

    \n", "markdown": "hello $.;'there\n", - "example": 622, - "start_line": 9054 + "html": "

    hello $.;'there

    \n", + "example": 647, + "start_line": 9349, + "end_line": 9353, + "section": "Textual content" }, { - "end_line": 9065, - "section": "Textual content", - "html": "

    Foo χρῆν

    \n", "markdown": "Foo χρῆν\n", - "example": 623, - "start_line": 9061 + "html": "

    Foo χρῆν

    \n", + "example": 648, + "start_line": 9356, + "end_line": 9360, + "section": "Textual content" }, { - "end_line": 9074, - "section": "Textual content", - "html": "

    Multiple spaces

    \n", "markdown": "Multiple spaces\n", - "example": 624, - "start_line": 9070 + "html": "

    Multiple spaces

    \n", + "example": 649, + "start_line": 9365, + "end_line": 9369, + "section": "Textual content" } ] From 902f07e0d94bfba3a2f60a2ef53279bc577d40f5 Mon Sep 17 00:00:00 2001 From: x13machine Date: Wed, 22 May 2019 01:16:36 -0500 Subject: [PATCH 09/10] tests fix --- test/specs/commonmark/commonmark.0.29.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/specs/commonmark/commonmark.0.29.json b/test/specs/commonmark/commonmark.0.29.json index ac86b64442..e080b070ff 100644 --- a/test/specs/commonmark/commonmark.0.29.json +++ b/test/specs/commonmark/commonmark.0.29.json @@ -3414,8 +3414,7 @@ "example": 418, "start_line": 6935, "end_line": 6939, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "** is not an empty emphasis\n", @@ -3722,7 +3721,8 @@ "example": 455, "start_line": 7227, "end_line": 7231, - "section": "Emphasis and strong emphasis" + "section": "Emphasis and strong emphasis", + "shouldFail": true }, { "markdown": "____foo_\n", @@ -3908,8 +3908,7 @@ "example": 477, "start_line": 7399, "end_line": 7403, - "section": "Emphasis and strong emphasis", - "shouldFail": true + "section": "Emphasis and strong emphasis" }, { "markdown": "_a `_`_\n", From 88f99db0e763c404a89d49c6e0c5771efb7c49d8 Mon Sep 17 00:00:00 2001 From: x13machine Date: Wed, 22 May 2019 11:43:31 -0500 Subject: [PATCH 10/10] move files --- test/{ => specs}/new/em_list_links.html | 0 test/{ => specs}/new/em_list_links.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename test/{ => specs}/new/em_list_links.html (100%) rename test/{ => specs}/new/em_list_links.md (100%) diff --git a/test/new/em_list_links.html b/test/specs/new/em_list_links.html similarity index 100% rename from test/new/em_list_links.html rename to test/specs/new/em_list_links.html diff --git a/test/new/em_list_links.md b/test/specs/new/em_list_links.md similarity index 100% rename from test/new/em_list_links.md rename to test/specs/new/em_list_links.md