b0VIM 8.1 ,(] # cy MacBook-Pro-10.localdomain ~cy/projects/ones/marked/lib/index.js utf-8 3210 #"! U tp # ~ ! ad Q # m M % ! y x K ' & b 8 7 Y 5 ^ ] > E ? y x K J t s g = ) e [ Z I H : a X W ' Y 1 % ~ T F E & try { } return; } })(tokens[i]); }); --pending || done(); token.escaped = true; token.text = code; } return --pending || done(); if (code == null || code === token.text) { if (err) return done(err); return highlight(token.text, token.lang, function(err, code) { } return --pending || done(); if (token.type !== 'code') { (function(token) { for (; i < tokens.length; i++) { if (!pending) return done(); delete options.highlight; } return done(); if (!highlight || highlight.length < 3) { }; callback(null, out); callback(err) : return err ? options.highlight = highlight; } err = e; } catch (e) { out = Parser.parse(tokens, options); try { var out; } return callback(err); options.highlight = highlight; if (err) { const done = function(err) { pending = tokens.length; } return callback(e); } catch (e) { tokens = Lexer.lex(src, options); try { i = 0; pending, tokens, var highlight = options.highlight, } opt = null; callback = opt; if (!callback) { if (callback || typeof opt === 'function') { const options = merge(this.options, opt) this.initGrammars() } Object.prototype.toString.call(src) + ', string expected'); throw new Error('marked(): input parameter is of type ' + if (typeof src !== 'string') { } throw new Error('marked(): input parameter is undefined or null'); if (typeof src === 'undefined' || src === null) { // throw error in case of non string input marked(src, opt = {}, callback) { } this.setOptions({ grammars }) // set grammars in options const grammars = this.grammars.map(Grammar => new Grammar(this)) initGrammars() { } this.grammars = [...this.grammars, ...grammars] } throw new Error('Grammars parameter should be an array') if (!Array.isArray(grammars)) { registerCustomGrammar(grammars = []) { } return this.marked merge(this.options, opt); setOptions(opt) { } return this.defaults getDefaults() { } this.parse = this this.Slugger = Slugger this.inlineLexer = InlineLexer.output this.InlineLexer = InlineLexer this.lexer = Lexer.lex this.Lexer = Lexer this.TextRenderer = TextRenderer this.Renderer = Render this.initGrammars() // Init grammars this.grammars = defaultGrammars // Cache all markdown available grammars merge(this.options, options) this.options = this.defaults // Actual options this.defaults = getDefaultOptions(Renderer) // Default options. // // TODO: 重新在 Marked 初始化时,载入 options, 而不是在 marked 调用的时候。 constructor(options = {}) { class Marked { import defaultGrammars from './grammars' import Slugger from './slugger' import InlineLexer from './inlineLexer' import TextRenderer from './renderText' import Renderer from './render' import Parser from './parser' import Lexer from './lexer' } from './utils' getDefaultOptions, escape, merge, import { */ * Lib entry /** ad 8 _ 5 o m c Z Y eexport deexport defexexport default marked consteexport default Marked } } } throw e; } ''; escape(e.message + '', true) + return '
An error occurred:
' + if ((opt || this.options).silent) { e.message += '\nPlease report this to https://github.com/markedjs/marked.'; } catch (e) { return Parser.parse(Lexer.lex(src, options), options); ad ~ l k T t p o ] D @ ? +
e
_
^
*
&
%
b 3 J
q
]
U
T
+
l k H 5 | i _ ^ 7 6 ! n m J I " c < j \ E = < . ( ' I try { } return; } })(tokens[i]); }); --pending || done(); token.escaped = true; token.text = code; } return --pending || done(); if (code == null || code === token.text) { if (err) return done(err); return highlight(token.text, token.lang, function(err, code) { } return --pending || done(); if (token.type !== 'code') { (function(token) { for (; i < tokens.length; i++) { if (!pending) return done(); delete options.highlight; } return done(); if (!highlight || highlight.length < 3) { }; callback(null, out); callback(err) : return err ? options.highlight = highlight; } err = e; } catch (e) { out = Parser.parse(tokens, options); try { var out; } return callback(err); options.highlight = highlight; if (err) { const done = function(err) { pending = tokens.length; } return callback(e); } catch (e) { tokens = Lexer.lex(src, options); try { i = 0; pending, tokens, var highlight = options.highlight, } opt = null; callback = opt; if (!callback) { if (callback || typeof opt === 'function') { const options = merge(this.options, opt) } Object.prototype.toString.call(src) + ', string expected'); throw new Error('marked(): input parameter is of type ' + if (typeof src !== 'string') { } throw new Error('marked(): input parameter is undefined or null'); if (typeof src === 'undefined' || src === null) { // throw error in case of non string input marked(src, opt = {}, callback) { } this.setOptions({ grammars }) // set grammars in options const grammars = this.grammars.map(Grammar => new Grammar(this)) initGrammars() { } this.grammars = [...this.grammars, ...grammars] } throw new Error('Grammars parameter should be an array') if (!Array.isArray(grammars)) { registerCustomGrammar(grammars = []) { } return this.marked merge(this.options, opt); setOptions(opt) { } return this.defaults getDefaults() { } this.parse = this this.Slugger = Slugger this.inlineLexer = (src, links) => InlineLexer.output(src, links, this.options) this.InlineLexer = InlineLexer this.lexer = src => Lexer.lex(src, this.options) this.Lexer = Lexer this.TextRenderer = TextRenderer this.Renderer = Renderer this.parser = Parser.parse this.Parser = Parser // Expose internals