From 9a8c2c8d229f1f05c0bb5241b563d0538beeea01 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 10 Mar 2014 00:59:32 -0500 Subject: [PATCH] Revert "rough implementation of task lists. see #107 #111." This reverts commit 26cef98d7261cb8330c07eceff250254124f20d8. --- lib/marked.js | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index dbcd573a0b..d5522afce2 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -22,7 +22,6 @@ var block = { list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/, def: /^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, - task: noop, table: noop, paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, text: /^[^\n]+/ @@ -76,7 +75,6 @@ block.normal = merge({}, block); */ block.gfm = merge({}, block.normal, { - task: /^(\s*\[[x ]\][^\n]+\n)+\n*/, fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, paragraph: /^/ }); @@ -377,33 +375,6 @@ Lexer.prototype.token = function(src, top, bq) { continue; } - // task (gfm) - if (top && (cap = this.rules.task.exec(src)) { - src = src.substring(cap[0].length); - - this.tokens.push({ - type: 'task_list_start' - }); - - cap[0] = cap[0].replace(/^\s+|\s+$/g, ''); - cap = cap[0].split(/\n+/); - - i = 0; - l = cap.length; - - for (; i < l; i++) { - this.tokens.push({ - type: 'task_item', - checked: /^\s*\[x\]/.test(cap[i]), - text: cap[i].replace(/^\s*\[[x ]\]\s*/, '') - }); - } - - this.tokens.push({ - type: 'task_list_end' - }); - } - // table (gfm) if (top && (cap = this.rules.table.exec(src))) { src = src.substring(cap[0].length); @@ -1009,25 +980,6 @@ Parser.prototype.tok = function() { this.token.lang, this.token.escaped); } - case 'task_list_start': { - var body = '' - , i = 1; - - while (this.next().type !== 'task_list_end') { - body += '
  • '; - } - - return ''; - } case 'table': { var header = '' , body = ''