项目作者: editor-js

项目描述 :
Raw HTML tool for Editor.js
高级语言: JavaScript
项目地址: git://github.com/editor-js/raw.git
创建时间: 2017-09-01T23:42:12Z
项目社区:https://github.com/editor-js/raw

开源协议:MIT License

下载


Raw HTML Tool for Editor.js

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

Installation

Get the package

  1. yarn add @editorjs/raw

Include module at your application

  1. import RawTool from '@editorjs/raw';

Optionally, you can load this tool from CDN @editorjs/raw@latest">JsDelivr CDN

Usage

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

  1. var editor = CodexEditor({
  2. ...
  3. tools: {
  4. ...
  5. raw: RawTool,
  6. }
  7. ...
  8. });

Config Params

Field Type Description
placeholder string Raw Tool’s placeholder string

Output data

This Tool returns raw HTML code.

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