Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(575)

Unified Diff: polymer_0.5.4/bower_components/marked/lib/marked.js

Issue 895523005: Added Polymer 0.5.4 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « polymer_0.5.4/bower_components/marked/index.js ('k') | polymer_0.5.4/bower_components/marked/man/marked.1 » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: polymer_0.5.4/bower_components/marked/lib/marked.js
diff --git a/polymer_0.5.0/bower_components/marked/lib/marked.js b/polymer_0.5.4/bower_components/marked/lib/marked.js
similarity index 98%
copy from polymer_0.5.0/bower_components/marked/lib/marked.js
copy to polymer_0.5.4/bower_components/marked/lib/marked.js
index e2f08c9983891d47354d0572f34e132ef44f4a25..0b7180ff6283fe25999c14d0491c8e517ad4ce43 100644
--- a/polymer_0.5.0/bower_components/marked/lib/marked.js
+++ b/polymer_0.5.4/bower_components/marked/lib/marked.js
@@ -20,7 +20,7 @@ var block = {
lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
- html: /^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,
+ html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
table: noop,
paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
@@ -868,7 +868,7 @@ Renderer.prototype.link = function(href, title, text) {
} catch (e) {
return '';
}
- if (prot.indexOf('javascript:') === 0) {
+ if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) {
return '';
}
}
@@ -1154,8 +1154,13 @@ function marked(src, opt, callback) {
pending = tokens.length;
- var done = function() {
- var out, err;
+ var done = function(err) {
+ if (err) {
+ opt.highlight = highlight;
+ return callback(err);
+ }
+
+ var out;
try {
out = Parser.parse(tokens, opt);
@@ -1184,6 +1189,7 @@ function marked(src, opt, callback) {
return --pending || done();
}
return highlight(token.text, token.lang, function(err, code) {
+ if (err) return done(err);
if (code == null || code === token.text) {
return --pending || done();
}
@@ -1253,7 +1259,7 @@ marked.inlineLexer = InlineLexer.output;
marked.parse = marked;
-if (typeof exports === 'object') {
+if (typeof module !== 'undefined' && typeof exports === 'object') {
module.exports = marked;
} else if (typeof define === 'function' && define.amd) {
define(function() { return marked; });
« no previous file with comments | « polymer_0.5.4/bower_components/marked/index.js ('k') | polymer_0.5.4/bower_components/marked/man/marked.1 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698