Socket
Socket
Sign inDemoInstall

marked

Package Overview
Dependencies
Maintainers
1
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marked - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

13

lib/marked.js

@@ -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, '&amp;')
.replace(!dbl
? /&(?!#?\w+;)/g
: /&/g, '&amp;')
.replace(/</g, '&lt;')

@@ -518,0 +523,0 @@ .replace(/>/g, '&gt;')

@@ -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 &gt; 5.')
.replace('AT&amp;T is another', 'AT&amp;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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc