* Block Lexer
*/
- var Lexer = function (options) {
+ function Lexer(options) {
this.tokens = [];
this.tokens.links = {};
this.options = options || marked.defaults;
* Inline Lexer & Compiler
*/
- var InlineLexer = function (links, options) {
+ function InlineLexer(links, options) {
this.options = options || marked.defaults;
this.links = links;
this.rules = inline.normal;
* Renderer
*/
- var Renderer = function (options) {
+ function Renderer(options) {
this.options = options || {};
}
* Parsing & Compiling
*/
- var Parser = function (options) {
+ function Parser(options) {
this.tokens = [];
this.token = null;
this.options = options || marked.defaults;
* Helpers
*/
- var escape = function (html, encode) {
+ function escape(html, encode) {
return html
.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&')
.replace(/</g, '<')
.replace(/'/g, ''');
}
- var unescape = function (html) {
+ function unescape(html) {
// explicitly match decimal, hex, and named HTML entities
return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) {
n = n.toLowerCase();
});
}
- var replace = function (regex, opt) {
+ function replace(regex, opt) {
regex = regex.source;
opt = opt || '';
return function self(name, val) {
};
}
- var noop = function () {}
+ function noop() {}
noop.exec = noop;
function merge(obj) {
* Marked
*/
- var marked = function (src, opt, callback) {
+ function marked(src, opt, callback) {
if (callback || typeof opt === 'function') {
if (!callback) {
callback = opt;