Base concepts

Editor.js is a block-styled editor for rich media stories. It outputs clean data in JSON instead of heavy HTML-markup. And more important thing is that Editor.js is designed to be API extendable and pluggable.

So there are few key features:

  1. Clean data output
  2. API pluggable
  3. Open source

What does it mean block-styled

In other editors the workspace is provided by single contenteditable element in where you can create different HTML markup. All of us saw permanent bugs with moving text fragments or scaling images, while page parts are jumping and twitches. Or highlighting big parts of text in case when you just want to make few words to be a heading or bold.

Bugs in popular editor. Try in yours.

Editor.js workspace consists of separate Blocks: paragraphs, headings, images, lists, quotes, etc. Each of them is an independent contenteditable element (or more complex structure) provided by Plugin and united by Editor's Core.

At the same time, most useful features as arrow-navigation, copy & paste, cross block selection and others works almost as in the familiar editors.

What is clean data

But more interest thing is, as mentioned above, that Editor.js returns clean data instead of HTML-markup. Take a look at the example.

If our entry consists of few paragraph and header, in popular Medium editor after saving we will have something like this:

<section name="0ed1" class="section section--body section--first"> <div class="section-divider"> <hr class="section-divider"> </div> <div class="section-content"> <div class="section-inner sectionLayout--insetColumn"> <h3 name="f8e8" class="graf graf--h3 graf--leading graf--title"> <br> </h3> <p name="982b" class="graf graf--p graf-after--h3"> The example of text that was written in <strong class="markup--strong markup--p-strong">one of popula</strong>r text editors. </p> <h3 name="c2ad" class="graf graf--h3 graf-after--p"> With the header of course </h3> <p name="83d3" class="graf graf--p graf-after--h3"> So what do we have? </p> </div> </div> </section> <section name="d1d2" class="section section--body"> ... </section>

Lets compare with the same data returned by Editor.js:

{ "time" : 1550476186479, "blocks" : [ { "type" : "paragraph", "data" : { "text" : "The example of text that was written in <b>one of popular</b> text editors." } }, { "type" : "header", "data" : { "text" : "With the header of course", "level" : 2 } }, { "type" : "paragraph", "data" : { "text" : "So what do we have?" } } ], "version" : "2.8.1" }

As you can see, there are only data we need: list of structural Blocks with their content description.

You can use this data to easy render in Web, native mobile/desctop application, pass to Audio Readers, create templates for Facebook Instant Articles, AMP, RSS, create chat-bots and many other.

Also, clean data can be useful for backend processing: sanitizing, validation, injecting an advertising or other stuff, extracting Headings, make covers for social networks from Image Blocks and other.

API pluggable?

A key value of the Editor is the API. All main functional units of the editor — Blocks, Inline Formatting Tools, Block Tunes — are provided by external plugins that uses Editor's API.

We decide to extract all this Tools to separate scripts to make Editor's Core more abstract and make API more powerful. Any challenges and tasks you are facing can be implemented by you own plugins using the API. 

At the same time, API is created to be easy-to-understand and simple-to-use.

Open Source, so?

Editor.js is more than just an editor. It is a big open-source community of developers and contributors. Anyone can suggest an improvement or bug fix. Anyone can create new cool API features and plugins.

We will support each developer of Editor.js plugins: best solutions will be collected to the awesome-lists and promoted to the community. Together we can create a big suite of different Blocks, Inline Tools, Block Tunes that can hit wide spectre of tasks.

Thanks for your interest. Hope you enjoy Editor.js.