Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.




 background-image: url("");

.title {
  display: inline-block;

.editorWrap {
  width: 799px;
  margin: 8px auto;
  textarea {
    width: 99%;
    min-height: 300px;
    margin-bottom: -5px;
    resize: vertical;
    outline: none;
    padding-left: 5px;
    padding-top: 5px;
    font-size: 12px;

.spaceBetweenEditorAndPreviewer {
  width: 10px;
  text-align: center;
  font-size: 10px;
  margin: auto;

.previewWrap {
  background: gray;
  width: 800px;
  margin: 20px auto;
  padding-right: 27px;
  #preview {
    margin-left: 5px;
    margin-top: -10px;
    width: 97%;

#preview {
  blockquote {
    border-left: 300px solid;
    color: blue;
    padding-left: 15px;
    margin-left: 10px;

  code {
    background: white;
    padding: 1px;
    font-size: 15px;
    font-weight: bold ;

  pre {
    background: white;
    padding: 30px;


  breaks: true,

const thisRenderer = new marked.Renderer(); = function (href, title, text) {
  return `<a target="_blank" href="${href}">${text}` + '</a>';

class MarkDownPreview extends React.Component{
  constructor(props) {
    this.state =  {
      textToMark: startingText,
    this.handleChange = this.handleChange.bind(this);
  handleChange(textInEditor) {

 render() {
    return (
        <div className="editorWrap">
          <Editor textToMark={this.state.textToMark} 
            onChange={this.handleChange} />
        <div className="spaceBetweenEditorAndPreviewer">
        <div className="previewWrap">
          <Preview  textToMark={this.state.textToMark}/>

const Editor = (props) => {
  return (
    <textarea id="editor"

const Preview = (props) => {
  return (
      <div id='preview' dangerouslySetInnerHTML={{__html: marked(props.textToMark, { renderer: thisRenderer })}} />

const startingText = 
`# One hashtag / pound sign leads to text in H1.

## Two hashtags lead to text in H2.
### Three hashtags leads to text in H3.
###### This is H6 text.
Three backticks lead to a code window.
// Here is a code block:

function incrementByOne(numberToIncrease) {
    return numberToIncrease + 1;
Three more backticks end the code window.

Two astericks start and stop **bold text**.
Underscores start and stop _italic text_.

\`[Something]( is the same as <a src="">Something</a>  \`

[A link to Google](

> Block Quotes are started with a \>.

1. Listed items start with a 1. 
1. I stripped out what I could and still have a passing result.
1. I think this is sufficient.

Here is an embedded image
![Google Image](

ReactDOM.render(<MarkDownPreview />, document.getElementById('markDownPreview'));