/*!
 * 
 * pandora v0.0.34
 *
 * Copyright 2015-present, Gingkoo, Inc.
 * All rights reserved.
 *
 */
"use strict";
(self["webpackChunkpandora"] = self["webpackChunkpandora"] || []).push([[9],{

/***/ 5363:
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* binding */ Markdown; }
});

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
var classCallCheck = __webpack_require__(15671);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
var createClass = __webpack_require__(43144);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
var assertThisInitialized = __webpack_require__(97326);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
var inherits = __webpack_require__(60136);
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createSuper.js
var createSuper = __webpack_require__(29388);
// EXTERNAL MODULE: ./node_modules/react/index.js
var react = __webpack_require__(67294);
// EXTERNAL MODULE: ./node_modules/highlight.js/lib/index.js
var lib = __webpack_require__(77869);
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
// EXTERNAL MODULE: ./node_modules/markdown-it/index.js
var markdown_it = __webpack_require__(9980);
var markdown_it_default = /*#__PURE__*/__webpack_require__.n(markdown_it);
// EXTERNAL MODULE: ./node_modules/markdown-it/lib/common/utils.js
var utils = __webpack_require__(67022);
;// CONCATENATED MODULE: ./src/utils/markdown.ts
/**
 * @file markdown 解析
 */



var markdown = markdown_it_default()({
  linkify: true,
  highlight: function highlight(str, lang) {
    if (lang && lib_default().getLanguage(lang)) {
      try {
        return '<pre class="hljs language-' + (0,utils.escapeHtml)(lang.toLowerCase()) + '"><code>' + lib_default().highlight(lang, str, true).value + '</code></pre>';
      } catch (__) {}
    }
    return '<pre class="hljs language-' + (0,utils.escapeHtml)(lang.toLowerCase()) + '"><code>' + (0,utils.escapeHtml)(str) + '</code></pre>';
  }
});
/* harmony default export */ function utils_markdown(content) {
  return markdown.render(content);
}
;// CONCATENATED MODULE: ./src/components/Markdown.tsx







var Markdown = /*#__PURE__*/function (_React$Component) {
  (0,inherits/* default */.Z)(Markdown, _React$Component);
  var _super = (0,createSuper/* default */.Z)(Markdown);
  function Markdown(props) {
    var _this;
    (0,classCallCheck/* default */.Z)(this, Markdown);
    _this = _super.call(this, props);
    _this.htmlRef = _this.htmlRef.bind((0,assertThisInitialized/* default */.Z)(_this));
    return _this;
  }
  (0,createClass/* default */.Z)(Markdown, [{
    key: "htmlRef",
    value: function htmlRef(dom) {
      this.dom = dom;
      if (!dom) {
        return;
      }
      this._render();
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate(nextProps) {
      if (this.props.content !== nextProps.content) {
        this._render();
      }
    }
  }, {
    key: "_render",
    value: function _render() {
      var content = this.props.content;
      this.dom.innerHTML = utils_markdown(content || '');
    }
  }, {
    key: "render",
    value: function render() {
      return /*#__PURE__*/react.createElement("div", {
        className: "markdown-body",
        ref: this.htmlRef
      });
    }
  }]);
  return Markdown;
}(react.Component);


/***/ })

}]);
//# sourceMappingURL=markdown.js.map