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.


                <div class="editor" style="direction:ltr;background:#fc0">

<pre id="html"></pre>


                .editor p {
  background: tomato;
  margin-bottom: 10px;


                var Parchment = Quill.import('parchment');
var Delta = Quill.import('delta');
let Break = Quill.import('blots/break');
let Embed = Quill.import('blots/embed');
let Block = Quill.import('blots/block');
function lineBreakMatcher() {
  var newDelta = new Delta();
  newDelta.insert({'break': ''});
  return newDelta;
var options = {
  theme: 'bubble',
  modules: {
    clipboard: {
      matchers: [
        ['BR', lineBreakMatcher] 
    keyboard: {
      bindings: {
        handleEnter: {
          key: 13,
          handler: function (range, context) {
            if (range.length > 0) {
              this.quill.scroll.deleteAt(range.index, range.length);  // So we do not trigger text-change
            let lineFormats = Object.keys(context.format).reduce(function(lineFormats, format) {
              if (Parchment.query(format, Parchment.Scope.BLOCK) && !Array.isArray(context.format[format])) {
                lineFormats[format] = context.format[format];
              return lineFormats;
            }, {});
            var previousChar = this.quill.getText(range.index - 1, 1);
            // Earlier scroll.deleteAt might have messed up our selection,
            // so insertText's built in selection preservation is not reliable
            this.quill.insertText(range.index, '\n', lineFormats, Quill.sources.USER);
            if (previousChar == '' || previousChar == '\n') {
              this.quill.setSelection(range.index + 2, Quill.sources.SILENT);
            } else {
              this.quill.setSelection(range.index + 1, Quill.sources.SILENT);
            Object.keys(context.format).forEach((name) => {
              if (lineFormats[name] != null) return;
              if (Array.isArray(context.format[name])) return;
              if (name === 'link') return;
              this.quill.format(name, context.format[name], Quill.sources.USER);
        linebreak: {
          key: 13,
          shiftKey: true,
            handler: function (range, context) {
              var nextChar = this.quill.getText(range.index + 1, 1)
              var ee = this.quill.insertEmbed(range.index, 'break', true, 'user');
              if (nextChar.length == 0) {
                // second line break inserts only at the end of parent element
                var ee = this.quill.insertEmbed(range.index, 'break', true, 'user');
              this.quill.setSelection(range.index + 1, Quill.sources.SILENT);

Break.prototype.insertInto = function(parent, ref) {, parent, ref)
Break.prototype.length= function() {
    return 1;
Break.prototype.value= function() {
    return '\n';

var quill = new Quill('.editor', options);