JSPM

@editorjs/underline

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 39968
  • Score
    100M100P100Q157818F
  • License MIT

Inline tool for underlining text fragments

Package Exports

  • @editorjs/underline
  • @editorjs/underline/dist/bundle.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@editorjs/underline) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Underline Tool

Inline tool for underlining text fragments for the Editor.js

Installation

Install via NPM

Get the package

npm i --save @editorjs/underline
yarn add @editorjs/underline

Include module at your application

import Underline from '@editorjs/underline';

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 the package from jsDelivr CDN and require the script on a page with Editor.js.

<script src="https://cdn.jsdelivr.net/npm/@editorjs/underline@latest"></script>

Usage

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

import EditorJs from '@editorjs/editorjs';
import Underline from '@editorjs/underline';

var editor = new EditorJS({
  // ...
  tools: {
    // ...
    underline: Underline
  },
});

Config Params

This Tool has no config params

Output data

Underlined text will be wrapped with a u tag with an cdx-underline class.

{
    "type" : "text",
    "data" : {
        "text" : "Create a directory for your module, enter it and run <u class=\"cdx-underline\">npm init</u> command."
    }
}