Comparing version 0.1.3 to 0.1.4
@@ -335,3 +335,3 @@ /** | ||
out += '<code>' | ||
+ escape(cap[2] || cap[1]) | ||
+ escape(cap[2] || cap[1], true) | ||
+ '</code>'; | ||
@@ -416,4 +416,7 @@ continue; | ||
case 'code': { | ||
if (token.text[token.text.length-1] === '\n') { | ||
token.text = token.text.slice(0, -1); | ||
} | ||
return '<pre><code>' | ||
+ escape(token.text) | ||
+ escape(token.text, true) | ||
+ '</code></pre>'; | ||
@@ -513,5 +516,7 @@ } | ||
var escape = function(html) { | ||
var escape = function(html, dbl) { | ||
return html | ||
.replace(/&/g, '&') | ||
.replace(!dbl | ||
? /&(?!#?\w+;)/g | ||
: /&/g, '&') | ||
.replace(/</g, '<') | ||
@@ -518,0 +523,0 @@ .replace(/>/g, '>') |
@@ -5,3 +5,3 @@ { | ||
"author": "Christopher Jeffrey", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"main": "./lib/marked.js", | ||
@@ -8,0 +8,0 @@ "bin": { "marked": "./bin/marked" }, |
@@ -54,7 +54,3 @@ /** | ||
// markdown avoids double encoding half of the time | ||
// and does it the other half. this behavior will be | ||
// implemented eventually, but for now, this needs to | ||
// be changed, because i want to see if the other tests | ||
// included in this file pass. | ||
// markdown is weird with encoding | ||
(function() { | ||
@@ -64,3 +60,2 @@ var file = dir + '/amps_and_angles_encoding.html'; | ||
.replace('6 > 5.', '6 > 5.') | ||
.replace('AT&T is another', 'AT&amp;T is another'); | ||
@@ -78,3 +73,3 @@ fs.writeFileSync(file, html); | ||
// fix strange markup that isnt likely | ||
// fix strange markup that isnt likely | ||
// to exist in the reality | ||
@@ -92,13 +87,13 @@ (function _(ext) { | ||
// markdown parses backslashes in a very primitive | ||
// way because it's not a real parser. i cannot | ||
// way because it's not a real parser. i cannot | ||
// include this test, because marked parses backslashes | ||
// in a very different way. | ||
(function(ext) { | ||
fs.writeFileSync(dir + '/backslash_escapes.text', | ||
fs.writeFileSync(dir + '/backslash_escapes.text', | ||
'hello world \\[how](are you) today'); | ||
fs.writeFileSync(dir + '/backslash_escapes.html', | ||
fs.writeFileSync(dir + '/backslash_escapes.html', | ||
'<p>hello world [how](are you) today</p>'); | ||
})(); | ||
// can't do this for performance reasons | ||
// can't do this for performance reasons | ||
// right now | ||
@@ -105,0 +100,0 @@ (function _(name) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
216233