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 includes JSX processing.

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


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


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.


                <textarea id="incoming"></textarea>
<textarea id="outgoing"></textarea>
<button>Do it!</button>


                #incoming {
  width: 1000px;
  height: 50px;

#outgoing {
  width: 1000px;
  height: 300px;


                $('button').on('click', function() {
  var text = $('#incoming').val();
  // to catch leaders/trailers
  text = '\n' + text + '\n';
  // line breaks
  text = text.replace(/([\r\n ]*<br \/>[\r\n ]*)+/g, '\n\n');
  // verbose centered images
  text = text.replace(/<div class="separator" style="clear: both; text-align: center;">/g, '<div style="text-align: center;">');
  // centered images
  text = text.replace(/<div style="text-align: center;">[\r\n ]*(.*?)[\r\n ]*<\/div>/g, '<div class="blog-image">$1</div>');
  // image border
  text = text.replace(/<img border="0"/g, '<img');
  // xhtml self-closing tags
  text = text.replace(/ \/>/g, '>');
  // before script
  text = text.replace(/[\r\n ]*<script/g, '\n\n<script');

  // after script
  text = text.replace(/<\/script>[\r\n ]*/g, '</scr' + 'ipt>\n\n');
  // rejoin codepen snippets
  text = text.replace(/<\/div>[\r\n ]*<script async="" src="\/\/, '</div>\n<script async="" src="//');
  // bold titles
  text = text.replace(/[\r\n ]+<b>(.*?)<\/b>[\r\n ]+/g, '\n\n<h3>$1</h3>\n\n');
  // italics
  text = text.replace(/<(\/?)i>/g, '<$1em>');

  // leftover bold
  text = text.replace(/<(\/?)b>/g, '<$1strong>');

  // trim
  text = text.trim();