-
Notifications
You must be signed in to change notification settings - Fork 245
FAQ
Yes, it should be possible to have multiple contenteditable instances wrapped with Scribe. You should initialise each one explicitly.
Yes, but if you are using the sanitizer plugin then make sure you have whitelisted the underline element (u
).
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.
npm test
See CONTRIBUTING.md for more information about running tests.
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
}
})