How to use the @storybook/addon-info/dist/components/markdown.H4 function in @storybook/addon-info

To help you get started, we’ve selected a few @storybook/addon-info examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Checkfront / react-storybook-addon-chapters / dist / utils / info-content.js View on Github external
var _react2 = _interopRequireDefault(_react);

var _marksy = require('marksy');

var _marksy2 = _interopRequireDefault(_marksy);

var _markdown = require('@storybook/addon-info/dist/components/markdown');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var defaultMarksyConf = {
  h1: _markdown.H1,
  h2: _markdown.H2,
  h3: _markdown.H3,
  h4: _markdown.H4,
  h5: _markdown.H5,
  h6: _markdown.H6,
  code: _markdown.Code,
  p: _markdown.P,
  a: _markdown.A,
  li: _markdown.LI,
  ul: _markdown.UL
};

function renderInfoContent(content) {
  var marksyConf = (0, _extends3.default)({}, defaultMarksyConf);
  var markdownInfo = (0, _marksy2.default)(marksyConf, content);

  if (!content || content === '' || typeof content !== 'string') {
    return null;
  }