Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
});
body = setLineSameWidth(body.trim());
var quote = "";
body.split('\n').forEach(line => {
if (line.trim() === "") {
quote += '\n';
return;
}
quote += ('> ' + line + '\n');
});
return '\n' + this.o.blockquote(indentify(quote)) + '\n\n';
});
};
TerminalRenderer.prototype.html = function(html) {
var out = "";
if (html instanceof Array) {
html.forEach(block => {
out += block;
});
} else {
out = html;
}
out = out.replace(/<[^>\)\(]+>/g,'');
return this.o.html(setLineSameWidth(out));
};
/**
* Read slide content.
var hasText = text && text !== href;
var out = '';
if (hasText) out += this.emoji(text) + ' (';
out += this.o.href(href);
if (hasText) out += ')';
return this.o.link(out);
};
TerminalRenderer.prototype.hr = function() {
return '\n\n' + '-'.repeat(this.o.width) + '\n';
};
TerminalRenderer.prototype.blockquote = function(quoteBlocks) {
return Promise.all(quoteBlocks).then(quotes => {
var body = "";
quotes.forEach(quote => {
body += quote;
});
body = setLineSameWidth(body.trim());
var quote = "";
body.split('\n').forEach(line => {
if (line.trim() === "") {
quote += '\n';
return;
}
quote += ('> ' + line + '\n');
});
return '\n' + this.o.blockquote(indentify(quote)) + '\n\n';
if (prot.indexOf('javascript:') === 0) {
return '';
}
}
var hasText = text && text !== href;
var out = '';
if (hasText) out += this.emoji(text) + ' (';
out += this.o.href(href);
if (hasText) out += ')';
return this.o.link(out);
};
TerminalRenderer.prototype.hr = function() {
return '\n\n' + '-'.repeat(this.o.width) + '\n';
};
TerminalRenderer.prototype.blockquote = function(quoteBlocks) {
return Promise.all(quoteBlocks).then(quotes => {
var body = "";
quotes.forEach(quote => {
body += quote;
});
body = setLineSameWidth(body.trim());
var quote = "";
body.split('\n').forEach(line => {
if (line.trim() === "") {
quote += '\n';
return;
if (Object.prototype.hasOwnProperty.call(target, key)) {
obj[key] = target[key];
}
}
}
return obj;
}
TerminalRenderer.prototype.code = function(code, lang, escaped) {
code = setLineSameWidth(code);
return '\n' + indentify(highlight(code, lang, this.o, this.highlightOptions)) + '\n';
};
TerminalRenderer.prototype.list = function(body, ordered) {
body = setLineSameWidth(body);
body = indentLines(this.o.listitem(body));
body = body + '\n';
if (!ordered) return body;
return changeToOrdered(body);
};
TerminalRenderer.prototype.image = function(href, title, text) {
return new Promise((resolve, reject) => {
imageToAscii(href,
{ size: { height: "60%" }
}, (err, converted) => {
if (err) reject(err);
else resolve(converted + "\n");
});
});
return changeToOrdered(body);
};
TerminalRenderer.prototype.image = function(href, title, text) {
return new Promise((resolve, reject) => {
imageToAscii(href,
{ size: { height: "60%" }
}, (err, converted) => {
if (err) reject(err);
else resolve(converted + "\n");
});
});
};
TerminalRenderer.prototype.heading = function(text, level, raw) {
text = this.transform(text.join(''));
var prefix = this.o.showSectionPrefix ?
(new Array(level + 1)).join('#')+' ' : '';
text = prefix + text;
if (this.o.reflowText) {
text = reflowText(text, this.o.width, this.options.gfm);
}
if (level === 1) {
return this.o.firstHeading(text) + '\n';
}
return '\n' + this.o.heading(text) + '\n';
};
TerminalRenderer.prototype.paragraph = function(texts) {
return Promise.all(texts).then(data => {
TerminalRenderer.prototype.code = function(code, lang, escaped) {
code = setLineSameWidth(code);
return '\n' + indentify(highlight(code, lang, this.o, this.highlightOptions)) + '\n';
};
TerminalRenderer.prototype.list = function(body, ordered) {
body = setLineSameWidth(body);
body = indentLines(this.o.listitem(body));
body = body + '\n';
if (!ordered) return body;
return changeToOrdered(body);
};
TerminalRenderer.prototype.image = function(href, title, text) {
return new Promise((resolve, reject) => {
imageToAscii(href,
{ size: { height: "60%" }
}, (err, converted) => {
if (err) reject(err);
else resolve(converted + "\n");
});
});
};
TerminalRenderer.prototype.heading = function(text, level, raw) {
text = this.transform(text.join(''));
var prefix = this.o.showSectionPrefix ?
(new Array(level + 1)).join('#')+' ' : '';
TerminalRenderer.prototype.heading = function(text, level, raw) {
text = this.transform(text.join(''));
var prefix = this.o.showSectionPrefix ?
(new Array(level + 1)).join('#')+' ' : '';
text = prefix + text;
if (this.o.reflowText) {
text = reflowText(text, this.o.width, this.options.gfm);
}
if (level === 1) {
return this.o.firstHeading(text) + '\n';
}
return '\n' + this.o.heading(text) + '\n';
};
TerminalRenderer.prototype.paragraph = function(texts) {
return Promise.all(texts).then(data => {
var res = '';
data.forEach(i => {
res += i;
});
return '\n' + res + '\n';
});
};
TerminalRenderer.prototype.link = function(href, title, text) {
text = text.join('');
var prot = "";
if (this.options.sanitize) {
try {
prot = decodeURIComponent(unescape(href))
.replace(/[^\w:]/g, '')
return this.o.firstHeading(text) + '\n';
}
return '\n' + this.o.heading(text) + '\n';
};
TerminalRenderer.prototype.paragraph = function(texts) {
return Promise.all(texts).then(data => {
var res = '';
data.forEach(i => {
res += i;
});
return '\n' + res + '\n';
});
};
TerminalRenderer.prototype.link = function(href, title, text) {
text = text.join('');
var prot = "";
if (this.options.sanitize) {
try {
prot = decodeURIComponent(unescape(href))
.replace(/[^\w:]/g, '')
.toLowerCase();
} catch (e) {
return '';
}
if (prot.indexOf('javascript:') === 0) {
return '';
}
}
var hasText = text && text !== href;
, key;
for (; i < arguments.length; i++) {
target = arguments[i];
for (key in target) {
if (Object.prototype.hasOwnProperty.call(target, key)) {
obj[key] = target[key];
}
}
}
return obj;
}
TerminalRenderer.prototype.code = function(code, lang, escaped) {
code = setLineSameWidth(code);
return '\n' + indentify(highlight(code, lang, this.o, this.highlightOptions)) + '\n';
};
TerminalRenderer.prototype.list = function(body, ordered) {
body = setLineSameWidth(body);
body = indentLines(this.o.listitem(body));
body = body + '\n';
if (!ordered) return body;
return changeToOrdered(body);
};
TerminalRenderer.prototype.image = function(href, title, text) {
return new Promise((resolve, reject) => {
imageToAscii(href,
{ size: { height: "60%" }