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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

 background-image: url("https://www.desktopbackground.org/t/2012/07/18/422827_ugly-wallpapers-wallpapers-cave_3648x2736_h.jpg");

.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();
thisRenderer.link = 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) {
      textToMark: textInEditor.target.value

 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](www.aWebPage.com) is the same as <a src="www.aWebPage.com">Something</a>  \`

[A link to Google](http://www.google.com)

> 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](https://www.blog.google/static/blogv2/images/google-200x200.7714256da16f.png)

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

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.