* Block Lexer
*/
- function Lexer(options) {
+ var Lexer = function (options) {
this.tokens = [];
this.tokens.links = {};
this.options = options || marked.defaults;
* Inline Lexer & Compiler
*/
- function InlineLexer(links, options) {
+ var InlineLexer = function (links, options) {
this.options = options || marked.defaults;
this.links = links;
this.rules = inline.normal;
* Renderer
*/
- function Renderer(options) {
+ var Renderer = function (options) {
this.options = options || {};
}
* Parsing & Compiling
*/
- function Parser(options) {
+ var Parser = function (options) {
this.tokens = [];
this.token = null;
this.options = options || marked.defaults;
* Helpers
*/
- function escape(html, encode) {
+ var escape = function (html, encode) {
return html
.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&')
.replace(/</g, '<')
.replace(/'/g, ''');
}
- function unescape(html) {
+ var unescape = function (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();
});
}
- function replace(regex, opt) {
+ var replace = function (regex, opt) {
regex = regex.source;
opt = opt || '';
return function self(name, val) {
};
}
- function noop() {}
+ var noop = function () {}
noop.exec = noop;
function merge(obj) {
* Marked
*/
- function marked(src, opt, callback) {
+ var marked = function (src, opt, callback) {
if (callback || typeof opt === 'function') {
if (!callback) {
callback = opt;