All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.23.23.a37bd6c43e2b13149f99.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
{"version":3,"sources":["webpack:///23.23.a37bd6c43e2b13149f99.js","webpack:///./src/components/source-tagging/ConfigurationBundlePreview.jsx","webpack:///./src/components/source-tagging/ConfigurationBundles.jsx","webpack:///./src/components/source-tagging/SourceType.jsx","webpack:///./src/pages/ContentPacksPage.jsx","webpack:///./~/markdown/lib/index.js","webpack:///./~/markdown/lib/markdown.js","webpack:///./~/util/~/inherits/inherits_browser.js","webpack:///./~/util/support/isBufferBrowser.js","webpack:///./~/util/util.js"],"names":["webpackJsonp","782","module","exports","__webpack_require__","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","_react","_react2","_reactBootstrap","_markdown","_UserNotification","_UserNotification2","_ActionsProvider","_ActionsProvider2","ConfigurationBundlesActions","getActions","ConfigurationBundlePreview","createClass","displayName","propTypes","sourceTypeId","PropTypes","string","sourceTypeDescription","onDelete","func","isRequired","_confirmDeletion","_this","this","window","confirm","props","then","success","error","_onApply","apply","render","preview","applyAction","deleteAction","createElement","Button","bsStyle","onClick","className","bsSize","markdownPreview","markdown","toHTML","style","marginBottom","dangerouslySetInnerHTML","__html","783","_reflux","_reflux2","_jquery","_jquery2","_StoreProvider","_StoreProvider2","_SourceType","_SourceType2","_ConfigurationBundlePreview","_ConfigurationBundlePreview2","_Spinner","_Spinner2","ConfigurationBundlesStore","getStore","ConfigurationBundles","mixins","connect","getInitialState","componentDidMount","list","_getCategoriesHtml","categories","map","state","configurationBundles","bundles","category","sort","idx","_getSourceTypeHtml","_this2","_getSortedBundles","bundlesJsx","bundle","key","id","name","description","onSelect","handleSourceTypeChange","Panel","header","eventKey","bundle1","bundle2","onSubmit","submitEvent","preventDefault","refs","uploadedFile","files","reader","FileReader","onload","evt","request","target","result","create","triggerPromise","readAsText","setState","_resetSelection","Row","Col","md","Accordion","encType","ref","type","784","React","SourceType","_onChange","event","onChange","849","_reactRouterBootstrap","_Routes","_Routes2","_PageHeader","_PageHeader2","_ConfigurationBundles","_ConfigurationBundles2","ContentPacksPage","title","href","LinkContainer","to","SYSTEM","CONTENTPACKS","EXPORT","1187","parse","1188","expose","mk_block_toSource","uneval","toString","trailing","lineNumber","mk_block_inspect","util","inspect","count_lines","str","n","i","indexOf","strong_em","tag","CloseTag","len","len_after","state_slot","other_slot","text","orig_match","shift","length","other","slice","unshift","res","processInline","substr","last","pop","consumed","concat","split_meta_hash","meta_string","meta","split","parts","in_quotes","letter","push","extract_attr","jsonml","isArray","undefined","escapeHTML","replace","render_tree","attributes","content","Array","tag_attrs","a","join","convert_tree_to_html","tree","references","options","preprocessTreeNode","attrs","level","code","splice","src","original","merge_text_nodes","Markdown","dialect","dialects","Gruber","Error","String","em_state","strong_state","debug_indent","source","toTree","input","toHTMLTree","renderJsonML","html","mk_block","block","trail","line","arguments","s","toSource","prototype","split_blocks","startLine","m","re","blocks","line_no","exec","lastIndex","processBlock","next","cbs","ord","__order__","__call__","call","debug","inline","custom_root","old_tree","b","args","print","console","log","loop_re_over_block","cb","valueOf","atxHeader","match","setextHeader","ret","block_search","substring","horizRule","lists","regex_for_depth","depth","RegExp","indent_re","any_list","expand_tab","add","li","loose","nl","add_to","what","is_str","get_contained_blocks","x","paragraphify","stack","last_li","sublist","bullet_list","is_list_re","make_list","indent","lines","li_accumulate","l","line_re","wanted_depth","Math","floor","found","contained","forEach","next_block","hr","blockquote","prev","abutting","processedBlock","attr","isEmpty","referenceDefn","toLowerCase","para","__oneElement__","patterns_or_re","previous_nodes","__patterns__","index","patterns","out","]","}","__escape__","\\","charAt","![","alt","[","link","orig","DialectHelpers","inline_until_char","children","url","open_parens","<","`","  \n","__","_","buildBlockOrder","d","buildInlinePatterns","fn","pattern","want","nodes","subclassDialect","Block","Inline","Maruku","processMetaHash","test","document_meta","pairs","p","block_meta","hash","node","definition_list","tight","terms","defns","table","_split_on_unescaped","ch","r","leading_pipe","no_leading_pipe","html_attrs","align","trim","row","html_row","matches","before","k","arr","thisp","hasOwnProperty","root","1276","ctor","superCtor","super_","constructor","enumerable","writable","configurable","TempCtor","1277","arg","copy","fill","readUInt8","1278","global","process","opts","ctx","seen","stylize","stylizeNoColor","colors","isBoolean","showHidden","_extend","isUndefined","customInspect","stylizeWithColor","formatValue","styleType","styles","arrayToHash","array","val","recurseTimes","isFunction","isString","primitive","formatPrimitive","keys","visibleKeys","getOwnPropertyNames","isError","formatError","isRegExp","isDate","Date","base","braces","toUTCString","output","formatArray","formatProperty","reduceToSingleString","simple","JSON","stringify","isNumber","isNull","desc","getOwnPropertyDescriptor","get","set","numLinesEst","reduce","cur","ar","isNullOrUndefined","isSymbol","isObject","objectToString","e","isPrimitive","o","pad","timestamp","time","getHours","getMinutes","getSeconds","getDate","months","getMonth","prop","formatRegExp","format","f","objects","Number","deprecate","msg","deprecated","warned","throwDeprecation","traceDeprecation","trace","noDeprecation","debugEnviron","debugs","debuglog","NODE_ENV","NODE_DEBUG","toUpperCase","pid","bold","italic","underline","inverse","white","grey","black","blue","cyan","green","magenta","red","yellow","special","number","boolean","null","date","regexp","isBuffer","inherits","origin"],"mappings":"AAAAA,cAAc,KAERC,IACA,SAASC,EAAQC,EAASC,GAE/B,YAsBA,SAASC,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,UAASF,GApBvFG,OAAOC,eAAeP,EAAS,cAC7BQ,UCRH,IAAAC,GAAAR,EAAA,GDaKS,EAAUR,EAAuBO,GCZtCE,EAAAV,EAAA,GACAW,EAAAX,EAAA,MAEAY,EAAAZ,EAAA,GDiBKa,EAAqBZ,EAAuBW,GCfjDE,EAAAd,EAAA,GDmBKe,EAAoBd,EAAuBa,GClB1CE,EAA8BD,aAAgBE,WAAW,wBAEzDC,EAA6BT,aAAMU,aAAYC,YAAA,6BACnDC,WACEC,aAAcb,aAAMc,UAAUC,OAC9BC,sBAAuBhB,aAAMc,UAAUC,OACvCE,SAAUjB,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AA,SACAC,UAAA,SACAxT,UAAA,OACAyT,OAAA,OACAxe,OAAA,QACAye,KAAA,UAEAC,OAAA,OAkRAngB,EAAAuM,UAKAvM,EAAA+Z,YAKA/Z,EAAAmc,SAKAnc,EAAA4c,oBAKA5c,EAAAkc,WAKAlc,EAAA6a,WAKA7a,EAAA6c,WAKA7c,EAAAka,cAKAla,EAAAqb,WAKArb,EAAA8c,WAKA9c,EAAAsb,SAMAtb,EAAAmb,UAKAnb,EAAA4a,aAUA5a,EAAAid,cAEAjd,EAAAogB,SAAAngB,EAAA,KAYA,IAAAyd,IAAA,sDACA,kBAaA1d,GAAA4Q,IAAA,WACAD,QAAAC,IAAA,UAAAwM,IAAApd,EAAA8d,OAAAtb,MAAAxC,EAAAiP,aAiBAjP,EAAAqgB,SAAApgB,EAAA,MAEAD,EAAAia,QAAA,SAAAqG,EAAAxO,GAEA,IAAAA,IAAAgL,EAAAhL,GAAA,MAAAwO,EAIA,KAFA,GAAAtF,GAAA1a,OAAA0a,KAAAlJ,GACAxH,EAAA0Q,EAAA9P,OACAZ,KACAgW,EAAAtF,EAAA1Q,IAAAwH,EAAAkJ,EAAA1Q,GAEA,OAAAgW,MTyqE8BnQ,KAAKnQ,EAAU,WAAa,MAAOgC,SAAY/B,EAAoB","file":"23.23.a37bd6c43e2b13149f99.js","sourcesContent":["webpackJsonp([23],{\n\n/***/ 782:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\t\n\tvar _react = __webpack_require__(1);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactBootstrap = __webpack_require__(2);\n\t\n\tvar _markdown = __webpack_require__(1187);\n\t\n\tvar _UserNotification = __webpack_require__(8);\n\t\n\tvar _UserNotification2 = _interopRequireDefault(_UserNotification);\n\t\n\tvar _ActionsProvider = __webpack_require__(6);\n\t\n\tvar _ActionsProvider2 = _interopRequireDefault(_ActionsProvider);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar ConfigurationBundlesActions = _ActionsProvider2.default.getActions('ConfigurationBundles');\n\t\n\tvar ConfigurationBundlePreview = _react2.default.createClass({\n\t  displayName: 'ConfigurationBundlePreview',\n\t\n\t  propTypes: {\n\t    sourceTypeId: _react2.default.PropTypes.string,\n\t    sourceTypeDescription: _react2.default.PropTypes.string,\n\t    onDelete: _react2.default.PropTypes.func.isRequired\n\t  },\n\t\n\t  _confirmDeletion: function _confirmDeletion() {\n\t    var _this = this;\n\t\n\t    if (window.confirm('You are about to delete this content pack, are you sure?')) {\n\t      ConfigurationBundlesActions.delete(this.props.sourceTypeId).then(function () {\n\t        _UserNotification2.default.success('Bundle deleted successfully.', 'Success');\n\t        _this.props.onDelete();\n\t      }, function () {\n\t        _UserNotification2.default.error('Deleting bundle failed, please check your logs for more information.', 'Error');\n\t      });\n\t    }\n\t  },\n\t  _onApply: function _onApply() {\n\t    ConfigurationBundlesActions.apply(this.props.sourceTypeId).then(function () {\n\t      _UserNotification2.default.success('Bundle applied successfully.', 'Success');\n\t    }, function () {\n\t      _UserNotification2.default.error('Applying bundle failed, please check your logs for more information.', 'Error');\n\t    });\n\t  },\n\t  render: function render() {\n\t    var preview = 'Select a content pack from the list to see its preview.';\n\t    var applyAction = '';\n\t    var deleteAction = '';\n\t\n\t    if (this.props.sourceTypeDescription) {\n\t      preview = this.props.sourceTypeDescription;\n\t      applyAction = _react2.default.createElement(\n\t        _reactBootstrap.Button,\n\t        { bsStyle: 'success', onClick: this._onApply },\n\t        'Apply content'\n\t      );\n\t      deleteAction = _react2.default.createElement(\n\t        _reactBootstrap.Button,\n\t        { className: 'pull-right', bsStyle: 'warning', bsSize: 'xsmall', onClick: this._confirmDeletion },\n\t        'Remove pack'\n\t      );\n\t    }\n\t\n\t    var markdownPreview = _markdown.markdown.toHTML(preview);\n\t\n\t    return _react2.default.createElement(\n\t      'div',\n\t      { className: 'bundle-preview' },\n\t      _react2.default.createElement(\n\t        'div',\n\t        { style: { marginBottom: 5 } },\n\t        deleteAction,\n\t        _react2.default.createElement(\n\t          'h2',\n\t          null,\n\t          'Content pack description:'\n\t        )\n\t      ),\n\t      _react2.default.createElement('div', { dangerouslySetInnerHTML: { __html: markdownPreview } }),\n\t      _react2.default.createElement(\n\t        'div',\n\t        { className: 'preview-actions' },\n\t        applyAction\n\t      )\n\t    );\n\t  }\n\t});\n\t\n\texports.default = ConfigurationBundlePreview;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 783:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\t\n\tvar _react = __webpack_require__(1);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reflux = __webpack_require__(4);\n\t\n\tvar _reflux2 = _interopRequireDefault(_reflux);\n\t\n\tvar _reactBootstrap = __webpack_require__(2);\n\t\n\tvar _jquery = __webpack_require__(13);\n\t\n\tvar _jquery2 = _interopRequireDefault(_jquery);\n\t\n\tvar _UserNotification = __webpack_require__(8);\n\t\n\tvar _UserNotification2 = _interopRequireDefault(_UserNotification);\n\t\n\tvar _ActionsProvider = __webpack_require__(6);\n\t\n\tvar _ActionsProvider2 = _interopRequireDefault(_ActionsProvider);\n\t\n\tvar _StoreProvider = __webpack_require__(3);\n\t\n\tvar _StoreProvider2 = _interopRequireDefault(_StoreProvider);\n\t\n\tvar _SourceType = __webpack_require__(784);\n\t\n\tvar _SourceType2 = _interopRequireDefault(_SourceType);\n\t\n\tvar _ConfigurationBundlePreview = __webpack_require__(782);\n\t\n\tvar _ConfigurationBundlePreview2 = _interopRequireDefault(_ConfigurationBundlePreview);\n\t\n\tvar _Spinner = __webpack_require__(28);\n\t\n\tvar _Spinner2 = _interopRequireDefault(_Spinner);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar ConfigurationBundlesActions = _ActionsProvider2.default.getActions('ConfigurationBundles');\n\t\n\tvar ConfigurationBundlesStore = _StoreProvider2.default.getStore('ConfigurationBundles');\n\t\n\tvar ConfigurationBundles = _react2.default.createClass({\n\t  displayName: 'ConfigurationBundles',\n\t\n\t  mixins: [_reflux2.default.connect(ConfigurationBundlesStore)],\n\t\n\t  getInitialState: function getInitialState() {\n\t    return {\n\t      sourceTypeId: '',\n\t      sourceTypeDescription: ''\n\t    };\n\t  },\n\t  componentDidMount: function componentDidMount() {\n\t    ConfigurationBundlesActions.list();\n\t  },\n\t  _getCategoriesHtml: function _getCategoriesHtml() {\n\t    var _this = this;\n\t\n\t    var categories = _jquery2.default.map(this.state.configurationBundles, function (bundles, category) {\n\t      return category;\n\t    });\n\t    categories.sort();\n\t    return categories.map(function (category, idx) {\n\t      return _this._getSourceTypeHtml(category, idx);\n\t    }, this);\n\t  },\n\t  _getSourceTypeHtml: function _getSourceTypeHtml(category, idx) {\n\t    var _this2 = this;\n\t\n\t    var bundles = this._getSortedBundles(category);\n\t    var bundlesJsx = bundles.map(function (bundle) {\n\t      return _react2.default.createElement(\n\t        'li',\n\t        { key: bundle.id },\n\t        _react2.default.createElement(_SourceType2.default, { id: bundle.id,\n\t          name: bundle.name,\n\t          description: bundle.description,\n\t          onSelect: _this2.handleSourceTypeChange })\n\t      );\n\t    }, this);\n\t\n\t    return _react2.default.createElement(\n\t      _reactBootstrap.Panel,\n\t      { key: category, header: category, eventKey: category + '-' + idx },\n\t      _react2.default.createElement(\n\t        'ul',\n\t        null,\n\t        bundlesJsx\n\t      )\n\t    );\n\t  },\n\t  _getSortedBundles: function _getSortedBundles(category) {\n\t    var bundles = this.state.configurationBundles[category];\n\t    bundles.sort(function (bundle1, bundle2) {\n\t      if (bundle1.name > bundle2.name) {\n\t        return 1;\n\t      }\n\t      if (bundle1.name < bundle2.name) {\n\t        return -1;\n\t      }\n\t      return 0;\n\t    });\n\t    return bundles;\n\t  },\n\t  onSubmit: function onSubmit(submitEvent) {\n\t    submitEvent.preventDefault();\n\t    if (!this.refs.uploadedFile.files || !this.refs.uploadedFile.files[0]) {\n\t      return;\n\t    }\n\t\n\t    var reader = new FileReader();\n\t\n\t    reader.onload = function (evt) {\n\t      var request = evt.target.result;\n\t      ConfigurationBundlesActions.create.triggerPromise(request).then(function () {\n\t        _UserNotification2.default.success('Content pack imported successfully', 'Success!');\n\t        ConfigurationBundlesActions.list();\n\t      }, function () {\n\t        _UserNotification2.default.error('Error importing content pack, please ensure it is a valid JSON file. Check your ' + 'Graylog logs for more information.', 'Could not import content pack');\n\t      });\n\t    };\n\t\n\t    reader.readAsText(this.refs.uploadedFile.files[0]);\n\t  },\n\t  handleSourceTypeChange: function handleSourceTypeChange(sourceTypeId, sourceTypeDescription) {\n\t    this.setState({ sourceTypeId: sourceTypeId, sourceTypeDescription: sourceTypeDescription });\n\t  },\n\t  _resetSelection: function _resetSelection() {\n\t    this.setState(this.getInitialState());\n\t  },\n\t  render: function render() {\n\t    return _react2.default.createElement(\n\t      _reactBootstrap.Row,\n\t      { className: 'configuration-bundles' },\n\t      _react2.default.createElement(\n\t        _reactBootstrap.Col,\n\t        { md: 6 },\n\t        this.state.configurationBundles ? _react2.default.createElement(\n\t          _reactBootstrap.Accordion,\n\t          null,\n\t          this._getCategoriesHtml(),\n\t          _react2.default.createElement(\n\t            _reactBootstrap.Panel,\n\t            { header: 'Import content pack', eventKey: -1 },\n\t            _react2.default.createElement(\n\t              'form',\n\t              { onSubmit: this.onSubmit, className: 'upload', encType: 'multipart/form-data' },\n\t              _react2.default.createElement(\n\t                'span',\n\t                { className: 'help-block' },\n\t                'Remember to apply the content pack after uploading it, to make the changes effective.'\n\t              ),\n\t              _react2.default.createElement(\n\t                'div',\n\t                { className: 'form-group' },\n\t                _react2.default.createElement('input', { ref: 'uploadedFile', type: 'file', name: 'bundle' })\n\t              ),\n\t              _react2.default.createElement(\n\t                'button',\n\t                { type: 'submit', className: 'btn btn-success' },\n\t                'Upload'\n\t              )\n\t            )\n\t          )\n\t        ) : _react2.default.createElement(_Spinner2.default, null)\n\t      ),\n\t      _react2.default.createElement(\n\t        _reactBootstrap.Col,\n\t        { md: 6 },\n\t        _react2.default.createElement(_ConfigurationBundlePreview2.default, { sourceTypeId: this.state.sourceTypeId,\n\t          sourceTypeDescription: this.state.sourceTypeDescription,\n\t          onDelete: this._resetSelection })\n\t      )\n\t    );\n\t  }\n\t});\n\t\n\texports.default = ConfigurationBundles;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 784:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar React = __webpack_require__(1);\n\t\n\tvar SourceType = React.createClass({\n\t    displayName: 'SourceType',\n\t    _onChange: function _onChange(event) {\n\t        this.props.onSelect(event.target.id, event.target.value);\n\t    },\n\t    render: function render() {\n\t        return React.createElement(\n\t            'label',\n\t            { className: 'radio' },\n\t            React.createElement('input', { type: 'radio', name: 'sourceType', id: this.props.id, value: this.props.description, onChange: this._onChange }),\n\t            this.props.name\n\t        );\n\t    }\n\t});\n\t\n\tmodule.exports = SourceType;\n\n/***/ },\n\n/***/ 849:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t  value: true\n\t});\n\t\n\tvar _react = __webpack_require__(1);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactBootstrap = __webpack_require__(2);\n\t\n\tvar _reactRouterBootstrap = __webpack_require__(18);\n\t\n\tvar _Routes = __webpack_require__(11);\n\t\n\tvar _Routes2 = _interopRequireDefault(_Routes);\n\t\n\tvar _PageHeader = __webpack_require__(39);\n\t\n\tvar _PageHeader2 = _interopRequireDefault(_PageHeader);\n\t\n\tvar _ConfigurationBundles = __webpack_require__(783);\n\t\n\tvar _ConfigurationBundles2 = _interopRequireDefault(_ConfigurationBundles);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar ContentPacksPage = _react2.default.createClass({\n\t  displayName: 'ContentPacksPage',\n\t  render: function render() {\n\t\n\t    return _react2.default.createElement(\n\t      'span',\n\t      null,\n\t      _react2.default.createElement(\n\t        _PageHeader2.default,\n\t        { title: 'Content packs' },\n\t        _react2.default.createElement(\n\t          'span',\n\t          null,\n\t          'Content packs accelerate the set up process for a specific data source. A content pack can include inputs/extractors, streams, and dashboards.'\n\t        ),\n\t        _react2.default.createElement(\n\t          'span',\n\t          null,\n\t          'Find more content packs in ',\n\t          ' ',\n\t          _react2.default.createElement(\n\t            'a',\n\t            { href: 'https://marketplace.graylog.org/', target: '_blank' },\n\t            'the Graylog Marketplace'\n\t          ),\n\t          '.'\n\t        ),\n\t        _react2.default.createElement(\n\t          _reactRouterBootstrap.LinkContainer,\n\t          { to: _Routes2.default.SYSTEM.CONTENTPACKS.EXPORT },\n\t          _react2.default.createElement(\n\t            _reactBootstrap.Button,\n\t            { bsStyle: 'success', bsSize: 'large' },\n\t            'Create a content pack'\n\t          )\n\t        )\n\t      ),\n\t      _react2.default.createElement(\n\t        _reactBootstrap.Row,\n\t        { className: 'content' },\n\t        _react2.default.createElement(\n\t          _reactBootstrap.Col,\n\t          { md: 12 },\n\t          _react2.default.createElement(\n\t            'h2',\n\t            null,\n\t            'Select content packs'\n\t          ),\n\t          _react2.default.createElement(\n\t            'div',\n\t            { id: 'react-configuration-bundles' },\n\t            _react2.default.createElement(_ConfigurationBundles2.default, null)\n\t          )\n\t        )\n\t      )\n\t    );\n\t  }\n\t});\n\t\n\texports.default = ContentPacksPage;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 1187:\n/***/ function(module, exports, __webpack_require__) {\n\n\t// super simple module for the most common nodejs use case.\n\texports.markdown = __webpack_require__(1188);\n\texports.parse = exports.markdown.toHTML;\n\n\n/***/ },\n\n/***/ 1188:\n/***/ function(module, exports, __webpack_require__) {\n\n\t// Released under MIT license\n\t// Copyright (c) 2009-2010 Dominic Baggott\n\t// Copyright (c) 2009-2010 Ash Berlin\n\t// Copyright (c) 2011 Christoph Dorn  (http://www.christophdorn.com)\n\t\n\t/*jshint browser:true, devel:true */\n\t\n\t(function( expose ) {\n\t\n\t/**\n\t *  class Markdown\n\t *\n\t *  Markdown processing in Javascript done right. We have very particular views\n\t *  on what constitutes 'right' which include:\n\t *\n\t *  - produces well-formed HTML (this means that em and strong nesting is\n\t *    important)\n\t *\n\t *  - has an intermediate representation to allow processing of parsed data (We\n\t *    in fact have two, both as [JsonML]: a markdown tree and an HTML tree).\n\t *\n\t *  - is easily extensible to add new dialects without having to rewrite the\n\t *    entire parsing mechanics\n\t *\n\t *  - has a good test suite\n\t *\n\t *  This implementation fulfills all of these (except that the test suite could\n\t *  do with expanding to automatically run all the fixtures from other Markdown\n\t *  implementations.)\n\t *\n\t *  ##### Intermediate Representation\n\t *\n\t *  *TODO* Talk about this :) Its JsonML, but document the node names we use.\n\t *\n\t *  [JsonML]: http://jsonml.org/ \"JSON Markup Language\"\n\t **/\n\tvar Markdown = expose.Markdown = function(dialect) {\n\t  switch (typeof dialect) {\n\t    case \"undefined\":\n\t      this.dialect = Markdown.dialects.Gruber;\n\t      break;\n\t    case \"object\":\n\t      this.dialect = dialect;\n\t      break;\n\t    default:\n\t      if ( dialect in Markdown.dialects ) {\n\t        this.dialect = Markdown.dialects[dialect];\n\t      }\n\t      else {\n\t        throw new Error(\"Unknown Markdown dialect '\" + String(dialect) + \"'\");\n\t      }\n\t      break;\n\t  }\n\t  this.em_state = [];\n\t  this.strong_state = [];\n\t  this.debug_indent = \"\";\n\t};\n\t\n\t/**\n\t *  parse( markdown, [dialect] ) -> JsonML\n\t *  - markdown (String): markdown string to parse\n\t *  - dialect (String | Dialect): the dialect to use, defaults to gruber\n\t *\n\t *  Parse `markdown` and return a markdown document as a Markdown.JsonML tree.\n\t **/\n\texpose.parse = function( source, dialect ) {\n\t  // dialect will default if undefined\n\t  var md = new Markdown( dialect );\n\t  return md.toTree( source );\n\t};\n\t\n\t/**\n\t *  toHTML( markdown, [dialect]  ) -> String\n\t *  toHTML( md_tree ) -> String\n\t *  - markdown (String): markdown string to parse\n\t *  - md_tree (Markdown.JsonML): parsed markdown tree\n\t *\n\t *  Take markdown (either as a string or as a JsonML tree) and run it through\n\t *  [[toHTMLTree]] then turn it into a well-formated HTML fragment.\n\t **/\n\texpose.toHTML = function toHTML( source , dialect , options ) {\n\t  var input = expose.toHTMLTree( source , dialect , options );\n\t\n\t  return expose.renderJsonML( input );\n\t};\n\t\n\t/**\n\t *  toHTMLTree( markdown, [dialect] ) -> JsonML\n\t *  toHTMLTree( md_tree ) -> JsonML\n\t *  - markdown (String): markdown string to parse\n\t *  - dialect (String | Dialect): the dialect to use, defaults to gruber\n\t *  - md_tree (Markdown.JsonML): parsed markdown tree\n\t *\n\t *  Turn markdown into HTML, represented as a JsonML tree. If a string is given\n\t *  to this function, it is first parsed into a markdown tree by calling\n\t *  [[parse]].\n\t **/\n\texpose.toHTMLTree = function toHTMLTree( input, dialect , options ) {\n\t  // convert string input to an MD tree\n\t  if ( typeof input ===\"string\" ) input = this.parse( input, dialect );\n\t\n\t  // Now convert the MD tree to an HTML tree\n\t\n\t  // remove references from the tree\n\t  var attrs = extract_attr( input ),\n\t      refs = {};\n\t\n\t  if ( attrs && attrs.references ) {\n\t    refs = attrs.references;\n\t  }\n\t\n\t  var html = convert_tree_to_html( input, refs , options );\n\t  merge_text_nodes( html );\n\t  return html;\n\t};\n\t\n\t// For Spidermonkey based engines\n\tfunction mk_block_toSource() {\n\t  return \"Markdown.mk_block( \" +\n\t          uneval(this.toString()) +\n\t          \", \" +\n\t          uneval(this.trailing) +\n\t          \", \" +\n\t          uneval(this.lineNumber) +\n\t          \" )\";\n\t}\n\t\n\t// node\n\tfunction mk_block_inspect() {\n\t  var util = __webpack_require__(1278);\n\t  return \"Markdown.mk_block( \" +\n\t          util.inspect(this.toString()) +\n\t          \", \" +\n\t          util.inspect(this.trailing) +\n\t          \", \" +\n\t          util.inspect(this.lineNumber) +\n\t          \" )\";\n\t\n\t}\n\t\n\tvar mk_block = Markdown.mk_block = function(block, trail, line) {\n\t  // Be helpful for default case in tests.\n\t  if ( arguments.length == 1 ) trail = \"\\n\\n\";\n\t\n\t  var s = new String(block);\n\t  s.trailing = trail;\n\t  // To make it clear its not just a string\n\t  s.inspect = mk_block_inspect;\n\t  s.toSource = mk_block_toSource;\n\t\n\t  if ( line != undefined )\n\t    s.lineNumber = line;\n\t\n\t  return s;\n\t};\n\t\n\tfunction count_lines( str ) {\n\t  var n = 0, i = -1;\n\t  while ( ( i = str.indexOf(\"\\n\", i + 1) ) !== -1 ) n++;\n\t  return n;\n\t}\n\t\n\t// Internal - split source into rough blocks\n\tMarkdown.prototype.split_blocks = function splitBlocks( input, startLine ) {\n\t  input = input.replace(/(\\r\\n|\\n|\\r)/g, \"\\n\");\n\t  // [\\s\\S] matches _anything_ (newline or space)\n\t  // [^] is equivalent but doesn't work in IEs.\n\t  var re = /([\\s\\S]+?)($|\\n#|\\n(?:\\s*\\n|$)+)/g,\n\t      blocks = [],\n\t      m;\n\t\n\t  var line_no = 1;\n\t\n\t  if ( ( m = /^(\\s*\\n)/.exec(input) ) != null ) {\n\t    // skip (but count) leading blank lines\n\t    line_no += count_lines( m[0] );\n\t    re.lastIndex = m[0].length;\n\t  }\n\t\n\t  while ( ( m = re.exec(input) ) !== null ) {\n\t    if (m[2] == \"\\n#\") {\n\t      m[2] = \"\\n\";\n\t      re.lastIndex--;\n\t    }\n\t    blocks.push( mk_block( m[1], m[2], line_no ) );\n\t    line_no += count_lines( m[0] );\n\t  }\n\t\n\t  return blocks;\n\t};\n\t\n\t/**\n\t *  Markdown#processBlock( block, next ) -> undefined | [ JsonML, ... ]\n\t *  - block (String): the block to process\n\t *  - next (Array): the following blocks\n\t *\n\t * Process `block` and return an array of JsonML nodes representing `block`.\n\t *\n\t * It does this by asking each block level function in the dialect to process\n\t * the block until one can. Succesful handling is indicated by returning an\n\t * array (with zero or more JsonML nodes), failure by a false value.\n\t *\n\t * Blocks handlers are responsible for calling [[Markdown#processInline]]\n\t * themselves as appropriate.\n\t *\n\t * If the blocks were split incorrectly or adjacent blocks need collapsing you\n\t * can adjust `next` in place using shift/splice etc.\n\t *\n\t * If any of this default behaviour is not right for the dialect, you can\n\t * define a `__call__` method on the dialect that will get invoked to handle\n\t * the block processing.\n\t */\n\tMarkdown.prototype.processBlock = function processBlock( block, next ) {\n\t  var cbs = this.dialect.block,\n\t      ord = cbs.__order__;\n\t\n\t  if ( \"__call__\" in cbs ) {\n\t    return cbs.__call__.call(this, block, next);\n\t  }\n\t\n\t  for ( var i = 0; i < ord.length; i++ ) {\n\t    //D:this.debug( \"Testing\", ord[i] );\n\t    var res = cbs[ ord[i] ].call( this, block, next );\n\t    if ( res ) {\n\t      //D:this.debug(\"  matched\");\n\t      if ( !isArray(res) || ( res.length > 0 && !( isArray(res[0]) ) ) )\n\t        this.debug(ord[i], \"didn't return a proper array\");\n\t      //D:this.debug( \"\" );\n\t      return res;\n\t    }\n\t  }\n\t\n\t  // Uhoh! no match! Should we throw an error?\n\t  return [];\n\t};\n\t\n\tMarkdown.prototype.processInline = function processInline( block ) {\n\t  return this.dialect.inline.__call__.call( this, String( block ) );\n\t};\n\t\n\t/**\n\t *  Markdown#toTree( source ) -> JsonML\n\t *  - source (String): markdown source to parse\n\t *\n\t *  Parse `source` into a JsonML tree representing the markdown document.\n\t **/\n\t// custom_tree means set this.tree to `custom_tree` and restore old value on return\n\tMarkdown.prototype.toTree = function toTree( source, custom_root ) {\n\t  var blocks = source instanceof Array ? source : this.split_blocks( source );\n\t\n\t  // Make tree a member variable so its easier to mess with in extensions\n\t  var old_tree = this.tree;\n\t  try {\n\t    this.tree = custom_root || this.tree || [ \"markdown\" ];\n\t\n\t    blocks:\n\t    while ( blocks.length ) {\n\t      var b = this.processBlock( blocks.shift(), blocks );\n\t\n\t      // Reference blocks and the like won't return any content\n\t      if ( !b.length ) continue blocks;\n\t\n\t      this.tree.push.apply( this.tree, b );\n\t    }\n\t    return this.tree;\n\t  }\n\t  finally {\n\t    if ( custom_root ) {\n\t      this.tree = old_tree;\n\t    }\n\t  }\n\t};\n\t\n\t// Noop by default\n\tMarkdown.prototype.debug = function () {\n\t  var args = Array.prototype.slice.call( arguments);\n\t  args.unshift(this.debug_indent);\n\t  if ( typeof print !== \"undefined\" )\n\t      print.apply( print, args );\n\t  if ( typeof console !== \"undefined\" && typeof console.log !== \"undefined\" )\n\t      console.log.apply( null, args );\n\t}\n\t\n\tMarkdown.prototype.loop_re_over_block = function( re, block, cb ) {\n\t  // Dont use /g regexps with this\n\t  var m,\n\t      b = block.valueOf();\n\t\n\t  while ( b.length && (m = re.exec(b) ) != null ) {\n\t    b = b.substr( m[0].length );\n\t    cb.call(this, m);\n\t  }\n\t  return b;\n\t};\n\t\n\t/**\n\t * Markdown.dialects\n\t *\n\t * Namespace of built-in dialects.\n\t **/\n\tMarkdown.dialects = {};\n\t\n\t/**\n\t * Markdown.dialects.Gruber\n\t *\n\t * The default dialect that follows the rules set out by John Gruber's\n\t * markdown.pl as closely as possible. Well actually we follow the behaviour of\n\t * that script which in some places is not exactly what the syntax web page\n\t * says.\n\t **/\n\tMarkdown.dialects.Gruber = {\n\t  block: {\n\t    atxHeader: function atxHeader( block, next ) {\n\t      var m = block.match( /^(#{1,6})\\s*(.*?)\\s*#*\\s*(?:\\n|$)/ );\n\t\n\t      if ( !m ) return undefined;\n\t\n\t      var header = [ \"header\", { level: m[ 1 ].length } ];\n\t      Array.prototype.push.apply(header, this.processInline(m[ 2 ]));\n\t\n\t      if ( m[0].length < block.length )\n\t        next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) );\n\t\n\t      return [ header ];\n\t    },\n\t\n\t    setextHeader: function setextHeader( block, next ) {\n\t      var m = block.match( /^(.*)\\n([-=])\\2\\2+(?:\\n|$)/ );\n\t\n\t      if ( !m ) return undefined;\n\t\n\t      var level = ( m[ 2 ] === \"=\" ) ? 1 : 2;\n\t      var header = [ \"header\", { level : level }, m[ 1 ] ];\n\t\n\t      if ( m[0].length < block.length )\n\t        next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) );\n\t\n\t      return [ header ];\n\t    },\n\t\n\t    code: function code( block, next ) {\n\t      // |    Foo\n\t      // |bar\n\t      // should be a code block followed by a paragraph. Fun\n\t      //\n\t      // There might also be adjacent code block to merge.\n\t\n\t      var ret = [],\n\t          re = /^(?: {0,3}\\t| {4})(.*)\\n?/,\n\t          lines;\n\t\n\t      // 4 spaces + content\n\t      if ( !block.match( re ) ) return undefined;\n\t\n\t      block_search:\n\t      do {\n\t        // Now pull out the rest of the lines\n\t        var b = this.loop_re_over_block(\n\t                  re, block.valueOf(), function( m ) { ret.push( m[1] ); } );\n\t\n\t        if ( b.length ) {\n\t          // Case alluded to in first comment. push it back on as a new block\n\t          next.unshift( mk_block(b, block.trailing) );\n\t          break block_search;\n\t        }\n\t        else if ( next.length ) {\n\t          // Check the next block - it might be code too\n\t          if ( !next[0].match( re ) ) break block_search;\n\t\n\t          // Pull how how many blanks lines follow - minus two to account for .join\n\t          ret.push ( block.trailing.replace(/[^\\n]/g, \"\").substring(2) );\n\t\n\t          block = next.shift();\n\t        }\n\t        else {\n\t          break block_search;\n\t        }\n\t      } while ( true );\n\t\n\t      return [ [ \"code_block\", ret.join(\"\\n\") ] ];\n\t    },\n\t\n\t    horizRule: function horizRule( block, next ) {\n\t      // this needs to find any hr in the block to handle abutting blocks\n\t      var m = block.match( /^(?:([\\s\\S]*?)\\n)?[ \\t]*([-_*])(?:[ \\t]*\\2){2,}[ \\t]*(?:\\n([\\s\\S]*))?$/ );\n\t\n\t      if ( !m ) {\n\t        return undefined;\n\t      }\n\t\n\t      var jsonml = [ [ \"hr\" ] ];\n\t\n\t      // if there's a leading abutting block, process it\n\t      if ( m[ 1 ] ) {\n\t        jsonml.unshift.apply( jsonml, this.processBlock( m[ 1 ], [] ) );\n\t      }\n\t\n\t      // if there's a trailing abutting block, stick it into next\n\t      if ( m[ 3 ] ) {\n\t        next.unshift( mk_block( m[ 3 ] ) );\n\t      }\n\t\n\t      return jsonml;\n\t    },\n\t\n\t    // There are two types of lists. Tight and loose. Tight lists have no whitespace\n\t    // between the items (and result in text just in the 
  • ) and loose lists,\n\t // which have an empty line between list items, resulting in (one or more)\n\t // paragraphs inside the
  • .\n\t //\n\t // There are all sorts weird edge cases about the original markdown.pl's\n\t // handling of lists:\n\t //\n\t // * Nested lists are supposed to be indented by four chars per level. But\n\t // if they aren't, you can get a nested list by indenting by less than\n\t // four so long as the indent doesn't match an indent of an existing list\n\t // item in the 'nest stack'.\n\t //\n\t // * The type of the list (bullet or number) is controlled just by the\n\t // first item at the indent. Subsequent changes are ignored unless they\n\t // are for nested lists\n\t //\n\t lists: (function( ) {\n\t // Use a closure to hide a few variables.\n\t var any_list = \"[*+-]|\\\\d+\\\\.\",\n\t bullet_list = /[*+-]/,\n\t number_list = /\\d+\\./,\n\t // Capture leading indent as it matters for determining nested lists.\n\t is_list_re = new RegExp( \"^( {0,3})(\" + any_list + \")[ \\t]+\" ),\n\t indent_re = \"(?: {0,3}\\\\t| {4})\";\n\t\n\t // TODO: Cache this regexp for certain depths.\n\t // Create a regexp suitable for matching an li for a given stack depth\n\t function regex_for_depth( depth ) {\n\t\n\t return new RegExp(\n\t // m[1] = indent, m[2] = list_type\n\t \"(?:^(\" + indent_re + \"{0,\" + depth + \"} {0,3})(\" + any_list + \")\\\\s+)|\" +\n\t // m[3] = cont\n\t \"(^\" + indent_re + \"{0,\" + (depth-1) + \"}[ ]{0,4})\"\n\t );\n\t }\n\t function expand_tab( input ) {\n\t return input.replace( / {0,3}\\t/g, \" \" );\n\t }\n\t\n\t // Add inline content `inline` to `li`. inline comes from processInline\n\t // so is an array of content\n\t function add(li, loose, inline, nl) {\n\t if ( loose ) {\n\t li.push( [ \"para\" ].concat(inline) );\n\t return;\n\t }\n\t // Hmmm, should this be any block level element or just paras?\n\t var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] == \"para\"\n\t ? li[li.length -1]\n\t : li;\n\t\n\t // If there is already some content in this list, add the new line in\n\t if ( nl && li.length > 1 ) inline.unshift(nl);\n\t\n\t for ( var i = 0; i < inline.length; i++ ) {\n\t var what = inline[i],\n\t is_str = typeof what == \"string\";\n\t if ( is_str && add_to.length > 1 && typeof add_to[add_to.length-1] == \"string\" ) {\n\t add_to[ add_to.length-1 ] += what;\n\t }\n\t else {\n\t add_to.push( what );\n\t }\n\t }\n\t }\n\t\n\t // contained means have an indent greater than the current one. On\n\t // *every* line in the block\n\t function get_contained_blocks( depth, blocks ) {\n\t\n\t var re = new RegExp( \"^(\" + indent_re + \"{\" + depth + \"}.*?\\\\n?)*$\" ),\n\t replace = new RegExp(\"^\" + indent_re + \"{\" + depth + \"}\", \"gm\"),\n\t ret = [];\n\t\n\t while ( blocks.length > 0 ) {\n\t if ( re.exec( blocks[0] ) ) {\n\t var b = blocks.shift(),\n\t // Now remove that indent\n\t x = b.replace( replace, \"\");\n\t\n\t ret.push( mk_block( x, b.trailing, b.lineNumber ) );\n\t }\n\t else {\n\t break;\n\t }\n\t }\n\t return ret;\n\t }\n\t\n\t // passed to stack.forEach to turn list items up the stack into paras\n\t function paragraphify(s, i, stack) {\n\t var list = s.list;\n\t var last_li = list[list.length-1];\n\t\n\t if ( last_li[1] instanceof Array && last_li[1][0] == \"para\" ) {\n\t return;\n\t }\n\t if ( i + 1 == stack.length ) {\n\t // Last stack frame\n\t // Keep the same array, but replace the contents\n\t last_li.push( [\"para\"].concat( last_li.splice(1, last_li.length - 1) ) );\n\t }\n\t else {\n\t var sublist = last_li.pop();\n\t last_li.push( [\"para\"].concat( last_li.splice(1, last_li.length - 1) ), sublist );\n\t }\n\t }\n\t\n\t // The matcher function\n\t return function( block, next ) {\n\t var m = block.match( is_list_re );\n\t if ( !m ) return undefined;\n\t\n\t function make_list( m ) {\n\t var list = bullet_list.exec( m[2] )\n\t ? [\"bulletlist\"]\n\t : [\"numberlist\"];\n\t\n\t stack.push( { list: list, indent: m[1] } );\n\t return list;\n\t }\n\t\n\t\n\t var stack = [], // Stack of lists for nesting.\n\t list = make_list( m ),\n\t last_li,\n\t loose = false,\n\t ret = [ stack[0].list ],\n\t i;\n\t\n\t // Loop to search over block looking for inner block elements and loose lists\n\t loose_search:\n\t while ( true ) {\n\t // Split into lines preserving new lines at end of line\n\t var lines = block.split( /(?=\\n)/ );\n\t\n\t // We have to grab all lines for a li and call processInline on them\n\t // once as there are some inline things that can span lines.\n\t var li_accumulate = \"\";\n\t\n\t // Loop over the lines in this block looking for tight lists.\n\t tight_search:\n\t for ( var line_no = 0; line_no < lines.length; line_no++ ) {\n\t var nl = \"\",\n\t l = lines[line_no].replace(/^\\n/, function(n) { nl = n; return \"\"; });\n\t\n\t // TODO: really should cache this\n\t var line_re = regex_for_depth( stack.length );\n\t\n\t m = l.match( line_re );\n\t //print( \"line:\", uneval(l), \"\\nline match:\", uneval(m) );\n\t\n\t // We have a list item\n\t if ( m[1] !== undefined ) {\n\t // Process the previous list item, if any\n\t if ( li_accumulate.length ) {\n\t add( last_li, loose, this.processInline( li_accumulate ), nl );\n\t // Loose mode will have been dealt with. Reset it\n\t loose = false;\n\t li_accumulate = \"\";\n\t }\n\t\n\t m[1] = expand_tab( m[1] );\n\t var wanted_depth = Math.floor(m[1].length/4)+1;\n\t //print( \"want:\", wanted_depth, \"stack:\", stack.length);\n\t if ( wanted_depth > stack.length ) {\n\t // Deep enough for a nested list outright\n\t //print ( \"new nested list\" );\n\t list = make_list( m );\n\t last_li.push( list );\n\t last_li = list[1] = [ \"listitem\" ];\n\t }\n\t else {\n\t // We aren't deep enough to be strictly a new level. This is\n\t // where Md.pl goes nuts. If the indent matches a level in the\n\t // stack, put it there, else put it one deeper then the\n\t // wanted_depth deserves.\n\t var found = false;\n\t for ( i = 0; i < stack.length; i++ ) {\n\t if ( stack[ i ].indent != m[1] ) continue;\n\t list = stack[ i ].list;\n\t stack.splice( i+1, stack.length - (i+1) );\n\t found = true;\n\t break;\n\t }\n\t\n\t if (!found) {\n\t //print(\"not found. l:\", uneval(l));\n\t wanted_depth++;\n\t if ( wanted_depth <= stack.length ) {\n\t stack.splice(wanted_depth, stack.length - wanted_depth);\n\t //print(\"Desired depth now\", wanted_depth, \"stack:\", stack.length);\n\t list = stack[wanted_depth-1].list;\n\t //print(\"list:\", uneval(list) );\n\t }\n\t else {\n\t //print (\"made new stack for messy indent\");\n\t list = make_list(m);\n\t last_li.push(list);\n\t }\n\t }\n\t\n\t //print( uneval(list), \"last\", list === stack[stack.length-1].list );\n\t last_li = [ \"listitem\" ];\n\t list.push(last_li);\n\t } // end depth of shenegains\n\t nl = \"\";\n\t }\n\t\n\t // Add content\n\t if ( l.length > m[0].length ) {\n\t li_accumulate += nl + l.substr( m[0].length );\n\t }\n\t } // tight_search\n\t\n\t if ( li_accumulate.length ) {\n\t add( last_li, loose, this.processInline( li_accumulate ), nl );\n\t // Loose mode will have been dealt with. Reset it\n\t loose = false;\n\t li_accumulate = \"\";\n\t }\n\t\n\t // Look at the next block - we might have a loose list. Or an extra\n\t // paragraph for the current li\n\t var contained = get_contained_blocks( stack.length, next );\n\t\n\t // Deal with code blocks or properly nested lists\n\t if ( contained.length > 0 ) {\n\t // Make sure all listitems up the stack are paragraphs\n\t forEach( stack, paragraphify, this);\n\t\n\t last_li.push.apply( last_li, this.toTree( contained, [] ) );\n\t }\n\t\n\t var next_block = next[0] && next[0].valueOf() || \"\";\n\t\n\t if ( next_block.match(is_list_re) || next_block.match( /^ / ) ) {\n\t block = next.shift();\n\t\n\t // Check for an HR following a list: features/lists/hr_abutting\n\t var hr = this.dialect.block.horizRule( block, next );\n\t\n\t if ( hr ) {\n\t ret.push.apply(ret, hr);\n\t break;\n\t }\n\t\n\t // Make sure all listitems up the stack are paragraphs\n\t forEach( stack, paragraphify, this);\n\t\n\t loose = true;\n\t continue loose_search;\n\t }\n\t break;\n\t } // loose_search\n\t\n\t return ret;\n\t };\n\t })(),\n\t\n\t blockquote: function blockquote( block, next ) {\n\t if ( !block.match( /^>/m ) )\n\t return undefined;\n\t\n\t var jsonml = [];\n\t\n\t // separate out the leading abutting block, if any. I.e. in this case:\n\t //\n\t // a\n\t // > b\n\t //\n\t if ( block[ 0 ] != \">\" ) {\n\t var lines = block.split( /\\n/ ),\n\t prev = [],\n\t line_no = block.lineNumber;\n\t\n\t // keep shifting lines until you find a crotchet\n\t while ( lines.length && lines[ 0 ][ 0 ] != \">\" ) {\n\t prev.push( lines.shift() );\n\t line_no++;\n\t }\n\t\n\t var abutting = mk_block( prev.join( \"\\n\" ), \"\\n\", block.lineNumber );\n\t jsonml.push.apply( jsonml, this.processBlock( abutting, [] ) );\n\t // reassemble new block of just block quotes!\n\t block = mk_block( lines.join( \"\\n\" ), block.trailing, line_no );\n\t }\n\t\n\t\n\t // if the next block is also a blockquote merge it in\n\t while ( next.length && next[ 0 ][ 0 ] == \">\" ) {\n\t var b = next.shift();\n\t block = mk_block( block + block.trailing + b, b.trailing, block.lineNumber );\n\t }\n\t\n\t // Strip off the leading \"> \" and re-process as a block.\n\t var input = block.replace( /^> ?/gm, \"\" ),\n\t old_tree = this.tree,\n\t processedBlock = this.toTree( input, [ \"blockquote\" ] ),\n\t attr = extract_attr( processedBlock );\n\t\n\t // If any link references were found get rid of them\n\t if ( attr && attr.references ) {\n\t delete attr.references;\n\t // And then remove the attribute object if it's empty\n\t if ( isEmpty( attr ) ) {\n\t processedBlock.splice( 1, 1 );\n\t }\n\t }\n\t\n\t jsonml.push( processedBlock );\n\t return jsonml;\n\t },\n\t\n\t referenceDefn: function referenceDefn( block, next) {\n\t var re = /^\\s*\\[(.*?)\\]:\\s*(\\S+)(?:\\s+(?:(['\"])(.*?)\\3|\\((.*?)\\)))?\\n?/;\n\t // interesting matches are [ , ref_id, url, , title, title ]\n\t\n\t if ( !block.match(re) )\n\t return undefined;\n\t\n\t // make an attribute node if it doesn't exist\n\t if ( !extract_attr( this.tree ) ) {\n\t this.tree.splice( 1, 0, {} );\n\t }\n\t\n\t var attrs = extract_attr( this.tree );\n\t\n\t // make a references hash if it doesn't exist\n\t if ( attrs.references === undefined ) {\n\t attrs.references = {};\n\t }\n\t\n\t var b = this.loop_re_over_block(re, block, function( m ) {\n\t\n\t if ( m[2] && m[2][0] == \"<\" && m[2][m[2].length-1] == \">\" )\n\t m[2] = m[2].substring( 1, m[2].length - 1 );\n\t\n\t var ref = attrs.references[ m[1].toLowerCase() ] = {\n\t href: m[2]\n\t };\n\t\n\t if ( m[4] !== undefined )\n\t ref.title = m[4];\n\t else if ( m[5] !== undefined )\n\t ref.title = m[5];\n\t\n\t } );\n\t\n\t if ( b.length )\n\t next.unshift( mk_block( b, block.trailing ) );\n\t\n\t return [];\n\t },\n\t\n\t para: function para( block, next ) {\n\t // everything's a para!\n\t return [ [\"para\"].concat( this.processInline( block ) ) ];\n\t }\n\t }\n\t};\n\t\n\tMarkdown.dialects.Gruber.inline = {\n\t\n\t __oneElement__: function oneElement( text, patterns_or_re, previous_nodes ) {\n\t var m,\n\t res,\n\t lastIndex = 0;\n\t\n\t patterns_or_re = patterns_or_re || this.dialect.inline.__patterns__;\n\t var re = new RegExp( \"([\\\\s\\\\S]*?)(\" + (patterns_or_re.source || patterns_or_re) + \")\" );\n\t\n\t m = re.exec( text );\n\t if (!m) {\n\t // Just boring text\n\t return [ text.length, text ];\n\t }\n\t else if ( m[1] ) {\n\t // Some un-interesting text matched. Return that first\n\t return [ m[1].length, m[1] ];\n\t }\n\t\n\t var res;\n\t if ( m[2] in this.dialect.inline ) {\n\t res = this.dialect.inline[ m[2] ].call(\n\t this,\n\t text.substr( m.index ), m, previous_nodes || [] );\n\t }\n\t // Default for now to make dev easier. just slurp special and output it.\n\t res = res || [ m[2].length, m[2] ];\n\t return res;\n\t },\n\t\n\t __call__: function inline( text, patterns ) {\n\t\n\t var out = [],\n\t res;\n\t\n\t function add(x) {\n\t //D:self.debug(\" adding output\", uneval(x));\n\t if ( typeof x == \"string\" && typeof out[out.length-1] == \"string\" )\n\t out[ out.length-1 ] += x;\n\t else\n\t out.push(x);\n\t }\n\t\n\t while ( text.length > 0 ) {\n\t res = this.dialect.inline.__oneElement__.call(this, text, patterns, out );\n\t text = text.substr( res.shift() );\n\t forEach(res, add )\n\t }\n\t\n\t return out;\n\t },\n\t\n\t // These characters are intersting elsewhere, so have rules for them so that\n\t // chunks of plain text blocks don't include them\n\t \"]\": function () {},\n\t \"}\": function () {},\n\t\n\t __escape__ : /^\\\\[\\\\`\\*_{}\\[\\]()#\\+.!\\-]/,\n\t\n\t \"\\\\\": function escaped( text ) {\n\t // [ length of input processed, node/children to add... ]\n\t // Only esacape: \\ ` * _ { } [ ] ( ) # * + - . !\n\t if ( this.dialect.inline.__escape__.exec( text ) )\n\t return [ 2, text.charAt( 1 ) ];\n\t else\n\t // Not an esacpe\n\t return [ 1, \"\\\\\" ];\n\t },\n\t\n\t \"![\": function image( text ) {\n\t\n\t // Unlike images, alt text is plain text only. no other elements are\n\t // allowed in there\n\t\n\t // ![Alt text](/path/to/img.jpg \"Optional title\")\n\t // 1 2 3 4 <--- captures\n\t var m = text.match( /^!\\[(.*?)\\][ \\t]*\\([ \\t]*([^\")]*?)(?:[ \\t]+([\"'])(.*?)\\3)?[ \\t]*\\)/ );\n\t\n\t if ( m ) {\n\t if ( m[2] && m[2][0] == \"<\" && m[2][m[2].length-1] == \">\" )\n\t m[2] = m[2].substring( 1, m[2].length - 1 );\n\t\n\t m[2] = this.dialect.inline.__call__.call( this, m[2], /\\\\/ )[0];\n\t\n\t var attrs = { alt: m[1], href: m[2] || \"\" };\n\t if ( m[4] !== undefined)\n\t attrs.title = m[4];\n\t\n\t return [ m[0].length, [ \"img\", attrs ] ];\n\t }\n\t\n\t // ![Alt text][id]\n\t m = text.match( /^!\\[(.*?)\\][ \\t]*\\[(.*?)\\]/ );\n\t\n\t if ( m ) {\n\t // We can't check if the reference is known here as it likely wont be\n\t // found till after. Check it in md tree->hmtl tree conversion\n\t return [ m[0].length, [ \"img_ref\", { alt: m[1], ref: m[2].toLowerCase(), original: m[0] } ] ];\n\t }\n\t\n\t // Just consume the '!['\n\t return [ 2, \"![\" ];\n\t },\n\t\n\t \"[\": function link( text ) {\n\t\n\t var orig = String(text);\n\t // Inline content is possible inside `link text`\n\t var res = Markdown.DialectHelpers.inline_until_char.call( this, text.substr(1), \"]\" );\n\t\n\t // No closing ']' found. Just consume the [\n\t if ( !res ) return [ 1, \"[\" ];\n\t\n\t var consumed = 1 + res[ 0 ],\n\t children = res[ 1 ],\n\t link,\n\t attrs;\n\t\n\t // At this point the first [...] has been parsed. See what follows to find\n\t // out which kind of link we are (reference or direct url)\n\t text = text.substr( consumed );\n\t\n\t // [link text](/path/to/img.jpg \"Optional title\")\n\t // 1 2 3 <--- captures\n\t // This will capture up to the last paren in the block. We then pull\n\t // back based on if there a matching ones in the url\n\t // ([here](/url/(test))\n\t // The parens have to be balanced\n\t var m = text.match( /^\\s*\\([ \\t]*([^\"']*)(?:[ \\t]+([\"'])(.*?)\\2)?[ \\t]*\\)/ );\n\t if ( m ) {\n\t var url = m[1];\n\t consumed += m[0].length;\n\t\n\t if ( url && url[0] == \"<\" && url[url.length-1] == \">\" )\n\t url = url.substring( 1, url.length - 1 );\n\t\n\t // If there is a title we don't have to worry about parens in the url\n\t if ( !m[3] ) {\n\t var open_parens = 1; // One open that isn't in the capture\n\t for ( var len = 0; len < url.length; len++ ) {\n\t switch ( url[len] ) {\n\t case \"(\":\n\t open_parens++;\n\t break;\n\t case \")\":\n\t if ( --open_parens == 0) {\n\t consumed -= url.length - len;\n\t url = url.substring(0, len);\n\t }\n\t break;\n\t }\n\t }\n\t }\n\t\n\t // Process escapes only\n\t url = this.dialect.inline.__call__.call( this, url, /\\\\/ )[0];\n\t\n\t attrs = { href: url || \"\" };\n\t if ( m[3] !== undefined)\n\t attrs.title = m[3];\n\t\n\t link = [ \"link\", attrs ].concat( children );\n\t return [ consumed, link ];\n\t }\n\t\n\t // [Alt text][id]\n\t // [Alt text] [id]\n\t m = text.match( /^\\s*\\[(.*?)\\]/ );\n\t\n\t if ( m ) {\n\t\n\t consumed += m[ 0 ].length;\n\t\n\t // [links][] uses links as its reference\n\t attrs = { ref: ( m[ 1 ] || String(children) ).toLowerCase(), original: orig.substr( 0, consumed ) };\n\t\n\t link = [ \"link_ref\", attrs ].concat( children );\n\t\n\t // We can't check if the reference is known here as it likely wont be\n\t // found till after. Check it in md tree->hmtl tree conversion.\n\t // Store the original so that conversion can revert if the ref isn't found.\n\t return [ consumed, link ];\n\t }\n\t\n\t // [id]\n\t // Only if id is plain (no formatting.)\n\t if ( children.length == 1 && typeof children[0] == \"string\" ) {\n\t\n\t attrs = { ref: children[0].toLowerCase(), original: orig.substr( 0, consumed ) };\n\t link = [ \"link_ref\", attrs, children[0] ];\n\t return [ consumed, link ];\n\t }\n\t\n\t // Just consume the \"[\"\n\t return [ 1, \"[\" ];\n\t },\n\t\n\t\n\t \"<\": function autoLink( text ) {\n\t var m;\n\t\n\t if ( ( m = text.match( /^<(?:((https?|ftp|mailto):[^>]+)|(.*?@.*?\\.[a-zA-Z]+))>/ ) ) != null ) {\n\t if ( m[3] ) {\n\t return [ m[0].length, [ \"link\", { href: \"mailto:\" + m[3] }, m[3] ] ];\n\t\n\t }\n\t else if ( m[2] == \"mailto\" ) {\n\t return [ m[0].length, [ \"link\", { href: m[1] }, m[1].substr(\"mailto:\".length ) ] ];\n\t }\n\t else\n\t return [ m[0].length, [ \"link\", { href: m[1] }, m[1] ] ];\n\t }\n\t\n\t return [ 1, \"<\" ];\n\t },\n\t\n\t \"`\": function inlineCode( text ) {\n\t // Inline code block. as many backticks as you like to start it\n\t // Always skip over the opening ticks.\n\t var m = text.match( /(`+)(([\\s\\S]*?)\\1)/ );\n\t\n\t if ( m && m[2] )\n\t return [ m[1].length + m[2].length, [ \"inlinecode\", m[3] ] ];\n\t else {\n\t // TODO: No matching end code found - warn!\n\t return [ 1, \"`\" ];\n\t }\n\t },\n\t\n\t \" \\n\": function lineBreak( text ) {\n\t return [ 3, [ \"linebreak\" ] ];\n\t }\n\t\n\t};\n\t\n\t// Meta Helper/generator method for em and strong handling\n\tfunction strong_em( tag, md ) {\n\t\n\t var state_slot = tag + \"_state\",\n\t other_slot = tag == \"strong\" ? \"em_state\" : \"strong_state\";\n\t\n\t function CloseTag(len) {\n\t this.len_after = len;\n\t this.name = \"close_\" + md;\n\t }\n\t\n\t return function ( text, orig_match ) {\n\t\n\t if ( this[state_slot][0] == md ) {\n\t // Most recent em is of this type\n\t //D:this.debug(\"closing\", md);\n\t this[state_slot].shift();\n\t\n\t // \"Consume\" everything to go back to the recrusion in the else-block below\n\t return[ text.length, new CloseTag(text.length-md.length) ];\n\t }\n\t else {\n\t // Store a clone of the em/strong states\n\t var other = this[other_slot].slice(),\n\t state = this[state_slot].slice();\n\t\n\t this[state_slot].unshift(md);\n\t\n\t //D:this.debug_indent += \" \";\n\t\n\t // Recurse\n\t var res = this.processInline( text.substr( md.length ) );\n\t //D:this.debug_indent = this.debug_indent.substr(2);\n\t\n\t var last = res[res.length - 1];\n\t\n\t //D:this.debug(\"processInline from\", tag + \": \", uneval( res ) );\n\t\n\t var check = this[state_slot].shift();\n\t if ( last instanceof CloseTag ) {\n\t res.pop();\n\t // We matched! Huzzah.\n\t var consumed = text.length - last.len_after;\n\t return [ consumed, [ tag ].concat(res) ];\n\t }\n\t else {\n\t // Restore the state of the other kind. We might have mistakenly closed it.\n\t this[other_slot] = other;\n\t this[state_slot] = state;\n\t\n\t // We can't reuse the processed result as it could have wrong parsing contexts in it.\n\t return [ md.length, md ];\n\t }\n\t }\n\t }; // End returned function\n\t}\n\t\n\tMarkdown.dialects.Gruber.inline[\"**\"] = strong_em(\"strong\", \"**\");\n\tMarkdown.dialects.Gruber.inline[\"__\"] = strong_em(\"strong\", \"__\");\n\tMarkdown.dialects.Gruber.inline[\"*\"] = strong_em(\"em\", \"*\");\n\tMarkdown.dialects.Gruber.inline[\"_\"] = strong_em(\"em\", \"_\");\n\t\n\t\n\t// Build default order from insertion order.\n\tMarkdown.buildBlockOrder = function(d) {\n\t var ord = [];\n\t for ( var i in d ) {\n\t if ( i == \"__order__\" || i == \"__call__\" ) continue;\n\t ord.push( i );\n\t }\n\t d.__order__ = ord;\n\t};\n\t\n\t// Build patterns for inline matcher\n\tMarkdown.buildInlinePatterns = function(d) {\n\t var patterns = [];\n\t\n\t for ( var i in d ) {\n\t // __foo__ is reserved and not a pattern\n\t if ( i.match( /^__.*__$/) ) continue;\n\t var l = i.replace( /([\\\\.*+?|()\\[\\]{}])/g, \"\\\\$1\" )\n\t .replace( /\\n/, \"\\\\n\" );\n\t patterns.push( i.length == 1 ? l : \"(?:\" + l + \")\" );\n\t }\n\t\n\t patterns = patterns.join(\"|\");\n\t d.__patterns__ = patterns;\n\t //print(\"patterns:\", uneval( patterns ) );\n\t\n\t var fn = d.__call__;\n\t d.__call__ = function(text, pattern) {\n\t if ( pattern != undefined ) {\n\t return fn.call(this, text, pattern);\n\t }\n\t else\n\t {\n\t return fn.call(this, text, patterns);\n\t }\n\t };\n\t};\n\t\n\tMarkdown.DialectHelpers = {};\n\tMarkdown.DialectHelpers.inline_until_char = function( text, want ) {\n\t var consumed = 0,\n\t nodes = [];\n\t\n\t while ( true ) {\n\t if ( text.charAt( consumed ) == want ) {\n\t // Found the character we were looking for\n\t consumed++;\n\t return [ consumed, nodes ];\n\t }\n\t\n\t if ( consumed >= text.length ) {\n\t // No closing char found. Abort.\n\t return null;\n\t }\n\t\n\t var res = this.dialect.inline.__oneElement__.call(this, text.substr( consumed ) );\n\t consumed += res[ 0 ];\n\t // Add any returned nodes.\n\t nodes.push.apply( nodes, res.slice( 1 ) );\n\t }\n\t}\n\t\n\t// Helper function to make sub-classing a dialect easier\n\tMarkdown.subclassDialect = function( d ) {\n\t function Block() {}\n\t Block.prototype = d.block;\n\t function Inline() {}\n\t Inline.prototype = d.inline;\n\t\n\t return { block: new Block(), inline: new Inline() };\n\t};\n\t\n\tMarkdown.buildBlockOrder ( Markdown.dialects.Gruber.block );\n\tMarkdown.buildInlinePatterns( Markdown.dialects.Gruber.inline );\n\t\n\tMarkdown.dialects.Maruku = Markdown.subclassDialect( Markdown.dialects.Gruber );\n\t\n\tMarkdown.dialects.Maruku.processMetaHash = function processMetaHash( meta_string ) {\n\t var meta = split_meta_hash( meta_string ),\n\t attr = {};\n\t\n\t for ( var i = 0; i < meta.length; ++i ) {\n\t // id: #foo\n\t if ( /^#/.test( meta[ i ] ) ) {\n\t attr.id = meta[ i ].substring( 1 );\n\t }\n\t // class: .foo\n\t else if ( /^\\./.test( meta[ i ] ) ) {\n\t // if class already exists, append the new one\n\t if ( attr[\"class\"] ) {\n\t attr[\"class\"] = attr[\"class\"] + meta[ i ].replace( /./, \" \" );\n\t }\n\t else {\n\t attr[\"class\"] = meta[ i ].substring( 1 );\n\t }\n\t }\n\t // attribute: foo=bar\n\t else if ( /\\=/.test( meta[ i ] ) ) {\n\t var s = meta[ i ].split( /\\=/ );\n\t attr[ s[ 0 ] ] = s[ 1 ];\n\t }\n\t }\n\t\n\t return attr;\n\t}\n\t\n\tfunction split_meta_hash( meta_string ) {\n\t var meta = meta_string.split( \"\" ),\n\t parts = [ \"\" ],\n\t in_quotes = false;\n\t\n\t while ( meta.length ) {\n\t var letter = meta.shift();\n\t switch ( letter ) {\n\t case \" \" :\n\t // if we're in a quoted section, keep it\n\t if ( in_quotes ) {\n\t parts[ parts.length - 1 ] += letter;\n\t }\n\t // otherwise make a new part\n\t else {\n\t parts.push( \"\" );\n\t }\n\t break;\n\t case \"'\" :\n\t case '\"' :\n\t // reverse the quotes and move straight on\n\t in_quotes = !in_quotes;\n\t break;\n\t case \"\\\\\" :\n\t // shift off the next letter to be used straight away.\n\t // it was escaped so we'll keep it whatever it is\n\t letter = meta.shift();\n\t default :\n\t parts[ parts.length - 1 ] += letter;\n\t break;\n\t }\n\t }\n\t\n\t return parts;\n\t}\n\t\n\tMarkdown.dialects.Maruku.block.document_meta = function document_meta( block, next ) {\n\t // we're only interested in the first block\n\t if ( block.lineNumber > 1 ) return undefined;\n\t\n\t // document_meta blocks consist of one or more lines of `Key: Value\\n`\n\t if ( ! block.match( /^(?:\\w+:.*\\n)*\\w+:.*$/ ) ) return undefined;\n\t\n\t // make an attribute node if it doesn't exist\n\t if ( !extract_attr( this.tree ) ) {\n\t this.tree.splice( 1, 0, {} );\n\t }\n\t\n\t var pairs = block.split( /\\n/ );\n\t for ( p in pairs ) {\n\t var m = pairs[ p ].match( /(\\w+):\\s*(.*)$/ ),\n\t key = m[ 1 ].toLowerCase(),\n\t value = m[ 2 ];\n\t\n\t this.tree[ 1 ][ key ] = value;\n\t }\n\t\n\t // document_meta produces no content!\n\t return [];\n\t};\n\t\n\tMarkdown.dialects.Maruku.block.block_meta = function block_meta( block, next ) {\n\t // check if the last line of the block is an meta hash\n\t var m = block.match( /(^|\\n) {0,3}\\{:\\s*((?:\\\\\\}|[^\\}])*)\\s*\\}$/ );\n\t if ( !m ) return undefined;\n\t\n\t // process the meta hash\n\t var attr = this.dialect.processMetaHash( m[ 2 ] );\n\t\n\t var hash;\n\t\n\t // if we matched ^ then we need to apply meta to the previous block\n\t if ( m[ 1 ] === \"\" ) {\n\t var node = this.tree[ this.tree.length - 1 ];\n\t hash = extract_attr( node );\n\t\n\t // if the node is a string (rather than JsonML), bail\n\t if ( typeof node === \"string\" ) return undefined;\n\t\n\t // create the attribute hash if it doesn't exist\n\t if ( !hash ) {\n\t hash = {};\n\t node.splice( 1, 0, hash );\n\t }\n\t\n\t // add the attributes in\n\t for ( a in attr ) {\n\t hash[ a ] = attr[ a ];\n\t }\n\t\n\t // return nothing so the meta hash is removed\n\t return [];\n\t }\n\t\n\t // pull the meta hash off the block and process what's left\n\t var b = block.replace( /\\n.*$/, \"\" ),\n\t result = this.processBlock( b, [] );\n\t\n\t // get or make the attributes hash\n\t hash = extract_attr( result[ 0 ] );\n\t if ( !hash ) {\n\t hash = {};\n\t result[ 0 ].splice( 1, 0, hash );\n\t }\n\t\n\t // attach the attributes to the block\n\t for ( a in attr ) {\n\t hash[ a ] = attr[ a ];\n\t }\n\t\n\t return result;\n\t};\n\t\n\tMarkdown.dialects.Maruku.block.definition_list = function definition_list( block, next ) {\n\t // one or more terms followed by one or more definitions, in a single block\n\t var tight = /^((?:[^\\s:].*\\n)+):\\s+([\\s\\S]+)$/,\n\t list = [ \"dl\" ],\n\t i, m;\n\t\n\t // see if we're dealing with a tight or loose block\n\t if ( ( m = block.match( tight ) ) ) {\n\t // pull subsequent tight DL blocks out of `next`\n\t var blocks = [ block ];\n\t while ( next.length && tight.exec( next[ 0 ] ) ) {\n\t blocks.push( next.shift() );\n\t }\n\t\n\t for ( var b = 0; b < blocks.length; ++b ) {\n\t var m = blocks[ b ].match( tight ),\n\t terms = m[ 1 ].replace( /\\n$/, \"\" ).split( /\\n/ ),\n\t defns = m[ 2 ].split( /\\n:\\s+/ );\n\t\n\t // print( uneval( m ) );\n\t\n\t for ( i = 0; i < terms.length; ++i ) {\n\t list.push( [ \"dt\", terms[ i ] ] );\n\t }\n\t\n\t for ( i = 0; i < defns.length; ++i ) {\n\t // run inline processing over the definition\n\t list.push( [ \"dd\" ].concat( this.processInline( defns[ i ].replace( /(\\n)\\s+/, \"$1\" ) ) ) );\n\t }\n\t }\n\t }\n\t else {\n\t return undefined;\n\t }\n\t\n\t return [ list ];\n\t};\n\t\n\t// splits on unescaped instances of @ch. If @ch is not a character the result\n\t// can be unpredictable\n\t\n\tMarkdown.dialects.Maruku.block.table = function table (block, next) {\n\t\n\t var _split_on_unescaped = function(s, ch) {\n\t ch = ch || '\\\\s';\n\t if (ch.match(/^[\\\\|\\[\\]{}?*.+^$]$/)) { ch = '\\\\' + ch; }\n\t var res = [ ],\n\t r = new RegExp('^((?:\\\\\\\\.|[^\\\\\\\\' + ch + '])*)' + ch + '(.*)'),\n\t m;\n\t while(m = s.match(r)) {\n\t res.push(m[1]);\n\t s = m[2];\n\t }\n\t res.push(s);\n\t return res;\n\t }\n\t\n\t var leading_pipe = /^ {0,3}\\|(.+)\\n {0,3}\\|\\s*([\\-:]+[\\-| :]*)\\n((?:\\s*\\|.*(?:\\n|$))*)(?=\\n|$)/,\n\t // find at least an unescaped pipe in each line\n\t no_leading_pipe = /^ {0,3}(\\S(?:\\\\.|[^\\\\|])*\\|.*)\\n {0,3}([\\-:]+\\s*\\|[\\-| :]*)\\n((?:(?:\\\\.|[^\\\\|])*\\|.*(?:\\n|$))*)(?=\\n|$)/,\n\t i, m;\n\t if (m = block.match(leading_pipe)) {\n\t // remove leading pipes in contents\n\t // (header and horizontal rule already have the leading pipe left out)\n\t m[3] = m[3].replace(/^\\s*\\|/gm, '');\n\t } else if (! ( m = block.match(no_leading_pipe))) {\n\t return undefined;\n\t }\n\t\n\t var table = [ \"table\", [ \"thead\", [ \"tr\" ] ], [ \"tbody\" ] ];\n\t\n\t // remove trailing pipes, then split on pipes\n\t // (no escaped pipes are allowed in horizontal rule)\n\t m[2] = m[2].replace(/\\|\\s*$/, '').split('|');\n\t\n\t // process alignment\n\t var html_attrs = [ ];\n\t forEach (m[2], function (s) {\n\t if (s.match(/^\\s*-+:\\s*$/)) html_attrs.push({align: \"right\"});\n\t else if (s.match(/^\\s*:-+\\s*$/)) html_attrs.push({align: \"left\"});\n\t else if (s.match(/^\\s*:-+:\\s*$/)) html_attrs.push({align: \"center\"});\n\t else html_attrs.push({});\n\t });\n\t\n\t // now for the header, avoid escaped pipes\n\t m[1] = _split_on_unescaped(m[1].replace(/\\|\\s*$/, ''), '|');\n\t for (i = 0; i < m[1].length; i++) {\n\t table[1][1].push(['th', html_attrs[i] || {}].concat(\n\t this.processInline(m[1][i].trim())));\n\t }\n\t\n\t // now for body contents\n\t forEach (m[3].replace(/\\|\\s*$/mg, '').split('\\n'), function (row) {\n\t var html_row = ['tr'];\n\t row = _split_on_unescaped(row, '|');\n\t for (i = 0; i < row.length; i++) {\n\t html_row.push(['td', html_attrs[i] || {}].concat(this.processInline(row[i].trim())));\n\t }\n\t table[2].push(html_row);\n\t }, this);\n\t\n\t return [table];\n\t}\n\t\n\tMarkdown.dialects.Maruku.inline[ \"{:\" ] = function inline_meta( text, matches, out ) {\n\t if ( !out.length ) {\n\t return [ 2, \"{:\" ];\n\t }\n\t\n\t // get the preceeding element\n\t var before = out[ out.length - 1 ];\n\t\n\t if ( typeof before === \"string\" ) {\n\t return [ 2, \"{:\" ];\n\t }\n\t\n\t // match a meta hash\n\t var m = text.match( /^\\{:\\s*((?:\\\\\\}|[^\\}])*)\\s*\\}/ );\n\t\n\t // no match, false alarm\n\t if ( !m ) {\n\t return [ 2, \"{:\" ];\n\t }\n\t\n\t // attach the attributes to the preceeding element\n\t var meta = this.dialect.processMetaHash( m[ 1 ] ),\n\t attr = extract_attr( before );\n\t\n\t if ( !attr ) {\n\t attr = {};\n\t before.splice( 1, 0, attr );\n\t }\n\t\n\t for ( var k in meta ) {\n\t attr[ k ] = meta[ k ];\n\t }\n\t\n\t // cut out the string and replace it with nothing\n\t return [ m[ 0 ].length, \"\" ];\n\t};\n\t\n\tMarkdown.dialects.Maruku.inline.__escape__ = /^\\\\[\\\\`\\*_{}\\[\\]()#\\+.!\\-|:]/;\n\t\n\tMarkdown.buildBlockOrder ( Markdown.dialects.Maruku.block );\n\tMarkdown.buildInlinePatterns( Markdown.dialects.Maruku.inline );\n\t\n\tvar isArray = Array.isArray || function(obj) {\n\t return Object.prototype.toString.call(obj) == \"[object Array]\";\n\t};\n\t\n\tvar forEach;\n\t// Don't mess with Array.prototype. Its not friendly\n\tif ( Array.prototype.forEach ) {\n\t forEach = function( arr, cb, thisp ) {\n\t return arr.forEach( cb, thisp );\n\t };\n\t}\n\telse {\n\t forEach = function(arr, cb, thisp) {\n\t for (var i = 0; i < arr.length; i++) {\n\t cb.call(thisp || arr, arr[i], i, arr);\n\t }\n\t }\n\t}\n\t\n\tvar isEmpty = function( obj ) {\n\t for ( var key in obj ) {\n\t if ( hasOwnProperty.call( obj, key ) ) {\n\t return false;\n\t }\n\t }\n\t\n\t return true;\n\t}\n\t\n\tfunction extract_attr( jsonml ) {\n\t return isArray(jsonml)\n\t && jsonml.length > 1\n\t && typeof jsonml[ 1 ] === \"object\"\n\t && !( isArray(jsonml[ 1 ]) )\n\t ? jsonml[ 1 ]\n\t : undefined;\n\t}\n\t\n\t\n\t\n\t/**\n\t * renderJsonML( jsonml[, options] ) -> String\n\t * - jsonml (Array): JsonML array to render to XML\n\t * - options (Object): options\n\t *\n\t * Converts the given JsonML into well-formed XML.\n\t *\n\t * The options currently understood are:\n\t *\n\t * - root (Boolean): wether or not the root node should be included in the\n\t * output, or just its children. The default `false` is to not include the\n\t * root itself.\n\t */\n\texpose.renderJsonML = function( jsonml, options ) {\n\t options = options || {};\n\t // include the root element in the rendered output?\n\t options.root = options.root || false;\n\t\n\t var content = [];\n\t\n\t if ( options.root ) {\n\t content.push( render_tree( jsonml ) );\n\t }\n\t else {\n\t jsonml.shift(); // get rid of the tag\n\t if ( jsonml.length && typeof jsonml[ 0 ] === \"object\" && !( jsonml[ 0 ] instanceof Array ) ) {\n\t jsonml.shift(); // get rid of the attributes\n\t }\n\t\n\t while ( jsonml.length ) {\n\t content.push( render_tree( jsonml.shift() ) );\n\t }\n\t }\n\t\n\t return content.join( \"\\n\\n\" );\n\t};\n\t\n\tfunction escapeHTML( text ) {\n\t return text.replace( /&/g, \"&\" )\n\t .replace( //g, \">\" )\n\t .replace( /\"/g, \""\" )\n\t .replace( /'/g, \"'\" );\n\t}\n\t\n\tfunction render_tree( jsonml ) {\n\t // basic case\n\t if ( typeof jsonml === \"string\" ) {\n\t return escapeHTML( jsonml );\n\t }\n\t\n\t var tag = jsonml.shift(),\n\t attributes = {},\n\t content = [];\n\t\n\t if ( jsonml.length && typeof jsonml[ 0 ] === \"object\" && !( jsonml[ 0 ] instanceof Array ) ) {\n\t attributes = jsonml.shift();\n\t }\n\t\n\t while ( jsonml.length ) {\n\t content.push( render_tree( jsonml.shift() ) );\n\t }\n\t\n\t var tag_attrs = \"\";\n\t for ( var a in attributes ) {\n\t tag_attrs += \" \" + a + '=\"' + escapeHTML( attributes[ a ] ) + '\"';\n\t }\n\t\n\t // be careful about adding whitespace here for inline elements\n\t if ( tag == \"img\" || tag == \"br\" || tag == \"hr\" ) {\n\t return \"<\"+ tag + tag_attrs + \"/>\";\n\t }\n\t else {\n\t return \"<\"+ tag + tag_attrs + \">\" + content.join( \"\" ) + \"\";\n\t }\n\t}\n\t\n\tfunction convert_tree_to_html( tree, references, options ) {\n\t var i;\n\t options = options || {};\n\t\n\t // shallow clone\n\t var jsonml = tree.slice( 0 );\n\t\n\t if ( typeof options.preprocessTreeNode === \"function\" ) {\n\t jsonml = options.preprocessTreeNode(jsonml, references);\n\t }\n\t\n\t // Clone attributes if they exist\n\t var attrs = extract_attr( jsonml );\n\t if ( attrs ) {\n\t jsonml[ 1 ] = {};\n\t for ( i in attrs ) {\n\t jsonml[ 1 ][ i ] = attrs[ i ];\n\t }\n\t attrs = jsonml[ 1 ];\n\t }\n\t\n\t // basic case\n\t if ( typeof jsonml === \"string\" ) {\n\t return jsonml;\n\t }\n\t\n\t // convert this node\n\t switch ( jsonml[ 0 ] ) {\n\t case \"header\":\n\t jsonml[ 0 ] = \"h\" + jsonml[ 1 ].level;\n\t delete jsonml[ 1 ].level;\n\t break;\n\t case \"bulletlist\":\n\t jsonml[ 0 ] = \"ul\";\n\t break;\n\t case \"numberlist\":\n\t jsonml[ 0 ] = \"ol\";\n\t break;\n\t case \"listitem\":\n\t jsonml[ 0 ] = \"li\";\n\t break;\n\t case \"para\":\n\t jsonml[ 0 ] = \"p\";\n\t break;\n\t case \"markdown\":\n\t jsonml[ 0 ] = \"html\";\n\t if ( attrs ) delete attrs.references;\n\t break;\n\t case \"code_block\":\n\t jsonml[ 0 ] = \"pre\";\n\t i = attrs ? 2 : 1;\n\t var code = [ \"code\" ];\n\t code.push.apply( code, jsonml.splice( i, jsonml.length - i ) );\n\t jsonml[ i ] = code;\n\t break;\n\t case \"inlinecode\":\n\t jsonml[ 0 ] = \"code\";\n\t break;\n\t case \"img\":\n\t jsonml[ 1 ].src = jsonml[ 1 ].href;\n\t delete jsonml[ 1 ].href;\n\t break;\n\t case \"linebreak\":\n\t jsonml[ 0 ] = \"br\";\n\t break;\n\t case \"link\":\n\t jsonml[ 0 ] = \"a\";\n\t break;\n\t case \"link_ref\":\n\t jsonml[ 0 ] = \"a\";\n\t\n\t // grab this ref and clean up the attribute node\n\t var ref = references[ attrs.ref ];\n\t\n\t // if the reference exists, make the link\n\t if ( ref ) {\n\t delete attrs.ref;\n\t\n\t // add in the href and title, if present\n\t attrs.href = ref.href;\n\t if ( ref.title ) {\n\t attrs.title = ref.title;\n\t }\n\t\n\t // get rid of the unneeded original text\n\t delete attrs.original;\n\t }\n\t // the reference doesn't exist, so revert to plain text\n\t else {\n\t return attrs.original;\n\t }\n\t break;\n\t case \"img_ref\":\n\t jsonml[ 0 ] = \"img\";\n\t\n\t // grab this ref and clean up the attribute node\n\t var ref = references[ attrs.ref ];\n\t\n\t // if the reference exists, make the link\n\t if ( ref ) {\n\t delete attrs.ref;\n\t\n\t // add in the href and title, if present\n\t attrs.src = ref.href;\n\t if ( ref.title ) {\n\t attrs.title = ref.title;\n\t }\n\t\n\t // get rid of the unneeded original text\n\t delete attrs.original;\n\t }\n\t // the reference doesn't exist, so revert to plain text\n\t else {\n\t return attrs.original;\n\t }\n\t break;\n\t }\n\t\n\t // convert all the children\n\t i = 1;\n\t\n\t // deal with the attribute node, if it exists\n\t if ( attrs ) {\n\t // if there are keys, skip over it\n\t for ( var key in jsonml[ 1 ] ) {\n\t i = 2;\n\t break;\n\t }\n\t // if there aren't, remove it\n\t if ( i === 1 ) {\n\t jsonml.splice( i, 1 );\n\t }\n\t }\n\t\n\t for ( ; i < jsonml.length; ++i ) {\n\t jsonml[ i ] = convert_tree_to_html( jsonml[ i ], references, options );\n\t }\n\t\n\t return jsonml;\n\t}\n\t\n\t\n\t// merges adjacent text nodes into a single node\n\tfunction merge_text_nodes( jsonml ) {\n\t // skip the tag name and attribute hash\n\t var i = extract_attr( jsonml ) ? 2 : 1;\n\t\n\t while ( i < jsonml.length ) {\n\t // if it's a string check the next item too\n\t if ( typeof jsonml[ i ] === \"string\" ) {\n\t if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n\t // merge the second string into the first and remove it\n\t jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n\t }\n\t else {\n\t ++i;\n\t }\n\t }\n\t // if it's not a string recurse\n\t else {\n\t merge_text_nodes( jsonml[ i ] );\n\t ++i;\n\t }\n\t }\n\t}\n\t\n\t} )( (function() {\n\t if ( false ) {\n\t window.markdown = {};\n\t return window.markdown;\n\t }\n\t else {\n\t return exports;\n\t }\n\t} )() );\n\n\n/***/ },\n\n/***/ 1276:\n/***/ function(module, exports) {\n\n\tif (typeof Object.create === 'function') {\n\t // implementation from standard node.js 'util' module\n\t module.exports = function inherits(ctor, superCtor) {\n\t ctor.super_ = superCtor\n\t ctor.prototype = Object.create(superCtor.prototype, {\n\t constructor: {\n\t value: ctor,\n\t enumerable: false,\n\t writable: true,\n\t configurable: true\n\t }\n\t });\n\t };\n\t} else {\n\t // old school shim for old browsers\n\t module.exports = function inherits(ctor, superCtor) {\n\t ctor.super_ = superCtor\n\t var TempCtor = function () {}\n\t TempCtor.prototype = superCtor.prototype\n\t ctor.prototype = new TempCtor()\n\t ctor.prototype.constructor = ctor\n\t }\n\t}\n\n\n/***/ },\n\n/***/ 1277:\n/***/ function(module, exports) {\n\n\tmodule.exports = function isBuffer(arg) {\n\t return arg && typeof arg === 'object'\n\t && typeof arg.copy === 'function'\n\t && typeof arg.fill === 'function'\n\t && typeof arg.readUInt8 === 'function';\n\t}\n\n/***/ },\n\n/***/ 1278:\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n\t//\n\t// Permission is hereby granted, free of charge, to any person obtaining a\n\t// copy of this software and associated documentation files (the\n\t// \"Software\"), to deal in the Software without restriction, including\n\t// without limitation the rights to use, copy, modify, merge, publish,\n\t// distribute, sublicense, and/or sell copies of the Software, and to permit\n\t// persons to whom the Software is furnished to do so, subject to the\n\t// following conditions:\n\t//\n\t// The above copyright notice and this permission notice shall be included\n\t// in all copies or substantial portions of the Software.\n\t//\n\t// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n\t// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\t// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n\t// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n\t// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n\t// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n\t// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\t\n\tvar formatRegExp = /%[sdj%]/g;\n\texports.format = function(f) {\n\t if (!isString(f)) {\n\t var objects = [];\n\t for (var i = 0; i < arguments.length; i++) {\n\t objects.push(inspect(arguments[i]));\n\t }\n\t return objects.join(' ');\n\t }\n\t\n\t var i = 1;\n\t var args = arguments;\n\t var len = args.length;\n\t var str = String(f).replace(formatRegExp, function(x) {\n\t if (x === '%%') return '%';\n\t if (i >= len) return x;\n\t switch (x) {\n\t case '%s': return String(args[i++]);\n\t case '%d': return Number(args[i++]);\n\t case '%j':\n\t try {\n\t return JSON.stringify(args[i++]);\n\t } catch (_) {\n\t return '[Circular]';\n\t }\n\t default:\n\t return x;\n\t }\n\t });\n\t for (var x = args[i]; i < len; x = args[++i]) {\n\t if (isNull(x) || !isObject(x)) {\n\t str += ' ' + x;\n\t } else {\n\t str += ' ' + inspect(x);\n\t }\n\t }\n\t return str;\n\t};\n\t\n\t\n\t// Mark that a method should not be used.\n\t// Returns a modified function which warns once by default.\n\t// If --no-deprecation is set, then it is a no-op.\n\texports.deprecate = function(fn, msg) {\n\t // Allow for deprecating things in the process of starting up.\n\t if (isUndefined(global.process)) {\n\t return function() {\n\t return exports.deprecate(fn, msg).apply(this, arguments);\n\t };\n\t }\n\t\n\t if (process.noDeprecation === true) {\n\t return fn;\n\t }\n\t\n\t var warned = false;\n\t function deprecated() {\n\t if (!warned) {\n\t if (process.throwDeprecation) {\n\t throw new Error(msg);\n\t } else if (process.traceDeprecation) {\n\t console.trace(msg);\n\t } else {\n\t console.error(msg);\n\t }\n\t warned = true;\n\t }\n\t return fn.apply(this, arguments);\n\t }\n\t\n\t return deprecated;\n\t};\n\t\n\t\n\tvar debugs = {};\n\tvar debugEnviron;\n\texports.debuglog = function(set) {\n\t if (isUndefined(debugEnviron))\n\t debugEnviron = ({\"NODE_ENV\":\"production\"}).NODE_DEBUG || '';\n\t set = set.toUpperCase();\n\t if (!debugs[set]) {\n\t if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n\t var pid = process.pid;\n\t debugs[set] = function() {\n\t var msg = exports.format.apply(exports, arguments);\n\t console.error('%s %d: %s', set, pid, msg);\n\t };\n\t } else {\n\t debugs[set] = function() {};\n\t }\n\t }\n\t return debugs[set];\n\t};\n\t\n\t\n\t/**\n\t * Echos the value of a value. Trys to print the value out\n\t * in the best way possible given the different types.\n\t *\n\t * @param {Object} obj The object to print out.\n\t * @param {Object} opts Optional options object that alters the output.\n\t */\n\t/* legacy: obj, showHidden, depth, colors*/\n\tfunction inspect(obj, opts) {\n\t // default options\n\t var ctx = {\n\t seen: [],\n\t stylize: stylizeNoColor\n\t };\n\t // legacy...\n\t if (arguments.length >= 3) ctx.depth = arguments[2];\n\t if (arguments.length >= 4) ctx.colors = arguments[3];\n\t if (isBoolean(opts)) {\n\t // legacy...\n\t ctx.showHidden = opts;\n\t } else if (opts) {\n\t // got an \"options\" object\n\t exports._extend(ctx, opts);\n\t }\n\t // set default options\n\t if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n\t if (isUndefined(ctx.depth)) ctx.depth = 2;\n\t if (isUndefined(ctx.colors)) ctx.colors = false;\n\t if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n\t if (ctx.colors) ctx.stylize = stylizeWithColor;\n\t return formatValue(ctx, obj, ctx.depth);\n\t}\n\texports.inspect = inspect;\n\t\n\t\n\t// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\n\tinspect.colors = {\n\t 'bold' : [1, 22],\n\t 'italic' : [3, 23],\n\t 'underline' : [4, 24],\n\t 'inverse' : [7, 27],\n\t 'white' : [37, 39],\n\t 'grey' : [90, 39],\n\t 'black' : [30, 39],\n\t 'blue' : [34, 39],\n\t 'cyan' : [36, 39],\n\t 'green' : [32, 39],\n\t 'magenta' : [35, 39],\n\t 'red' : [31, 39],\n\t 'yellow' : [33, 39]\n\t};\n\t\n\t// Don't use 'blue' not visible on cmd.exe\n\tinspect.styles = {\n\t 'special': 'cyan',\n\t 'number': 'yellow',\n\t 'boolean': 'yellow',\n\t 'undefined': 'grey',\n\t 'null': 'bold',\n\t 'string': 'green',\n\t 'date': 'magenta',\n\t // \"name\": intentionally not styling\n\t 'regexp': 'red'\n\t};\n\t\n\t\n\tfunction stylizeWithColor(str, styleType) {\n\t var style = inspect.styles[styleType];\n\t\n\t if (style) {\n\t return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n\t '\\u001b[' + inspect.colors[style][1] + 'm';\n\t } else {\n\t return str;\n\t }\n\t}\n\t\n\t\n\tfunction stylizeNoColor(str, styleType) {\n\t return str;\n\t}\n\t\n\t\n\tfunction arrayToHash(array) {\n\t var hash = {};\n\t\n\t array.forEach(function(val, idx) {\n\t hash[val] = true;\n\t });\n\t\n\t return hash;\n\t}\n\t\n\t\n\tfunction formatValue(ctx, value, recurseTimes) {\n\t // Provide a hook for user-specified inspect functions.\n\t // Check that value is an object with an inspect function on it\n\t if (ctx.customInspect &&\n\t value &&\n\t isFunction(value.inspect) &&\n\t // Filter out the util module, it's inspect function is special\n\t value.inspect !== exports.inspect &&\n\t // Also filter out any prototype objects using the circular check.\n\t !(value.constructor && value.constructor.prototype === value)) {\n\t var ret = value.inspect(recurseTimes, ctx);\n\t if (!isString(ret)) {\n\t ret = formatValue(ctx, ret, recurseTimes);\n\t }\n\t return ret;\n\t }\n\t\n\t // Primitive types cannot have properties\n\t var primitive = formatPrimitive(ctx, value);\n\t if (primitive) {\n\t return primitive;\n\t }\n\t\n\t // Look up the keys of the object.\n\t var keys = Object.keys(value);\n\t var visibleKeys = arrayToHash(keys);\n\t\n\t if (ctx.showHidden) {\n\t keys = Object.getOwnPropertyNames(value);\n\t }\n\t\n\t // IE doesn't make error fields non-enumerable\n\t // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n\t if (isError(value)\n\t && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n\t return formatError(value);\n\t }\n\t\n\t // Some type of object without properties can be shortcutted.\n\t if (keys.length === 0) {\n\t if (isFunction(value)) {\n\t var name = value.name ? ': ' + value.name : '';\n\t return ctx.stylize('[Function' + name + ']', 'special');\n\t }\n\t if (isRegExp(value)) {\n\t return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n\t }\n\t if (isDate(value)) {\n\t return ctx.stylize(Date.prototype.toString.call(value), 'date');\n\t }\n\t if (isError(value)) {\n\t return formatError(value);\n\t }\n\t }\n\t\n\t var base = '', array = false, braces = ['{', '}'];\n\t\n\t // Make Array say that they are Array\n\t if (isArray(value)) {\n\t array = true;\n\t braces = ['[', ']'];\n\t }\n\t\n\t // Make functions say that they are functions\n\t if (isFunction(value)) {\n\t var n = value.name ? ': ' + value.name : '';\n\t base = ' [Function' + n + ']';\n\t }\n\t\n\t // Make RegExps say that they are RegExps\n\t if (isRegExp(value)) {\n\t base = ' ' + RegExp.prototype.toString.call(value);\n\t }\n\t\n\t // Make dates with properties first say the date\n\t if (isDate(value)) {\n\t base = ' ' + Date.prototype.toUTCString.call(value);\n\t }\n\t\n\t // Make error with message first say the error\n\t if (isError(value)) {\n\t base = ' ' + formatError(value);\n\t }\n\t\n\t if (keys.length === 0 && (!array || value.length == 0)) {\n\t return braces[0] + base + braces[1];\n\t }\n\t\n\t if (recurseTimes < 0) {\n\t if (isRegExp(value)) {\n\t return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n\t } else {\n\t return ctx.stylize('[Object]', 'special');\n\t }\n\t }\n\t\n\t ctx.seen.push(value);\n\t\n\t var output;\n\t if (array) {\n\t output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n\t } else {\n\t output = keys.map(function(key) {\n\t return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n\t });\n\t }\n\t\n\t ctx.seen.pop();\n\t\n\t return reduceToSingleString(output, base, braces);\n\t}\n\t\n\t\n\tfunction formatPrimitive(ctx, value) {\n\t if (isUndefined(value))\n\t return ctx.stylize('undefined', 'undefined');\n\t if (isString(value)) {\n\t var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n\t .replace(/'/g, \"\\\\'\")\n\t .replace(/\\\\\"/g, '\"') + '\\'';\n\t return ctx.stylize(simple, 'string');\n\t }\n\t if (isNumber(value))\n\t return ctx.stylize('' + value, 'number');\n\t if (isBoolean(value))\n\t return ctx.stylize('' + value, 'boolean');\n\t // For some reason typeof null is \"object\", so special case here.\n\t if (isNull(value))\n\t return ctx.stylize('null', 'null');\n\t}\n\t\n\t\n\tfunction formatError(value) {\n\t return '[' + Error.prototype.toString.call(value) + ']';\n\t}\n\t\n\t\n\tfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n\t var output = [];\n\t for (var i = 0, l = value.length; i < l; ++i) {\n\t if (hasOwnProperty(value, String(i))) {\n\t output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n\t String(i), true));\n\t } else {\n\t output.push('');\n\t }\n\t }\n\t keys.forEach(function(key) {\n\t if (!key.match(/^\\d+$/)) {\n\t output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n\t key, true));\n\t }\n\t });\n\t return output;\n\t}\n\t\n\t\n\tfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n\t var name, str, desc;\n\t desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n\t if (desc.get) {\n\t if (desc.set) {\n\t str = ctx.stylize('[Getter/Setter]', 'special');\n\t } else {\n\t str = ctx.stylize('[Getter]', 'special');\n\t }\n\t } else {\n\t if (desc.set) {\n\t str = ctx.stylize('[Setter]', 'special');\n\t }\n\t }\n\t if (!hasOwnProperty(visibleKeys, key)) {\n\t name = '[' + key + ']';\n\t }\n\t if (!str) {\n\t if (ctx.seen.indexOf(desc.value) < 0) {\n\t if (isNull(recurseTimes)) {\n\t str = formatValue(ctx, desc.value, null);\n\t } else {\n\t str = formatValue(ctx, desc.value, recurseTimes - 1);\n\t }\n\t if (str.indexOf('\\n') > -1) {\n\t if (array) {\n\t str = str.split('\\n').map(function(line) {\n\t return ' ' + line;\n\t }).join('\\n').substr(2);\n\t } else {\n\t str = '\\n' + str.split('\\n').map(function(line) {\n\t return ' ' + line;\n\t }).join('\\n');\n\t }\n\t }\n\t } else {\n\t str = ctx.stylize('[Circular]', 'special');\n\t }\n\t }\n\t if (isUndefined(name)) {\n\t if (array && key.match(/^\\d+$/)) {\n\t return str;\n\t }\n\t name = JSON.stringify('' + key);\n\t if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n\t name = name.substr(1, name.length - 2);\n\t name = ctx.stylize(name, 'name');\n\t } else {\n\t name = name.replace(/'/g, \"\\\\'\")\n\t .replace(/\\\\\"/g, '\"')\n\t .replace(/(^\"|\"$)/g, \"'\");\n\t name = ctx.stylize(name, 'string');\n\t }\n\t }\n\t\n\t return name + ': ' + str;\n\t}\n\t\n\t\n\tfunction reduceToSingleString(output, base, braces) {\n\t var numLinesEst = 0;\n\t var length = output.reduce(function(prev, cur) {\n\t numLinesEst++;\n\t if (cur.indexOf('\\n') >= 0) numLinesEst++;\n\t return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n\t }, 0);\n\t\n\t if (length > 60) {\n\t return braces[0] +\n\t (base === '' ? '' : base + '\\n ') +\n\t ' ' +\n\t output.join(',\\n ') +\n\t ' ' +\n\t braces[1];\n\t }\n\t\n\t return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n\t}\n\t\n\t\n\t// NOTE: These type checking functions intentionally don't use `instanceof`\n\t// because it is fragile and can be easily faked with `Object.create()`.\n\tfunction isArray(ar) {\n\t return Array.isArray(ar);\n\t}\n\texports.isArray = isArray;\n\t\n\tfunction isBoolean(arg) {\n\t return typeof arg === 'boolean';\n\t}\n\texports.isBoolean = isBoolean;\n\t\n\tfunction isNull(arg) {\n\t return arg === null;\n\t}\n\texports.isNull = isNull;\n\t\n\tfunction isNullOrUndefined(arg) {\n\t return arg == null;\n\t}\n\texports.isNullOrUndefined = isNullOrUndefined;\n\t\n\tfunction isNumber(arg) {\n\t return typeof arg === 'number';\n\t}\n\texports.isNumber = isNumber;\n\t\n\tfunction isString(arg) {\n\t return typeof arg === 'string';\n\t}\n\texports.isString = isString;\n\t\n\tfunction isSymbol(arg) {\n\t return typeof arg === 'symbol';\n\t}\n\texports.isSymbol = isSymbol;\n\t\n\tfunction isUndefined(arg) {\n\t return arg === void 0;\n\t}\n\texports.isUndefined = isUndefined;\n\t\n\tfunction isRegExp(re) {\n\t return isObject(re) && objectToString(re) === '[object RegExp]';\n\t}\n\texports.isRegExp = isRegExp;\n\t\n\tfunction isObject(arg) {\n\t return typeof arg === 'object' && arg !== null;\n\t}\n\texports.isObject = isObject;\n\t\n\tfunction isDate(d) {\n\t return isObject(d) && objectToString(d) === '[object Date]';\n\t}\n\texports.isDate = isDate;\n\t\n\tfunction isError(e) {\n\t return isObject(e) &&\n\t (objectToString(e) === '[object Error]' || e instanceof Error);\n\t}\n\texports.isError = isError;\n\t\n\tfunction isFunction(arg) {\n\t return typeof arg === 'function';\n\t}\n\texports.isFunction = isFunction;\n\t\n\tfunction isPrimitive(arg) {\n\t return arg === null ||\n\t typeof arg === 'boolean' ||\n\t typeof arg === 'number' ||\n\t typeof arg === 'string' ||\n\t typeof arg === 'symbol' || // ES6 symbol\n\t typeof arg === 'undefined';\n\t}\n\texports.isPrimitive = isPrimitive;\n\t\n\texports.isBuffer = __webpack_require__(1277);\n\t\n\tfunction objectToString(o) {\n\t return Object.prototype.toString.call(o);\n\t}\n\t\n\t\n\tfunction pad(n) {\n\t return n < 10 ? '0' + n.toString(10) : n.toString(10);\n\t}\n\t\n\t\n\tvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n\t 'Oct', 'Nov', 'Dec'];\n\t\n\t// 26 Feb 16:19:34\n\tfunction timestamp() {\n\t var d = new Date();\n\t var time = [pad(d.getHours()),\n\t pad(d.getMinutes()),\n\t pad(d.getSeconds())].join(':');\n\t return [d.getDate(), months[d.getMonth()], time].join(' ');\n\t}\n\t\n\t\n\t// log is just a thin wrapper to console.log that prepends a timestamp\n\texports.log = function() {\n\t console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n\t};\n\t\n\t\n\t/**\n\t * Inherit the prototype methods from one constructor into another.\n\t *\n\t * The Function.prototype.inherits from lang.js rewritten as a standalone\n\t * function (not on Function.prototype). NOTE: If this file is to be loaded\n\t * during bootstrapping this function needs to be rewritten using some native\n\t * functions as prototype setup using normal JavaScript does not work as\n\t * expected during bootstrapping (see mirror.js in r114903).\n\t *\n\t * @param {function} ctor Constructor function which needs to inherit the\n\t * prototype.\n\t * @param {function} superCtor Constructor function to inherit prototype from.\n\t */\n\texports.inherits = __webpack_require__(1276);\n\t\n\texports._extend = function(origin, add) {\n\t // Don't do anything if add isn't an object\n\t if (!add || !isObject(add)) return origin;\n\t\n\t var keys = Object.keys(add);\n\t var i = keys.length;\n\t while (i--) {\n\t origin[keys[i]] = add[keys[i]];\n\t }\n\t return origin;\n\t};\n\t\n\tfunction hasOwnProperty(obj, prop) {\n\t return Object.prototype.hasOwnProperty.call(obj, prop);\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(228)))\n\n/***/ }\n\n});\n\n\n/** WEBPACK FOOTER **\n ** 23.23.a37bd6c43e2b13149f99.js\n **/","import React from 'react';\nimport { Button } from 'react-bootstrap';\nimport { markdown } from 'markdown';\n\nimport UserNotification from 'util/UserNotification';\n\nimport ActionsProvider from 'injection/ActionsProvider';\nconst ConfigurationBundlesActions = ActionsProvider.getActions('ConfigurationBundles');\n\nconst ConfigurationBundlePreview = React.createClass({\n propTypes: {\n sourceTypeId: React.PropTypes.string,\n sourceTypeDescription: React.PropTypes.string,\n onDelete: React.PropTypes.func.isRequired,\n },\n\n _confirmDeletion() {\n if (window.confirm('You are about to delete this content pack, are you sure?')) {\n ConfigurationBundlesActions.delete(this.props.sourceTypeId).then(() => {\n UserNotification.success('Bundle deleted successfully.', 'Success');\n this.props.onDelete();\n }, () => {\n UserNotification.error('Deleting bundle failed, please check your logs for more information.', 'Error');\n });\n }\n },\n _onApply() {\n ConfigurationBundlesActions.apply(this.props.sourceTypeId).then(() => {\n UserNotification.success('Bundle applied successfully.', 'Success');\n }, () => {\n UserNotification.error('Applying bundle failed, please check your logs for more information.', 'Error');\n });\n },\n render() {\n let preview = 'Select a content pack from the list to see its preview.';\n let applyAction = '';\n let deleteAction = '';\n\n if (this.props.sourceTypeDescription) {\n preview = this.props.sourceTypeDescription;\n applyAction = ;\n deleteAction = ;\n }\n\n const markdownPreview = markdown.toHTML(preview);\n\n return (\n
    \n
    \n {deleteAction}\n

    Content pack description:

    \n
    \n
    \n
    \n {applyAction}\n
    \n
    \n );\n },\n});\n\nexport default ConfigurationBundlePreview;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/source-tagging/ConfigurationBundlePreview.jsx\n **/","import React from 'react';\nimport Reflux from 'reflux';\nimport { Accordion, Panel, Row, Col } from 'react-bootstrap';\nimport $ from 'jquery';\n\nimport UserNotification from 'util/UserNotification';\n\nimport ActionsProvider from 'injection/ActionsProvider';\nconst ConfigurationBundlesActions = ActionsProvider.getActions('ConfigurationBundles');\n\nimport StoreProvider from 'injection/StoreProvider';\nconst ConfigurationBundlesStore = StoreProvider.getStore('ConfigurationBundles');\n\nimport SourceType from './SourceType';\nimport ConfigurationBundlePreview from './ConfigurationBundlePreview';\nimport Spinner from 'components/common/Spinner';\n\nconst ConfigurationBundles = React.createClass({\n mixins: [Reflux.connect(ConfigurationBundlesStore)],\n\n getInitialState() {\n return {\n sourceTypeId: '',\n sourceTypeDescription: '',\n };\n },\n componentDidMount() {\n ConfigurationBundlesActions.list();\n },\n _getCategoriesHtml() {\n const categories = $.map(this.state.configurationBundles, (bundles, category) => category);\n categories.sort();\n return categories.map((category, idx) => this._getSourceTypeHtml(category, idx), this);\n },\n _getSourceTypeHtml(category, idx) {\n const bundles = this._getSortedBundles(category);\n const bundlesJsx = bundles.map((bundle) => {\n return (\n
  • \n \n
  • \n );\n }, this);\n\n return (\n \n
      \n {bundlesJsx}\n
    \n
    \n );\n },\n _getSortedBundles(category) {\n const bundles = this.state.configurationBundles[category];\n bundles.sort((bundle1, bundle2) => {\n if (bundle1.name > bundle2.name) {\n return 1;\n }\n if (bundle1.name < bundle2.name) {\n return -1;\n }\n return 0;\n });\n return bundles;\n },\n onSubmit(submitEvent) {\n submitEvent.preventDefault();\n if (!this.refs.uploadedFile.files || !this.refs.uploadedFile.files[0]) {\n return;\n }\n\n const reader = new FileReader();\n\n reader.onload = (evt) => {\n const request = evt.target.result;\n ConfigurationBundlesActions.create.triggerPromise(request)\n .then(\n () => {\n UserNotification.success('Content pack imported successfully', 'Success!');\n ConfigurationBundlesActions.list();\n },\n () => {\n UserNotification.error('Error importing content pack, please ensure it is a valid JSON file. Check your ' +\n 'Graylog logs for more information.', 'Could not import content pack');\n });\n };\n\n reader.readAsText(this.refs.uploadedFile.files[0]);\n },\n handleSourceTypeChange(sourceTypeId, sourceTypeDescription) {\n this.setState({sourceTypeId: sourceTypeId, sourceTypeDescription: sourceTypeDescription});\n },\n _resetSelection() {\n this.setState(this.getInitialState());\n },\n render() {\n return (\n \n \n {this.state.configurationBundles ?\n \n {this._getCategoriesHtml()}\n \n
    \n Remember to apply the content pack after uploading it, to make the changes effective.\n
    \n \n
    \n \n
    \n
    \n
    \n :\n \n }\n \n \n \n \n
    \n );\n },\n});\n\nexport default ConfigurationBundles;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/source-tagging/ConfigurationBundles.jsx\n **/","'use strict';\n\nvar React = require('react');\n\nvar SourceType = React.createClass({\n _onChange(event) {\n this.props.onSelect(event.target.id, event.target.value);\n },\n render() {\n return (\n \n );\n }\n});\n\nmodule.exports = SourceType;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/source-tagging/SourceType.jsx\n **/","import React from 'react';\nimport { Row, Col, Button } from 'react-bootstrap';\nimport { LinkContainer } from 'react-router-bootstrap';\n\nimport Routes from 'routing/Routes';\n\nimport PageHeader from 'components/common/PageHeader';\nimport ConfigurationBundles from 'components/source-tagging/ConfigurationBundles';\n\nconst ContentPacksPage = React.createClass({\n render() {\n\n return (\n \n \n \n Content packs accelerate the set up process for a specific data source. A content pack can include inputs/extractors, streams, and dashboards.\n \n\n \n Find more content packs in {' '}\n the Graylog Marketplace.\n \n\n \n \n \n \n\n \n \n\n

    Select content packs

    \n
    \n \n
    \n \n
    \n
    \n );\n }\n});\n\nexport default ContentPacksPage;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/pages/ContentPacksPage.jsx\n **/","// super simple module for the most common nodejs use case.\nexports.markdown = require(\"./markdown\");\nexports.parse = exports.markdown.toHTML;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/markdown/lib/index.js\n ** module id = 1187\n ** module chunks = 23\n **/","// Released under MIT license\n// Copyright (c) 2009-2010 Dominic Baggott\n// Copyright (c) 2009-2010 Ash Berlin\n// Copyright (c) 2011 Christoph Dorn (http://www.christophdorn.com)\n\n/*jshint browser:true, devel:true */\n\n(function( expose ) {\n\n/**\n * class Markdown\n *\n * Markdown processing in Javascript done right. We have very particular views\n * on what constitutes 'right' which include:\n *\n * - produces well-formed HTML (this means that em and strong nesting is\n * important)\n *\n * - has an intermediate representation to allow processing of parsed data (We\n * in fact have two, both as [JsonML]: a markdown tree and an HTML tree).\n *\n * - is easily extensible to add new dialects without having to rewrite the\n * entire parsing mechanics\n *\n * - has a good test suite\n *\n * This implementation fulfills all of these (except that the test suite could\n * do with expanding to automatically run all the fixtures from other Markdown\n * implementations.)\n *\n * ##### Intermediate Representation\n *\n * *TODO* Talk about this :) Its JsonML, but document the node names we use.\n *\n * [JsonML]: http://jsonml.org/ \"JSON Markup Language\"\n **/\nvar Markdown = expose.Markdown = function(dialect) {\n switch (typeof dialect) {\n case \"undefined\":\n this.dialect = Markdown.dialects.Gruber;\n break;\n case \"object\":\n this.dialect = dialect;\n break;\n default:\n if ( dialect in Markdown.dialects ) {\n this.dialect = Markdown.dialects[dialect];\n }\n else {\n throw new Error(\"Unknown Markdown dialect '\" + String(dialect) + \"'\");\n }\n break;\n }\n this.em_state = [];\n this.strong_state = [];\n this.debug_indent = \"\";\n};\n\n/**\n * parse( markdown, [dialect] ) -> JsonML\n * - markdown (String): markdown string to parse\n * - dialect (String | Dialect): the dialect to use, defaults to gruber\n *\n * Parse `markdown` and return a markdown document as a Markdown.JsonML tree.\n **/\nexpose.parse = function( source, dialect ) {\n // dialect will default if undefined\n var md = new Markdown( dialect );\n return md.toTree( source );\n};\n\n/**\n * toHTML( markdown, [dialect] ) -> String\n * toHTML( md_tree ) -> String\n * - markdown (String): markdown string to parse\n * - md_tree (Markdown.JsonML): parsed markdown tree\n *\n * Take markdown (either as a string or as a JsonML tree) and run it through\n * [[toHTMLTree]] then turn it into a well-formated HTML fragment.\n **/\nexpose.toHTML = function toHTML( source , dialect , options ) {\n var input = expose.toHTMLTree( source , dialect , options );\n\n return expose.renderJsonML( input );\n};\n\n/**\n * toHTMLTree( markdown, [dialect] ) -> JsonML\n * toHTMLTree( md_tree ) -> JsonML\n * - markdown (String): markdown string to parse\n * - dialect (String | Dialect): the dialect to use, defaults to gruber\n * - md_tree (Markdown.JsonML): parsed markdown tree\n *\n * Turn markdown into HTML, represented as a JsonML tree. If a string is given\n * to this function, it is first parsed into a markdown tree by calling\n * [[parse]].\n **/\nexpose.toHTMLTree = function toHTMLTree( input, dialect , options ) {\n // convert string input to an MD tree\n if ( typeof input ===\"string\" ) input = this.parse( input, dialect );\n\n // Now convert the MD tree to an HTML tree\n\n // remove references from the tree\n var attrs = extract_attr( input ),\n refs = {};\n\n if ( attrs && attrs.references ) {\n refs = attrs.references;\n }\n\n var html = convert_tree_to_html( input, refs , options );\n merge_text_nodes( html );\n return html;\n};\n\n// For Spidermonkey based engines\nfunction mk_block_toSource() {\n return \"Markdown.mk_block( \" +\n uneval(this.toString()) +\n \", \" +\n uneval(this.trailing) +\n \", \" +\n uneval(this.lineNumber) +\n \" )\";\n}\n\n// node\nfunction mk_block_inspect() {\n var util = require(\"util\");\n return \"Markdown.mk_block( \" +\n util.inspect(this.toString()) +\n \", \" +\n util.inspect(this.trailing) +\n \", \" +\n util.inspect(this.lineNumber) +\n \" )\";\n\n}\n\nvar mk_block = Markdown.mk_block = function(block, trail, line) {\n // Be helpful for default case in tests.\n if ( arguments.length == 1 ) trail = \"\\n\\n\";\n\n var s = new String(block);\n s.trailing = trail;\n // To make it clear its not just a string\n s.inspect = mk_block_inspect;\n s.toSource = mk_block_toSource;\n\n if ( line != undefined )\n s.lineNumber = line;\n\n return s;\n};\n\nfunction count_lines( str ) {\n var n = 0, i = -1;\n while ( ( i = str.indexOf(\"\\n\", i + 1) ) !== -1 ) n++;\n return n;\n}\n\n// Internal - split source into rough blocks\nMarkdown.prototype.split_blocks = function splitBlocks( input, startLine ) {\n input = input.replace(/(\\r\\n|\\n|\\r)/g, \"\\n\");\n // [\\s\\S] matches _anything_ (newline or space)\n // [^] is equivalent but doesn't work in IEs.\n var re = /([\\s\\S]+?)($|\\n#|\\n(?:\\s*\\n|$)+)/g,\n blocks = [],\n m;\n\n var line_no = 1;\n\n if ( ( m = /^(\\s*\\n)/.exec(input) ) != null ) {\n // skip (but count) leading blank lines\n line_no += count_lines( m[0] );\n re.lastIndex = m[0].length;\n }\n\n while ( ( m = re.exec(input) ) !== null ) {\n if (m[2] == \"\\n#\") {\n m[2] = \"\\n\";\n re.lastIndex--;\n }\n blocks.push( mk_block( m[1], m[2], line_no ) );\n line_no += count_lines( m[0] );\n }\n\n return blocks;\n};\n\n/**\n * Markdown#processBlock( block, next ) -> undefined | [ JsonML, ... ]\n * - block (String): the block to process\n * - next (Array): the following blocks\n *\n * Process `block` and return an array of JsonML nodes representing `block`.\n *\n * It does this by asking each block level function in the dialect to process\n * the block until one can. Succesful handling is indicated by returning an\n * array (with zero or more JsonML nodes), failure by a false value.\n *\n * Blocks handlers are responsible for calling [[Markdown#processInline]]\n * themselves as appropriate.\n *\n * If the blocks were split incorrectly or adjacent blocks need collapsing you\n * can adjust `next` in place using shift/splice etc.\n *\n * If any of this default behaviour is not right for the dialect, you can\n * define a `__call__` method on the dialect that will get invoked to handle\n * the block processing.\n */\nMarkdown.prototype.processBlock = function processBlock( block, next ) {\n var cbs = this.dialect.block,\n ord = cbs.__order__;\n\n if ( \"__call__\" in cbs ) {\n return cbs.__call__.call(this, block, next);\n }\n\n for ( var i = 0; i < ord.length; i++ ) {\n //D:this.debug( \"Testing\", ord[i] );\n var res = cbs[ ord[i] ].call( this, block, next );\n if ( res ) {\n //D:this.debug(\" matched\");\n if ( !isArray(res) || ( res.length > 0 && !( isArray(res[0]) ) ) )\n this.debug(ord[i], \"didn't return a proper array\");\n //D:this.debug( \"\" );\n return res;\n }\n }\n\n // Uhoh! no match! Should we throw an error?\n return [];\n};\n\nMarkdown.prototype.processInline = function processInline( block ) {\n return this.dialect.inline.__call__.call( this, String( block ) );\n};\n\n/**\n * Markdown#toTree( source ) -> JsonML\n * - source (String): markdown source to parse\n *\n * Parse `source` into a JsonML tree representing the markdown document.\n **/\n// custom_tree means set this.tree to `custom_tree` and restore old value on return\nMarkdown.prototype.toTree = function toTree( source, custom_root ) {\n var blocks = source instanceof Array ? source : this.split_blocks( source );\n\n // Make tree a member variable so its easier to mess with in extensions\n var old_tree = this.tree;\n try {\n this.tree = custom_root || this.tree || [ \"markdown\" ];\n\n blocks:\n while ( blocks.length ) {\n var b = this.processBlock( blocks.shift(), blocks );\n\n // Reference blocks and the like won't return any content\n if ( !b.length ) continue blocks;\n\n this.tree.push.apply( this.tree, b );\n }\n return this.tree;\n }\n finally {\n if ( custom_root ) {\n this.tree = old_tree;\n }\n }\n};\n\n// Noop by default\nMarkdown.prototype.debug = function () {\n var args = Array.prototype.slice.call( arguments);\n args.unshift(this.debug_indent);\n if ( typeof print !== \"undefined\" )\n print.apply( print, args );\n if ( typeof console !== \"undefined\" && typeof console.log !== \"undefined\" )\n console.log.apply( null, args );\n}\n\nMarkdown.prototype.loop_re_over_block = function( re, block, cb ) {\n // Dont use /g regexps with this\n var m,\n b = block.valueOf();\n\n while ( b.length && (m = re.exec(b) ) != null ) {\n b = b.substr( m[0].length );\n cb.call(this, m);\n }\n return b;\n};\n\n/**\n * Markdown.dialects\n *\n * Namespace of built-in dialects.\n **/\nMarkdown.dialects = {};\n\n/**\n * Markdown.dialects.Gruber\n *\n * The default dialect that follows the rules set out by John Gruber's\n * markdown.pl as closely as possible. Well actually we follow the behaviour of\n * that script which in some places is not exactly what the syntax web page\n * says.\n **/\nMarkdown.dialects.Gruber = {\n block: {\n atxHeader: function atxHeader( block, next ) {\n var m = block.match( /^(#{1,6})\\s*(.*?)\\s*#*\\s*(?:\\n|$)/ );\n\n if ( !m ) return undefined;\n\n var header = [ \"header\", { level: m[ 1 ].length } ];\n Array.prototype.push.apply(header, this.processInline(m[ 2 ]));\n\n if ( m[0].length < block.length )\n next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) );\n\n return [ header ];\n },\n\n setextHeader: function setextHeader( block, next ) {\n var m = block.match( /^(.*)\\n([-=])\\2\\2+(?:\\n|$)/ );\n\n if ( !m ) return undefined;\n\n var level = ( m[ 2 ] === \"=\" ) ? 1 : 2;\n var header = [ \"header\", { level : level }, m[ 1 ] ];\n\n if ( m[0].length < block.length )\n next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) );\n\n return [ header ];\n },\n\n code: function code( block, next ) {\n // | Foo\n // |bar\n // should be a code block followed by a paragraph. Fun\n //\n // There might also be adjacent code block to merge.\n\n var ret = [],\n re = /^(?: {0,3}\\t| {4})(.*)\\n?/,\n lines;\n\n // 4 spaces + content\n if ( !block.match( re ) ) return undefined;\n\n block_search:\n do {\n // Now pull out the rest of the lines\n var b = this.loop_re_over_block(\n re, block.valueOf(), function( m ) { ret.push( m[1] ); } );\n\n if ( b.length ) {\n // Case alluded to in first comment. push it back on as a new block\n next.unshift( mk_block(b, block.trailing) );\n break block_search;\n }\n else if ( next.length ) {\n // Check the next block - it might be code too\n if ( !next[0].match( re ) ) break block_search;\n\n // Pull how how many blanks lines follow - minus two to account for .join\n ret.push ( block.trailing.replace(/[^\\n]/g, \"\").substring(2) );\n\n block = next.shift();\n }\n else {\n break block_search;\n }\n } while ( true );\n\n return [ [ \"code_block\", ret.join(\"\\n\") ] ];\n },\n\n horizRule: function horizRule( block, next ) {\n // this needs to find any hr in the block to handle abutting blocks\n var m = block.match( /^(?:([\\s\\S]*?)\\n)?[ \\t]*([-_*])(?:[ \\t]*\\2){2,}[ \\t]*(?:\\n([\\s\\S]*))?$/ );\n\n if ( !m ) {\n return undefined;\n }\n\n var jsonml = [ [ \"hr\" ] ];\n\n // if there's a leading abutting block, process it\n if ( m[ 1 ] ) {\n jsonml.unshift.apply( jsonml, this.processBlock( m[ 1 ], [] ) );\n }\n\n // if there's a trailing abutting block, stick it into next\n if ( m[ 3 ] ) {\n next.unshift( mk_block( m[ 3 ] ) );\n }\n\n return jsonml;\n },\n\n // There are two types of lists. Tight and loose. Tight lists have no whitespace\n // between the items (and result in text just in the
  • ) and loose lists,\n // which have an empty line between list items, resulting in (one or more)\n // paragraphs inside the
  • .\n //\n // There are all sorts weird edge cases about the original markdown.pl's\n // handling of lists:\n //\n // * Nested lists are supposed to be indented by four chars per level. But\n // if they aren't, you can get a nested list by indenting by less than\n // four so long as the indent doesn't match an indent of an existing list\n // item in the 'nest stack'.\n //\n // * The type of the list (bullet or number) is controlled just by the\n // first item at the indent. Subsequent changes are ignored unless they\n // are for nested lists\n //\n lists: (function( ) {\n // Use a closure to hide a few variables.\n var any_list = \"[*+-]|\\\\d+\\\\.\",\n bullet_list = /[*+-]/,\n number_list = /\\d+\\./,\n // Capture leading indent as it matters for determining nested lists.\n is_list_re = new RegExp( \"^( {0,3})(\" + any_list + \")[ \\t]+\" ),\n indent_re = \"(?: {0,3}\\\\t| {4})\";\n\n // TODO: Cache this regexp for certain depths.\n // Create a regexp suitable for matching an li for a given stack depth\n function regex_for_depth( depth ) {\n\n return new RegExp(\n // m[1] = indent, m[2] = list_type\n \"(?:^(\" + indent_re + \"{0,\" + depth + \"} {0,3})(\" + any_list + \")\\\\s+)|\" +\n // m[3] = cont\n \"(^\" + indent_re + \"{0,\" + (depth-1) + \"}[ ]{0,4})\"\n );\n }\n function expand_tab( input ) {\n return input.replace( / {0,3}\\t/g, \" \" );\n }\n\n // Add inline content `inline` to `li`. inline comes from processInline\n // so is an array of content\n function add(li, loose, inline, nl) {\n if ( loose ) {\n li.push( [ \"para\" ].concat(inline) );\n return;\n }\n // Hmmm, should this be any block level element or just paras?\n var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] == \"para\"\n ? li[li.length -1]\n : li;\n\n // If there is already some content in this list, add the new line in\n if ( nl && li.length > 1 ) inline.unshift(nl);\n\n for ( var i = 0; i < inline.length; i++ ) {\n var what = inline[i],\n is_str = typeof what == \"string\";\n if ( is_str && add_to.length > 1 && typeof add_to[add_to.length-1] == \"string\" ) {\n add_to[ add_to.length-1 ] += what;\n }\n else {\n add_to.push( what );\n }\n }\n }\n\n // contained means have an indent greater than the current one. On\n // *every* line in the block\n function get_contained_blocks( depth, blocks ) {\n\n var re = new RegExp( \"^(\" + indent_re + \"{\" + depth + \"}.*?\\\\n?)*$\" ),\n replace = new RegExp(\"^\" + indent_re + \"{\" + depth + \"}\", \"gm\"),\n ret = [];\n\n while ( blocks.length > 0 ) {\n if ( re.exec( blocks[0] ) ) {\n var b = blocks.shift(),\n // Now remove that indent\n x = b.replace( replace, \"\");\n\n ret.push( mk_block( x, b.trailing, b.lineNumber ) );\n }\n else {\n break;\n }\n }\n return ret;\n }\n\n // passed to stack.forEach to turn list items up the stack into paras\n function paragraphify(s, i, stack) {\n var list = s.list;\n var last_li = list[list.length-1];\n\n if ( last_li[1] instanceof Array && last_li[1][0] == \"para\" ) {\n return;\n }\n if ( i + 1 == stack.length ) {\n // Last stack frame\n // Keep the same array, but replace the contents\n last_li.push( [\"para\"].concat( last_li.splice(1, last_li.length - 1) ) );\n }\n else {\n var sublist = last_li.pop();\n last_li.push( [\"para\"].concat( last_li.splice(1, last_li.length - 1) ), sublist );\n }\n }\n\n // The matcher function\n return function( block, next ) {\n var m = block.match( is_list_re );\n if ( !m ) return undefined;\n\n function make_list( m ) {\n var list = bullet_list.exec( m[2] )\n ? [\"bulletlist\"]\n : [\"numberlist\"];\n\n stack.push( { list: list, indent: m[1] } );\n return list;\n }\n\n\n var stack = [], // Stack of lists for nesting.\n list = make_list( m ),\n last_li,\n loose = false,\n ret = [ stack[0].list ],\n i;\n\n // Loop to search over block looking for inner block elements and loose lists\n loose_search:\n while ( true ) {\n // Split into lines preserving new lines at end of line\n var lines = block.split( /(?=\\n)/ );\n\n // We have to grab all lines for a li and call processInline on them\n // once as there are some inline things that can span lines.\n var li_accumulate = \"\";\n\n // Loop over the lines in this block looking for tight lists.\n tight_search:\n for ( var line_no = 0; line_no < lines.length; line_no++ ) {\n var nl = \"\",\n l = lines[line_no].replace(/^\\n/, function(n) { nl = n; return \"\"; });\n\n // TODO: really should cache this\n var line_re = regex_for_depth( stack.length );\n\n m = l.match( line_re );\n //print( \"line:\", uneval(l), \"\\nline match:\", uneval(m) );\n\n // We have a list item\n if ( m[1] !== undefined ) {\n // Process the previous list item, if any\n if ( li_accumulate.length ) {\n add( last_li, loose, this.processInline( li_accumulate ), nl );\n // Loose mode will have been dealt with. Reset it\n loose = false;\n li_accumulate = \"\";\n }\n\n m[1] = expand_tab( m[1] );\n var wanted_depth = Math.floor(m[1].length/4)+1;\n //print( \"want:\", wanted_depth, \"stack:\", stack.length);\n if ( wanted_depth > stack.length ) {\n // Deep enough for a nested list outright\n //print ( \"new nested list\" );\n list = make_list( m );\n last_li.push( list );\n last_li = list[1] = [ \"listitem\" ];\n }\n else {\n // We aren't deep enough to be strictly a new level. This is\n // where Md.pl goes nuts. If the indent matches a level in the\n // stack, put it there, else put it one deeper then the\n // wanted_depth deserves.\n var found = false;\n for ( i = 0; i < stack.length; i++ ) {\n if ( stack[ i ].indent != m[1] ) continue;\n list = stack[ i ].list;\n stack.splice( i+1, stack.length - (i+1) );\n found = true;\n break;\n }\n\n if (!found) {\n //print(\"not found. l:\", uneval(l));\n wanted_depth++;\n if ( wanted_depth <= stack.length ) {\n stack.splice(wanted_depth, stack.length - wanted_depth);\n //print(\"Desired depth now\", wanted_depth, \"stack:\", stack.length);\n list = stack[wanted_depth-1].list;\n //print(\"list:\", uneval(list) );\n }\n else {\n //print (\"made new stack for messy indent\");\n list = make_list(m);\n last_li.push(list);\n }\n }\n\n //print( uneval(list), \"last\", list === stack[stack.length-1].list );\n last_li = [ \"listitem\" ];\n list.push(last_li);\n } // end depth of shenegains\n nl = \"\";\n }\n\n // Add content\n if ( l.length > m[0].length ) {\n li_accumulate += nl + l.substr( m[0].length );\n }\n } // tight_search\n\n if ( li_accumulate.length ) {\n add( last_li, loose, this.processInline( li_accumulate ), nl );\n // Loose mode will have been dealt with. Reset it\n loose = false;\n li_accumulate = \"\";\n }\n\n // Look at the next block - we might have a loose list. Or an extra\n // paragraph for the current li\n var contained = get_contained_blocks( stack.length, next );\n\n // Deal with code blocks or properly nested lists\n if ( contained.length > 0 ) {\n // Make sure all listitems up the stack are paragraphs\n forEach( stack, paragraphify, this);\n\n last_li.push.apply( last_li, this.toTree( contained, [] ) );\n }\n\n var next_block = next[0] && next[0].valueOf() || \"\";\n\n if ( next_block.match(is_list_re) || next_block.match( /^ / ) ) {\n block = next.shift();\n\n // Check for an HR following a list: features/lists/hr_abutting\n var hr = this.dialect.block.horizRule( block, next );\n\n if ( hr ) {\n ret.push.apply(ret, hr);\n break;\n }\n\n // Make sure all listitems up the stack are paragraphs\n forEach( stack, paragraphify, this);\n\n loose = true;\n continue loose_search;\n }\n break;\n } // loose_search\n\n return ret;\n };\n })(),\n\n blockquote: function blockquote( block, next ) {\n if ( !block.match( /^>/m ) )\n return undefined;\n\n var jsonml = [];\n\n // separate out the leading abutting block, if any. I.e. in this case:\n //\n // a\n // > b\n //\n if ( block[ 0 ] != \">\" ) {\n var lines = block.split( /\\n/ ),\n prev = [],\n line_no = block.lineNumber;\n\n // keep shifting lines until you find a crotchet\n while ( lines.length && lines[ 0 ][ 0 ] != \">\" ) {\n prev.push( lines.shift() );\n line_no++;\n }\n\n var abutting = mk_block( prev.join( \"\\n\" ), \"\\n\", block.lineNumber );\n jsonml.push.apply( jsonml, this.processBlock( abutting, [] ) );\n // reassemble new block of just block quotes!\n block = mk_block( lines.join( \"\\n\" ), block.trailing, line_no );\n }\n\n\n // if the next block is also a blockquote merge it in\n while ( next.length && next[ 0 ][ 0 ] == \">\" ) {\n var b = next.shift();\n block = mk_block( block + block.trailing + b, b.trailing, block.lineNumber );\n }\n\n // Strip off the leading \"> \" and re-process as a block.\n var input = block.replace( /^> ?/gm, \"\" ),\n old_tree = this.tree,\n processedBlock = this.toTree( input, [ \"blockquote\" ] ),\n attr = extract_attr( processedBlock );\n\n // If any link references were found get rid of them\n if ( attr && attr.references ) {\n delete attr.references;\n // And then remove the attribute object if it's empty\n if ( isEmpty( attr ) ) {\n processedBlock.splice( 1, 1 );\n }\n }\n\n jsonml.push( processedBlock );\n return jsonml;\n },\n\n referenceDefn: function referenceDefn( block, next) {\n var re = /^\\s*\\[(.*?)\\]:\\s*(\\S+)(?:\\s+(?:(['\"])(.*?)\\3|\\((.*?)\\)))?\\n?/;\n // interesting matches are [ , ref_id, url, , title, title ]\n\n if ( !block.match(re) )\n return undefined;\n\n // make an attribute node if it doesn't exist\n if ( !extract_attr( this.tree ) ) {\n this.tree.splice( 1, 0, {} );\n }\n\n var attrs = extract_attr( this.tree );\n\n // make a references hash if it doesn't exist\n if ( attrs.references === undefined ) {\n attrs.references = {};\n }\n\n var b = this.loop_re_over_block(re, block, function( m ) {\n\n if ( m[2] && m[2][0] == \"<\" && m[2][m[2].length-1] == \">\" )\n m[2] = m[2].substring( 1, m[2].length - 1 );\n\n var ref = attrs.references[ m[1].toLowerCase() ] = {\n href: m[2]\n };\n\n if ( m[4] !== undefined )\n ref.title = m[4];\n else if ( m[5] !== undefined )\n ref.title = m[5];\n\n } );\n\n if ( b.length )\n next.unshift( mk_block( b, block.trailing ) );\n\n return [];\n },\n\n para: function para( block, next ) {\n // everything's a para!\n return [ [\"para\"].concat( this.processInline( block ) ) ];\n }\n }\n};\n\nMarkdown.dialects.Gruber.inline = {\n\n __oneElement__: function oneElement( text, patterns_or_re, previous_nodes ) {\n var m,\n res,\n lastIndex = 0;\n\n patterns_or_re = patterns_or_re || this.dialect.inline.__patterns__;\n var re = new RegExp( \"([\\\\s\\\\S]*?)(\" + (patterns_or_re.source || patterns_or_re) + \")\" );\n\n m = re.exec( text );\n if (!m) {\n // Just boring text\n return [ text.length, text ];\n }\n else if ( m[1] ) {\n // Some un-interesting text matched. Return that first\n return [ m[1].length, m[1] ];\n }\n\n var res;\n if ( m[2] in this.dialect.inline ) {\n res = this.dialect.inline[ m[2] ].call(\n this,\n text.substr( m.index ), m, previous_nodes || [] );\n }\n // Default for now to make dev easier. just slurp special and output it.\n res = res || [ m[2].length, m[2] ];\n return res;\n },\n\n __call__: function inline( text, patterns ) {\n\n var out = [],\n res;\n\n function add(x) {\n //D:self.debug(\" adding output\", uneval(x));\n if ( typeof x == \"string\" && typeof out[out.length-1] == \"string\" )\n out[ out.length-1 ] += x;\n else\n out.push(x);\n }\n\n while ( text.length > 0 ) {\n res = this.dialect.inline.__oneElement__.call(this, text, patterns, out );\n text = text.substr( res.shift() );\n forEach(res, add )\n }\n\n return out;\n },\n\n // These characters are intersting elsewhere, so have rules for them so that\n // chunks of plain text blocks don't include them\n \"]\": function () {},\n \"}\": function () {},\n\n __escape__ : /^\\\\[\\\\`\\*_{}\\[\\]()#\\+.!\\-]/,\n\n \"\\\\\": function escaped( text ) {\n // [ length of input processed, node/children to add... ]\n // Only esacape: \\ ` * _ { } [ ] ( ) # * + - . !\n if ( this.dialect.inline.__escape__.exec( text ) )\n return [ 2, text.charAt( 1 ) ];\n else\n // Not an esacpe\n return [ 1, \"\\\\\" ];\n },\n\n \"![\": function image( text ) {\n\n // Unlike images, alt text is plain text only. no other elements are\n // allowed in there\n\n // ![Alt text](/path/to/img.jpg \"Optional title\")\n // 1 2 3 4 <--- captures\n var m = text.match( /^!\\[(.*?)\\][ \\t]*\\([ \\t]*([^\")]*?)(?:[ \\t]+([\"'])(.*?)\\3)?[ \\t]*\\)/ );\n\n if ( m ) {\n if ( m[2] && m[2][0] == \"<\" && m[2][m[2].length-1] == \">\" )\n m[2] = m[2].substring( 1, m[2].length - 1 );\n\n m[2] = this.dialect.inline.__call__.call( this, m[2], /\\\\/ )[0];\n\n var attrs = { alt: m[1], href: m[2] || \"\" };\n if ( m[4] !== undefined)\n attrs.title = m[4];\n\n return [ m[0].length, [ \"img\", attrs ] ];\n }\n\n // ![Alt text][id]\n m = text.match( /^!\\[(.*?)\\][ \\t]*\\[(.*?)\\]/ );\n\n if ( m ) {\n // We can't check if the reference is known here as it likely wont be\n // found till after. Check it in md tree->hmtl tree conversion\n return [ m[0].length, [ \"img_ref\", { alt: m[1], ref: m[2].toLowerCase(), original: m[0] } ] ];\n }\n\n // Just consume the '!['\n return [ 2, \"![\" ];\n },\n\n \"[\": function link( text ) {\n\n var orig = String(text);\n // Inline content is possible inside `link text`\n var res = Markdown.DialectHelpers.inline_until_char.call( this, text.substr(1), \"]\" );\n\n // No closing ']' found. Just consume the [\n if ( !res ) return [ 1, \"[\" ];\n\n var consumed = 1 + res[ 0 ],\n children = res[ 1 ],\n link,\n attrs;\n\n // At this point the first [...] has been parsed. See what follows to find\n // out which kind of link we are (reference or direct url)\n text = text.substr( consumed );\n\n // [link text](/path/to/img.jpg \"Optional title\")\n // 1 2 3 <--- captures\n // This will capture up to the last paren in the block. We then pull\n // back based on if there a matching ones in the url\n // ([here](/url/(test))\n // The parens have to be balanced\n var m = text.match( /^\\s*\\([ \\t]*([^\"']*)(?:[ \\t]+([\"'])(.*?)\\2)?[ \\t]*\\)/ );\n if ( m ) {\n var url = m[1];\n consumed += m[0].length;\n\n if ( url && url[0] == \"<\" && url[url.length-1] == \">\" )\n url = url.substring( 1, url.length - 1 );\n\n // If there is a title we don't have to worry about parens in the url\n if ( !m[3] ) {\n var open_parens = 1; // One open that isn't in the capture\n for ( var len = 0; len < url.length; len++ ) {\n switch ( url[len] ) {\n case \"(\":\n open_parens++;\n break;\n case \")\":\n if ( --open_parens == 0) {\n consumed -= url.length - len;\n url = url.substring(0, len);\n }\n break;\n }\n }\n }\n\n // Process escapes only\n url = this.dialect.inline.__call__.call( this, url, /\\\\/ )[0];\n\n attrs = { href: url || \"\" };\n if ( m[3] !== undefined)\n attrs.title = m[3];\n\n link = [ \"link\", attrs ].concat( children );\n return [ consumed, link ];\n }\n\n // [Alt text][id]\n // [Alt text] [id]\n m = text.match( /^\\s*\\[(.*?)\\]/ );\n\n if ( m ) {\n\n consumed += m[ 0 ].length;\n\n // [links][] uses links as its reference\n attrs = { ref: ( m[ 1 ] || String(children) ).toLowerCase(), original: orig.substr( 0, consumed ) };\n\n link = [ \"link_ref\", attrs ].concat( children );\n\n // We can't check if the reference is known here as it likely wont be\n // found till after. Check it in md tree->hmtl tree conversion.\n // Store the original so that conversion can revert if the ref isn't found.\n return [ consumed, link ];\n }\n\n // [id]\n // Only if id is plain (no formatting.)\n if ( children.length == 1 && typeof children[0] == \"string\" ) {\n\n attrs = { ref: children[0].toLowerCase(), original: orig.substr( 0, consumed ) };\n link = [ \"link_ref\", attrs, children[0] ];\n return [ consumed, link ];\n }\n\n // Just consume the \"[\"\n return [ 1, \"[\" ];\n },\n\n\n \"<\": function autoLink( text ) {\n var m;\n\n if ( ( m = text.match( /^<(?:((https?|ftp|mailto):[^>]+)|(.*?@.*?\\.[a-zA-Z]+))>/ ) ) != null ) {\n if ( m[3] ) {\n return [ m[0].length, [ \"link\", { href: \"mailto:\" + m[3] }, m[3] ] ];\n\n }\n else if ( m[2] == \"mailto\" ) {\n return [ m[0].length, [ \"link\", { href: m[1] }, m[1].substr(\"mailto:\".length ) ] ];\n }\n else\n return [ m[0].length, [ \"link\", { href: m[1] }, m[1] ] ];\n }\n\n return [ 1, \"<\" ];\n },\n\n \"`\": function inlineCode( text ) {\n // Inline code block. as many backticks as you like to start it\n // Always skip over the opening ticks.\n var m = text.match( /(`+)(([\\s\\S]*?)\\1)/ );\n\n if ( m && m[2] )\n return [ m[1].length + m[2].length, [ \"inlinecode\", m[3] ] ];\n else {\n // TODO: No matching end code found - warn!\n return [ 1, \"`\" ];\n }\n },\n\n \" \\n\": function lineBreak( text ) {\n return [ 3, [ \"linebreak\" ] ];\n }\n\n};\n\n// Meta Helper/generator method for em and strong handling\nfunction strong_em( tag, md ) {\n\n var state_slot = tag + \"_state\",\n other_slot = tag == \"strong\" ? \"em_state\" : \"strong_state\";\n\n function CloseTag(len) {\n this.len_after = len;\n this.name = \"close_\" + md;\n }\n\n return function ( text, orig_match ) {\n\n if ( this[state_slot][0] == md ) {\n // Most recent em is of this type\n //D:this.debug(\"closing\", md);\n this[state_slot].shift();\n\n // \"Consume\" everything to go back to the recrusion in the else-block below\n return[ text.length, new CloseTag(text.length-md.length) ];\n }\n else {\n // Store a clone of the em/strong states\n var other = this[other_slot].slice(),\n state = this[state_slot].slice();\n\n this[state_slot].unshift(md);\n\n //D:this.debug_indent += \" \";\n\n // Recurse\n var res = this.processInline( text.substr( md.length ) );\n //D:this.debug_indent = this.debug_indent.substr(2);\n\n var last = res[res.length - 1];\n\n //D:this.debug(\"processInline from\", tag + \": \", uneval( res ) );\n\n var check = this[state_slot].shift();\n if ( last instanceof CloseTag ) {\n res.pop();\n // We matched! Huzzah.\n var consumed = text.length - last.len_after;\n return [ consumed, [ tag ].concat(res) ];\n }\n else {\n // Restore the state of the other kind. We might have mistakenly closed it.\n this[other_slot] = other;\n this[state_slot] = state;\n\n // We can't reuse the processed result as it could have wrong parsing contexts in it.\n return [ md.length, md ];\n }\n }\n }; // End returned function\n}\n\nMarkdown.dialects.Gruber.inline[\"**\"] = strong_em(\"strong\", \"**\");\nMarkdown.dialects.Gruber.inline[\"__\"] = strong_em(\"strong\", \"__\");\nMarkdown.dialects.Gruber.inline[\"*\"] = strong_em(\"em\", \"*\");\nMarkdown.dialects.Gruber.inline[\"_\"] = strong_em(\"em\", \"_\");\n\n\n// Build default order from insertion order.\nMarkdown.buildBlockOrder = function(d) {\n var ord = [];\n for ( var i in d ) {\n if ( i == \"__order__\" || i == \"__call__\" ) continue;\n ord.push( i );\n }\n d.__order__ = ord;\n};\n\n// Build patterns for inline matcher\nMarkdown.buildInlinePatterns = function(d) {\n var patterns = [];\n\n for ( var i in d ) {\n // __foo__ is reserved and not a pattern\n if ( i.match( /^__.*__$/) ) continue;\n var l = i.replace( /([\\\\.*+?|()\\[\\]{}])/g, \"\\\\$1\" )\n .replace( /\\n/, \"\\\\n\" );\n patterns.push( i.length == 1 ? l : \"(?:\" + l + \")\" );\n }\n\n patterns = patterns.join(\"|\");\n d.__patterns__ = patterns;\n //print(\"patterns:\", uneval( patterns ) );\n\n var fn = d.__call__;\n d.__call__ = function(text, pattern) {\n if ( pattern != undefined ) {\n return fn.call(this, text, pattern);\n }\n else\n {\n return fn.call(this, text, patterns);\n }\n };\n};\n\nMarkdown.DialectHelpers = {};\nMarkdown.DialectHelpers.inline_until_char = function( text, want ) {\n var consumed = 0,\n nodes = [];\n\n while ( true ) {\n if ( text.charAt( consumed ) == want ) {\n // Found the character we were looking for\n consumed++;\n return [ consumed, nodes ];\n }\n\n if ( consumed >= text.length ) {\n // No closing char found. Abort.\n return null;\n }\n\n var res = this.dialect.inline.__oneElement__.call(this, text.substr( consumed ) );\n consumed += res[ 0 ];\n // Add any returned nodes.\n nodes.push.apply( nodes, res.slice( 1 ) );\n }\n}\n\n// Helper function to make sub-classing a dialect easier\nMarkdown.subclassDialect = function( d ) {\n function Block() {}\n Block.prototype = d.block;\n function Inline() {}\n Inline.prototype = d.inline;\n\n return { block: new Block(), inline: new Inline() };\n};\n\nMarkdown.buildBlockOrder ( Markdown.dialects.Gruber.block );\nMarkdown.buildInlinePatterns( Markdown.dialects.Gruber.inline );\n\nMarkdown.dialects.Maruku = Markdown.subclassDialect( Markdown.dialects.Gruber );\n\nMarkdown.dialects.Maruku.processMetaHash = function processMetaHash( meta_string ) {\n var meta = split_meta_hash( meta_string ),\n attr = {};\n\n for ( var i = 0; i < meta.length; ++i ) {\n // id: #foo\n if ( /^#/.test( meta[ i ] ) ) {\n attr.id = meta[ i ].substring( 1 );\n }\n // class: .foo\n else if ( /^\\./.test( meta[ i ] ) ) {\n // if class already exists, append the new one\n if ( attr[\"class\"] ) {\n attr[\"class\"] = attr[\"class\"] + meta[ i ].replace( /./, \" \" );\n }\n else {\n attr[\"class\"] = meta[ i ].substring( 1 );\n }\n }\n // attribute: foo=bar\n else if ( /\\=/.test( meta[ i ] ) ) {\n var s = meta[ i ].split( /\\=/ );\n attr[ s[ 0 ] ] = s[ 1 ];\n }\n }\n\n return attr;\n}\n\nfunction split_meta_hash( meta_string ) {\n var meta = meta_string.split( \"\" ),\n parts = [ \"\" ],\n in_quotes = false;\n\n while ( meta.length ) {\n var letter = meta.shift();\n switch ( letter ) {\n case \" \" :\n // if we're in a quoted section, keep it\n if ( in_quotes ) {\n parts[ parts.length - 1 ] += letter;\n }\n // otherwise make a new part\n else {\n parts.push( \"\" );\n }\n break;\n case \"'\" :\n case '\"' :\n // reverse the quotes and move straight on\n in_quotes = !in_quotes;\n break;\n case \"\\\\\" :\n // shift off the next letter to be used straight away.\n // it was escaped so we'll keep it whatever it is\n letter = meta.shift();\n default :\n parts[ parts.length - 1 ] += letter;\n break;\n }\n }\n\n return parts;\n}\n\nMarkdown.dialects.Maruku.block.document_meta = function document_meta( block, next ) {\n // we're only interested in the first block\n if ( block.lineNumber > 1 ) return undefined;\n\n // document_meta blocks consist of one or more lines of `Key: Value\\n`\n if ( ! block.match( /^(?:\\w+:.*\\n)*\\w+:.*$/ ) ) return undefined;\n\n // make an attribute node if it doesn't exist\n if ( !extract_attr( this.tree ) ) {\n this.tree.splice( 1, 0, {} );\n }\n\n var pairs = block.split( /\\n/ );\n for ( p in pairs ) {\n var m = pairs[ p ].match( /(\\w+):\\s*(.*)$/ ),\n key = m[ 1 ].toLowerCase(),\n value = m[ 2 ];\n\n this.tree[ 1 ][ key ] = value;\n }\n\n // document_meta produces no content!\n return [];\n};\n\nMarkdown.dialects.Maruku.block.block_meta = function block_meta( block, next ) {\n // check if the last line of the block is an meta hash\n var m = block.match( /(^|\\n) {0,3}\\{:\\s*((?:\\\\\\}|[^\\}])*)\\s*\\}$/ );\n if ( !m ) return undefined;\n\n // process the meta hash\n var attr = this.dialect.processMetaHash( m[ 2 ] );\n\n var hash;\n\n // if we matched ^ then we need to apply meta to the previous block\n if ( m[ 1 ] === \"\" ) {\n var node = this.tree[ this.tree.length - 1 ];\n hash = extract_attr( node );\n\n // if the node is a string (rather than JsonML), bail\n if ( typeof node === \"string\" ) return undefined;\n\n // create the attribute hash if it doesn't exist\n if ( !hash ) {\n hash = {};\n node.splice( 1, 0, hash );\n }\n\n // add the attributes in\n for ( a in attr ) {\n hash[ a ] = attr[ a ];\n }\n\n // return nothing so the meta hash is removed\n return [];\n }\n\n // pull the meta hash off the block and process what's left\n var b = block.replace( /\\n.*$/, \"\" ),\n result = this.processBlock( b, [] );\n\n // get or make the attributes hash\n hash = extract_attr( result[ 0 ] );\n if ( !hash ) {\n hash = {};\n result[ 0 ].splice( 1, 0, hash );\n }\n\n // attach the attributes to the block\n for ( a in attr ) {\n hash[ a ] = attr[ a ];\n }\n\n return result;\n};\n\nMarkdown.dialects.Maruku.block.definition_list = function definition_list( block, next ) {\n // one or more terms followed by one or more definitions, in a single block\n var tight = /^((?:[^\\s:].*\\n)+):\\s+([\\s\\S]+)$/,\n list = [ \"dl\" ],\n i, m;\n\n // see if we're dealing with a tight or loose block\n if ( ( m = block.match( tight ) ) ) {\n // pull subsequent tight DL blocks out of `next`\n var blocks = [ block ];\n while ( next.length && tight.exec( next[ 0 ] ) ) {\n blocks.push( next.shift() );\n }\n\n for ( var b = 0; b < blocks.length; ++b ) {\n var m = blocks[ b ].match( tight ),\n terms = m[ 1 ].replace( /\\n$/, \"\" ).split( /\\n/ ),\n defns = m[ 2 ].split( /\\n:\\s+/ );\n\n // print( uneval( m ) );\n\n for ( i = 0; i < terms.length; ++i ) {\n list.push( [ \"dt\", terms[ i ] ] );\n }\n\n for ( i = 0; i < defns.length; ++i ) {\n // run inline processing over the definition\n list.push( [ \"dd\" ].concat( this.processInline( defns[ i ].replace( /(\\n)\\s+/, \"$1\" ) ) ) );\n }\n }\n }\n else {\n return undefined;\n }\n\n return [ list ];\n};\n\n// splits on unescaped instances of @ch. If @ch is not a character the result\n// can be unpredictable\n\nMarkdown.dialects.Maruku.block.table = function table (block, next) {\n\n var _split_on_unescaped = function(s, ch) {\n ch = ch || '\\\\s';\n if (ch.match(/^[\\\\|\\[\\]{}?*.+^$]$/)) { ch = '\\\\' + ch; }\n var res = [ ],\n r = new RegExp('^((?:\\\\\\\\.|[^\\\\\\\\' + ch + '])*)' + ch + '(.*)'),\n m;\n while(m = s.match(r)) {\n res.push(m[1]);\n s = m[2];\n }\n res.push(s);\n return res;\n }\n\n var leading_pipe = /^ {0,3}\\|(.+)\\n {0,3}\\|\\s*([\\-:]+[\\-| :]*)\\n((?:\\s*\\|.*(?:\\n|$))*)(?=\\n|$)/,\n // find at least an unescaped pipe in each line\n no_leading_pipe = /^ {0,3}(\\S(?:\\\\.|[^\\\\|])*\\|.*)\\n {0,3}([\\-:]+\\s*\\|[\\-| :]*)\\n((?:(?:\\\\.|[^\\\\|])*\\|.*(?:\\n|$))*)(?=\\n|$)/,\n i, m;\n if (m = block.match(leading_pipe)) {\n // remove leading pipes in contents\n // (header and horizontal rule already have the leading pipe left out)\n m[3] = m[3].replace(/^\\s*\\|/gm, '');\n } else if (! ( m = block.match(no_leading_pipe))) {\n return undefined;\n }\n\n var table = [ \"table\", [ \"thead\", [ \"tr\" ] ], [ \"tbody\" ] ];\n\n // remove trailing pipes, then split on pipes\n // (no escaped pipes are allowed in horizontal rule)\n m[2] = m[2].replace(/\\|\\s*$/, '').split('|');\n\n // process alignment\n var html_attrs = [ ];\n forEach (m[2], function (s) {\n if (s.match(/^\\s*-+:\\s*$/)) html_attrs.push({align: \"right\"});\n else if (s.match(/^\\s*:-+\\s*$/)) html_attrs.push({align: \"left\"});\n else if (s.match(/^\\s*:-+:\\s*$/)) html_attrs.push({align: \"center\"});\n else html_attrs.push({});\n });\n\n // now for the header, avoid escaped pipes\n m[1] = _split_on_unescaped(m[1].replace(/\\|\\s*$/, ''), '|');\n for (i = 0; i < m[1].length; i++) {\n table[1][1].push(['th', html_attrs[i] || {}].concat(\n this.processInline(m[1][i].trim())));\n }\n\n // now for body contents\n forEach (m[3].replace(/\\|\\s*$/mg, '').split('\\n'), function (row) {\n var html_row = ['tr'];\n row = _split_on_unescaped(row, '|');\n for (i = 0; i < row.length; i++) {\n html_row.push(['td', html_attrs[i] || {}].concat(this.processInline(row[i].trim())));\n }\n table[2].push(html_row);\n }, this);\n\n return [table];\n}\n\nMarkdown.dialects.Maruku.inline[ \"{:\" ] = function inline_meta( text, matches, out ) {\n if ( !out.length ) {\n return [ 2, \"{:\" ];\n }\n\n // get the preceeding element\n var before = out[ out.length - 1 ];\n\n if ( typeof before === \"string\" ) {\n return [ 2, \"{:\" ];\n }\n\n // match a meta hash\n var m = text.match( /^\\{:\\s*((?:\\\\\\}|[^\\}])*)\\s*\\}/ );\n\n // no match, false alarm\n if ( !m ) {\n return [ 2, \"{:\" ];\n }\n\n // attach the attributes to the preceeding element\n var meta = this.dialect.processMetaHash( m[ 1 ] ),\n attr = extract_attr( before );\n\n if ( !attr ) {\n attr = {};\n before.splice( 1, 0, attr );\n }\n\n for ( var k in meta ) {\n attr[ k ] = meta[ k ];\n }\n\n // cut out the string and replace it with nothing\n return [ m[ 0 ].length, \"\" ];\n};\n\nMarkdown.dialects.Maruku.inline.__escape__ = /^\\\\[\\\\`\\*_{}\\[\\]()#\\+.!\\-|:]/;\n\nMarkdown.buildBlockOrder ( Markdown.dialects.Maruku.block );\nMarkdown.buildInlinePatterns( Markdown.dialects.Maruku.inline );\n\nvar isArray = Array.isArray || function(obj) {\n return Object.prototype.toString.call(obj) == \"[object Array]\";\n};\n\nvar forEach;\n// Don't mess with Array.prototype. Its not friendly\nif ( Array.prototype.forEach ) {\n forEach = function( arr, cb, thisp ) {\n return arr.forEach( cb, thisp );\n };\n}\nelse {\n forEach = function(arr, cb, thisp) {\n for (var i = 0; i < arr.length; i++) {\n cb.call(thisp || arr, arr[i], i, arr);\n }\n }\n}\n\nvar isEmpty = function( obj ) {\n for ( var key in obj ) {\n if ( hasOwnProperty.call( obj, key ) ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction extract_attr( jsonml ) {\n return isArray(jsonml)\n && jsonml.length > 1\n && typeof jsonml[ 1 ] === \"object\"\n && !( isArray(jsonml[ 1 ]) )\n ? jsonml[ 1 ]\n : undefined;\n}\n\n\n\n/**\n * renderJsonML( jsonml[, options] ) -> String\n * - jsonml (Array): JsonML array to render to XML\n * - options (Object): options\n *\n * Converts the given JsonML into well-formed XML.\n *\n * The options currently understood are:\n *\n * - root (Boolean): wether or not the root node should be included in the\n * output, or just its children. The default `false` is to not include the\n * root itself.\n */\nexpose.renderJsonML = function( jsonml, options ) {\n options = options || {};\n // include the root element in the rendered output?\n options.root = options.root || false;\n\n var content = [];\n\n if ( options.root ) {\n content.push( render_tree( jsonml ) );\n }\n else {\n jsonml.shift(); // get rid of the tag\n if ( jsonml.length && typeof jsonml[ 0 ] === \"object\" && !( jsonml[ 0 ] instanceof Array ) ) {\n jsonml.shift(); // get rid of the attributes\n }\n\n while ( jsonml.length ) {\n content.push( render_tree( jsonml.shift() ) );\n }\n }\n\n return content.join( \"\\n\\n\" );\n};\n\nfunction escapeHTML( text ) {\n return text.replace( /&/g, \"&\" )\n .replace( //g, \">\" )\n .replace( /\"/g, \""\" )\n .replace( /'/g, \"'\" );\n}\n\nfunction render_tree( jsonml ) {\n // basic case\n if ( typeof jsonml === \"string\" ) {\n return escapeHTML( jsonml );\n }\n\n var tag = jsonml.shift(),\n attributes = {},\n content = [];\n\n if ( jsonml.length && typeof jsonml[ 0 ] === \"object\" && !( jsonml[ 0 ] instanceof Array ) ) {\n attributes = jsonml.shift();\n }\n\n while ( jsonml.length ) {\n content.push( render_tree( jsonml.shift() ) );\n }\n\n var tag_attrs = \"\";\n for ( var a in attributes ) {\n tag_attrs += \" \" + a + '=\"' + escapeHTML( attributes[ a ] ) + '\"';\n }\n\n // be careful about adding whitespace here for inline elements\n if ( tag == \"img\" || tag == \"br\" || tag == \"hr\" ) {\n return \"<\"+ tag + tag_attrs + \"/>\";\n }\n else {\n return \"<\"+ tag + tag_attrs + \">\" + content.join( \"\" ) + \"\";\n }\n}\n\nfunction convert_tree_to_html( tree, references, options ) {\n var i;\n options = options || {};\n\n // shallow clone\n var jsonml = tree.slice( 0 );\n\n if ( typeof options.preprocessTreeNode === \"function\" ) {\n jsonml = options.preprocessTreeNode(jsonml, references);\n }\n\n // Clone attributes if they exist\n var attrs = extract_attr( jsonml );\n if ( attrs ) {\n jsonml[ 1 ] = {};\n for ( i in attrs ) {\n jsonml[ 1 ][ i ] = attrs[ i ];\n }\n attrs = jsonml[ 1 ];\n }\n\n // basic case\n if ( typeof jsonml === \"string\" ) {\n return jsonml;\n }\n\n // convert this node\n switch ( jsonml[ 0 ] ) {\n case \"header\":\n jsonml[ 0 ] = \"h\" + jsonml[ 1 ].level;\n delete jsonml[ 1 ].level;\n break;\n case \"bulletlist\":\n jsonml[ 0 ] = \"ul\";\n break;\n case \"numberlist\":\n jsonml[ 0 ] = \"ol\";\n break;\n case \"listitem\":\n jsonml[ 0 ] = \"li\";\n break;\n case \"para\":\n jsonml[ 0 ] = \"p\";\n break;\n case \"markdown\":\n jsonml[ 0 ] = \"html\";\n if ( attrs ) delete attrs.references;\n break;\n case \"code_block\":\n jsonml[ 0 ] = \"pre\";\n i = attrs ? 2 : 1;\n var code = [ \"code\" ];\n code.push.apply( code, jsonml.splice( i, jsonml.length - i ) );\n jsonml[ i ] = code;\n break;\n case \"inlinecode\":\n jsonml[ 0 ] = \"code\";\n break;\n case \"img\":\n jsonml[ 1 ].src = jsonml[ 1 ].href;\n delete jsonml[ 1 ].href;\n break;\n case \"linebreak\":\n jsonml[ 0 ] = \"br\";\n break;\n case \"link\":\n jsonml[ 0 ] = \"a\";\n break;\n case \"link_ref\":\n jsonml[ 0 ] = \"a\";\n\n // grab this ref and clean up the attribute node\n var ref = references[ attrs.ref ];\n\n // if the reference exists, make the link\n if ( ref ) {\n delete attrs.ref;\n\n // add in the href and title, if present\n attrs.href = ref.href;\n if ( ref.title ) {\n attrs.title = ref.title;\n }\n\n // get rid of the unneeded original text\n delete attrs.original;\n }\n // the reference doesn't exist, so revert to plain text\n else {\n return attrs.original;\n }\n break;\n case \"img_ref\":\n jsonml[ 0 ] = \"img\";\n\n // grab this ref and clean up the attribute node\n var ref = references[ attrs.ref ];\n\n // if the reference exists, make the link\n if ( ref ) {\n delete attrs.ref;\n\n // add in the href and title, if present\n attrs.src = ref.href;\n if ( ref.title ) {\n attrs.title = ref.title;\n }\n\n // get rid of the unneeded original text\n delete attrs.original;\n }\n // the reference doesn't exist, so revert to plain text\n else {\n return attrs.original;\n }\n break;\n }\n\n // convert all the children\n i = 1;\n\n // deal with the attribute node, if it exists\n if ( attrs ) {\n // if there are keys, skip over it\n for ( var key in jsonml[ 1 ] ) {\n i = 2;\n break;\n }\n // if there aren't, remove it\n if ( i === 1 ) {\n jsonml.splice( i, 1 );\n }\n }\n\n for ( ; i < jsonml.length; ++i ) {\n jsonml[ i ] = convert_tree_to_html( jsonml[ i ], references, options );\n }\n\n return jsonml;\n}\n\n\n// merges adjacent text nodes into a single node\nfunction merge_text_nodes( jsonml ) {\n // skip the tag name and attribute hash\n var i = extract_attr( jsonml ) ? 2 : 1;\n\n while ( i < jsonml.length ) {\n // if it's a string check the next item too\n if ( typeof jsonml[ i ] === \"string\" ) {\n if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === \"string\" ) {\n // merge the second string into the first and remove it\n jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];\n }\n else {\n ++i;\n }\n }\n // if it's not a string recurse\n else {\n merge_text_nodes( jsonml[ i ] );\n ++i;\n }\n }\n}\n\n} )( (function() {\n if ( typeof exports === \"undefined\" ) {\n window.markdown = {};\n return window.markdown;\n }\n else {\n return exports;\n }\n} )() );\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/markdown/lib/markdown.js\n ** module id = 1188\n ** module chunks = 23\n **/","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/util/~/inherits/inherits_browser.js\n ** module id = 1276\n ** module chunks = 23\n **/","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/util/support/isBufferBrowser.js\n ** module id = 1277\n ** module chunks = 23\n **/","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/util/util.js\n ** module id = 1278\n ** module chunks = 23\n **/"],"sourceRoot":""}




  • © 2015 - 2024 Weber Informatics LLC | Privacy Policy