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.2.4 to 0.2.5

62

lib/marked.js

@@ -16,7 +16,7 @@ /**

fences: noop,
hr: /^( *[\-*_]){3,} *(?:\n+|$)/,
hr: /^( *[-*_]){3,} *(?:\n+|$)/,
heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
lheading: /^([^\n]+)\n *(=|-){3,} *\n*/,
blockquote: /^( *>[^\n]+(\n[^\n]+)*\n*)+/,
list: /^( *)([*+-]|\d+\.) [^\0]+?(?:\n{2,}(?! )(?!\1bullet)\n*|\s*$)/,
list: /^( *)(bull) [^\0]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,

@@ -28,4 +28,11 @@ def: /^ *\[([^\]]+)\]: *([^\s]+)(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,

block.bullet = /(?:[*+-]|\d+\.)/;
block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;
block.item = replace(block.item, 'gm')
(/bull/g, block.bullet)
();
block.list = replace(block.list)
('bullet', /(?:[*+-](?!(?: *[-*]){2,})|\d+\.)/)
(/bull/g, block.bullet)
('hr', /\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)
();

@@ -198,5 +205,3 @@

// Get each top-level item.
cap = cap[0].match(
/^( *)([*+-]|\d+\.) [^\n]*(?:\n(?!\1(?:[*+-]|\d+\.) )[^\n]*)*/gm
);
cap = cap[0].match(block.item);

@@ -480,3 +485,3 @@ next = false;

var outputLink = function(cap, link) {
function outputLink(cap, link) {
if (cap[0][0] !== '!') {

@@ -507,3 +512,3 @@ return '<a href="'

}
};
}

@@ -517,7 +522,7 @@ /**

var next = function() {
function next() {
return token = tokens.pop();
};
}
var tok = function() {
function tok() {
switch (token.type) {

@@ -547,5 +552,7 @@ case 'space': {

}
if (!token.escaped) {
token.text = escape(token.text, true);
}
return '<pre><code'

@@ -631,5 +638,5 @@ + (token.lang

}
};
}
var parseText = function() {
function parseText() {
var body = token.text

@@ -644,5 +651,5 @@ , top;

return inline.lexer(body);
};
}
var parse = function(src) {
function parse(src) {
tokens = src.reverse();

@@ -659,3 +666,3 @@

return out;
};
}

@@ -666,3 +673,3 @@ /**

var escape = function(html, encode) {
function escape(html, encode) {
return html

@@ -674,5 +681,5 @@ .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')

.replace(/'/g, '&#39;');
};
}
var mangle = function(text) {
function mangle(text) {
var out = ''

@@ -692,3 +699,3 @@ , l = text.length

return out;
};
}

@@ -704,6 +711,7 @@ function tag() {

function replace(regex) {
function replace(regex, opt) {
regex = regex.source;
opt = opt || '';
return function self(name, val) {
if (!name) return new RegExp(regex);
if (!name) return new RegExp(regex, opt);
regex = regex.replace(name, val.source || val);

@@ -721,6 +729,6 @@ return self;

var marked = function(src, opt) {
function marked(src, opt) {
setOptions(opt);
return parse(block.lexer(src));
};
}

@@ -734,3 +742,3 @@ /**

var setOptions = function(opt) {
function setOptions(opt) {
if (!opt) opt = defaults;

@@ -759,3 +767,3 @@ if (options === opt) return;

}
};
}

@@ -769,3 +777,3 @@ marked.options =

marked.options({
marked.setOptions({
gfm: true,

@@ -772,0 +780,0 @@ pedantic: false,

@@ -5,3 +5,3 @@ {

"author": "Christopher Jeffrey",
"version": "0.2.4",
"version": "0.2.5",
"main": "./lib/marked.js",

@@ -8,0 +8,0 @@ "bin": "./bin/marked",

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