
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
scribe-editor
Advanced tools
A rich text editor framework for the web platform, with patches for browser inconsistencies and sensible defaults.
#Scribe
A rich text editor framework for the web platform, with patches for browser inconsistencies and sensible defaults.
For an introduction, you may want to read the blog post Inside the Guardian’s CMS: meet Scribe, an extensible rich text editor.
Please note: There is a lot of missing documentation for Scribe and many of its plugins. We plan to improve this, however in the meantime we encourage you to look at the code. Scribe is very small in comparison to other libraries of its kind.
You can join us on IRC at [#scribejs] on freenode, or via the Google Group.
Scribe only actively supports a sub-set of browsers.
At the core of Scribe we have:
contenteditable
;Scribe patches many browser inconsistencies in the native command API.
bower install scribe
Alternatively, you can access the distribution files through GitHub releases.
Scribe is an AMD module:
require(['scribe', 'scribe-plugin-blockquote-command', 'scribe-plugin-toolbar'],
function (Scribe, scribePluginBlockquoteCommand, scribePluginToolbar) {
var scribeElement = document.querySelector('.scribe');
// Create an instance of Scribe
var scribe = new Scribe(scribeElement);
// Use some plugins
scribe.use(scribePluginBlockquoteCommand());
var toolbarElement = document.querySelector('.toolbar');
scribe.use(scribePluginToolbar(toolbarElement));
});
You can see a live example here, or view the code here.
Also be sure to check the examples
directory for an
AMD syntax example as well as a CommonJS (browserify) example.
allowBlockElements
undo: { enabled: false }
defaultCommandPatches
defaultPlugins
defaultFormatters
For detailed documentation see the wiki page on options.
A plugin is simply a function that receives Scribe as an argument:
function myPlugin(scribe) {}
A consumer can then use your plugin with Scribe.use
:
scribe.use(myPlugin);
Plugins may package whatever functionality you desire, and you are free to use native APIs to do so. However, you are required to wrap any DOM manipulation in a transaction, so that we can capture state changes for the history. For example:
function myPlugin(scribe) {
scribe.transactionManager.run(function () {
// Do some fancy DOM manipulation
});
}
Scribe has a rich plugin ecosystem that expands and customises what it can do.
See the wiki for a list of plugins and how to create new ones
See the wiki's FAQ
FAQs
A rich text editor framework for the web platform, with patches for browser inconsistencies and sensible defaults.
We found that scribe-editor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.