Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.
Robert Rees edited this page Jun 14, 2016 · 3 revisions

Can multiple Scribe instances be loaded on a page?

Yes, it should be possible to have multiple contenteditable instances wrapped with Scribe. You should initialise each one explicitly.

Can you underline with Scribe?

Yes, but if you are using the sanitizer plugin then make sure you have whitelisted the underline element (u).

Is it production ready?

Yes. The Guardian is using Scribe as the basis for their internal CMS’ rich text editor.

However, please consult the Browser Support page, as some browsers are not officially supported. The Guardian maintains support for evergreen Chrome and Firefox and we may accept patches for unsupported browsers as long as they have accompanying tests.

How do I run the tests?

npm test

See CONTRIBUTING.md for more information about running tests.

Why does Scribe have a custom undo manager?

The native API for formatting content in a contenteditable has many browser inconsistencies. Scribe has to manipulate the DOM directly on top of using these commands in order to patch those inconsistencies. What’s more, there is no widely supported command for telling contenteditable to insert Ps or BRs for line breaks. Thus, to add this behaviour Scribe needs to manipulate the DOM once again.

The undo stack breaks whenever DOM manipulation is used instead of the native command API, therefore we have to use our own.

Scribe's undo manager can be turned off by configuration eg:

var scribe = new Scribe(scribeElement, {
  undo: {
    enabled: false
  }
})