How to use the marked/lib/marked.Renderer function in marked

To help you get started, we’ve selected a few marked 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 pizn / eevee / src / components / Post / Editor.jsx View on Github external
import React, { Component, PropTypes } from 'react';
import classNames from 'classnames';
import CM from 'codemirror/lib/codemirror';
import { getCursorState, applyFormat } from '../../utils/editorFormat';

import marked from 'marked/lib/marked';
// import hljs from 'highlight.js/lib/highlight.js';
import key from 'keymaster';
import Icon from 'antd/lib/icon';
import Tooltip from 'antd/lib/tooltip';
import '../../styles/EditIcon.less';
import '../../styles/CodeMirror.less';

marked.setOptions({
  renderer: new marked.Renderer()
});

require('codemirror/mode/xml/xml');
require('codemirror/mode/markdown/markdown');
require('codemirror/mode/gfm/gfm');
require('codemirror/mode/javascript/javascript');
require('codemirror/mode/css/css');
require('codemirror/mode/htmlmixed/htmlmixed');
require('codemirror/mode/dockerfile/dockerfile');
require('codemirror/mode/go/go');
require('codemirror/mode/nginx/nginx');
require('codemirror/mode/shell/shell');
require('codemirror/mode/sql/sql');
require('codemirror/mode/swift/swift');
require('codemirror/mode/velocity/velocity');
require('codemirror/mode/yaml/yaml');