Comparing version 0.2.5 to 0.2.6
@@ -20,6 +20,6 @@ /** | ||
blockquote: /^( *>[^\n]+(\n[^\n]+)*\n*)+/, | ||
list: /^( *)(bull) [^\0]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, | ||
list: /^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, | ||
html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/, | ||
def: /^ *\[([^\]]+)\]: *([^\s]+)(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, | ||
paragraph: /^([^\n]+\n?(?!body))+\n*/, | ||
paragraph: /^([^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+\n*/, | ||
text: /^[^\n]+/ | ||
@@ -40,28 +40,17 @@ }; | ||
block.html = replace(block.html) | ||
('comment', /<!--[^\0]*?-->/) | ||
('closed', /<(tag)[^\0]+?<\/\1>/) | ||
('closing', /<tag(?!:\/|@)\b(?:"[^"]*"|'[^']*'|[^'">])*?>/) | ||
('comment', /<!--[\s\S]*?-->/) | ||
('closed', /<(tag)[\s\S]+?<\/\1>/) | ||
('closing', /<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/) | ||
(/tag/g, tag()) | ||
(); | ||
block.paragraph = (function() { | ||
var paragraph = block.paragraph.source | ||
, body = []; | ||
block.paragraph = replace(block.paragraph) | ||
('hr', block.hr) | ||
('heading', block.heading) | ||
('lheading', block.lheading) | ||
('blockquote', block.blockquote) | ||
('tag', '<' + tag()) | ||
('def', block.def) | ||
(); | ||
(function push(rule) { | ||
rule = block[rule] ? block[rule].source : rule; | ||
body.push(rule.replace(/(^|[^\[])\^/g, '$1')); | ||
return push; | ||
}) | ||
('hr') | ||
('heading') | ||
('lheading') | ||
('blockquote') | ||
('<' + tag()) | ||
('def'); | ||
return new | ||
RegExp(paragraph.replace('body', body.join('|'))); | ||
})(); | ||
block.normal = { | ||
@@ -73,3 +62,3 @@ fences: block.fences, | ||
block.gfm = { | ||
fences: /^ *``` *(\w+)? *\n([^\0]+?)\s*``` *(?:\n+|$)/, | ||
fences: /^ *(```|~~~) *(\w+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, | ||
paragraph: /^/ | ||
@@ -79,3 +68,3 @@ }; | ||
block.gfm.paragraph = replace(block.paragraph) | ||
('(?!', '(?!' + block.gfm.fences.source.replace(/(^|[^\[])\^/g, '$1') + '|') | ||
('(?!', '(?!' + block.gfm.fences.source.replace('\\1', '\\2') + '|') | ||
(); | ||
@@ -138,4 +127,4 @@ | ||
type: 'code', | ||
lang: cap[1], | ||
text: cap[2] | ||
lang: cap[2], | ||
text: cap[3] | ||
}); | ||
@@ -265,3 +254,5 @@ continue; | ||
tokens.push({ | ||
type: 'html', | ||
type: options.sanitize | ||
? 'paragraph' | ||
: 'html', | ||
pre: cap[1] === 'pre', | ||
@@ -316,15 +307,15 @@ text: cap[0] | ||
url: noop, | ||
tag: /^<!--[^\0]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, | ||
tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, | ||
link: /^!?\[(inside)\]\(href\)/, | ||
reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, | ||
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, | ||
strong: /^__([^\0]+?)__(?!_)|^\*\*([^\0]+?)\*\*(?!\*)/, | ||
em: /^\b_((?:__|[^\0])+?)_\b|^\*((?:\*\*|[^\0])+?)\*(?!\*)/, | ||
code: /^(`+)([^\0]*?[^`])\1(?!`)/, | ||
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, | ||
em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, | ||
code: /^(`+)([\s\S]*?[^`])\1(?!`)/, | ||
br: /^ {2,}\n(?!\s*$)/, | ||
text: /^[^\0]+?(?=[\\<!\[_*`]| {2,}\n|$)/ | ||
text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/ | ||
}; | ||
inline._linkInside = /(?:\[[^\]]*\]|[^\]]|\](?=[^\[]*\]))*/; | ||
inline._linkHref = /\s*<?([^\s]*?)>?(?:\s+['"]([^\0]*?)['"])?\s*/; | ||
inline._linkHref = /\s*<?([^\s]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/; | ||
@@ -348,4 +339,4 @@ inline.link = replace(inline.link) | ||
inline.pedantic = { | ||
strong: /^__(?=\S)([^\0]*?\S)__(?!_)|^\*\*(?=\S)([^\0]*?\S)\*\*(?!\*)/, | ||
em: /^_(?=\S)([^\0]*?\S)_(?!_)|^\*(?=\S)([^\0]*?\S)\*(?!\*)/ | ||
strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, | ||
em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ | ||
}; | ||
@@ -355,3 +346,3 @@ | ||
url: /^(https?:\/\/[^\s]+[^.,:;"')\]\s])/, | ||
text: /^[^\0]+?(?=[\\<!\[_*`]|https?:\/\/| {2,}\n|$)/ | ||
text: /^[\s\S]+?(?=[\\<!\[_*`]|https?:\/\/| {2,}\n|$)/ | ||
}; | ||
@@ -622,5 +613,2 @@ | ||
case 'html': { | ||
if (options.sanitize) { | ||
return inline.lexer(token.text); | ||
} | ||
return !token.pre && !options.pedantic | ||
@@ -703,3 +691,3 @@ ? inline.lexer(token.text) | ||
+ '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' | ||
+ '|span|br|wbr|ins|del|img)\\b)\\w+'; | ||
+ '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b'; | ||
@@ -714,3 +702,5 @@ return tag; | ||
if (!name) return new RegExp(regex, opt); | ||
regex = regex.replace(name, val.source || val); | ||
val = val.source || val; | ||
val = val.replace(/(^|[^\[])\^/g, '$1'); | ||
regex = regex.replace(name, val); | ||
return self; | ||
@@ -717,0 +707,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"author": "Christopher Jeffrey", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"main": "./lib/marked.js", | ||
@@ -15,3 +15,4 @@ "bin": "./bin/marked", | ||
"keywords": [ "markdown", "markup", "html" ], | ||
"tags": [ "markdown", "markup", "html" ] | ||
"tags": [ "markdown", "markup", "html" ], | ||
"scripts": { "test": "node test", "bench": "node test --bench" } | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24268
668