Skip to content

editor-js/raw

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
November 17, 2020 13:15
src
November 29, 2022 23:01
September 2, 2017 03:31
November 17, 2020 13:15
September 2, 2017 03:31
March 4, 2019 00:15
September 2, 2017 03:31
September 2, 2017 03:31
March 4, 2019 00:35
November 17, 2022 23:37
November 10, 2020 19:07
November 17, 2022 23:37

Raw HTML Tool for Editor.js

Raw Tool for the Editor.js allows to include raw HTML code in your articles.

Installation

Install via NPM

Get the package

npm i --save-dev @editorjs/raw

Include module at your application

const RawTool = require('@editorjs/raw');

Download to your project's source dir

  1. Upload folder dist from repository
  2. Add dist/bundle.js file to your page.

Load from CDN

You can load specific version of package from jsDelivr CDN.

https://cdn.jsdelivr.net/npm/@editorjs/raw

Require this script on a page with CodeX Editor.

<script src="..."></script>

Usage

Add a new Tool to the tools property of the CodeX Editor initial config.

var editor = CodexEditor({
  ...
  
  tools: {
    ...
    raw: RawTool,
  }
  
  ...
});

Config Params

Field Type Description
placeholder string Raw Tool's placeholder string

Output data

This Tool returns raw HTML code.

{
    "type" : "raw",
    "data" : {
        "html": "<div style=\"background: #000; color: #fff; font-size: 30px; padding: 50px;\">Any HTML code</div>",
    }
}