Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
@toast-ui/editor-plugin-color-syntax
Advanced tools
Readme
This is a plugin of TOAST UI Editor to color editing text.
- node_modules/
- @toast-ui/
- editor-plugin-color-syntax/
- dist/
- toastui-editor-plugin-color-syntax.js
The bundle files under the cdn
folder include all dependencies.
- uicdn.toast.com/
- editor-plugin-color-syntax/
- latest/
- toastui-editor-plugin-color-syntax.js
- toastui-editor-plugin-color-syntax.min.js
To use the plugin, @toast-ui/editor
must be installed.
Ref. Getting Started
$ npm install @toast-ui/editor-plugin-color-syntax
Along with the plugin, the plugin's dependency style must be imported.
import 'tui-color-picker/dist/tui-color-picker.css';
import colorSyntax from '@toast-ui/editor-plugin-color-syntax';
require('tui-color-picker/dist/tui-color-picker.css');
const colorSyntax = require('@toast-ui/editor-plugin-color-syntax');
// ...
import Editor from '@toast-ui/editor';
import colorSyntax from '@toast-ui/editor-plugin-color-syntax';
const instance = new Editor({
// ...
plugins: [colorSyntax]
});
To use the plugin, the CDN files(CSS, Script) of @toast-ui/editor
must be included.
<!-- CSS -->
<link
rel="stylesheet"
href="https://uicdn.toast.com/tui-color-picker/latest/tui-color-picker.min.css"
/>
<!-- Script -->
<script src="https://uicdn.toast.com/editor-plugin-color-syntax/latest/toastui-editor-plugin-color-syntax.min.js"></script>
const { Editor } = toastui;
const { colorSyntax } = Editor.plugin;
const instance = new Editor({
// ...
plugins: [colorSyntax]
});
The color-syntax
plugin can set options when used. Just add the plugin function and options related to the plugin to the array([pluginFn, pluginOptions]
) and push them to the plugins
option of the editor.
The following options are available in the color-syntax
plugin.
The useCustomSyntax
option is false
by default, applying color syntax using the span
tag. (e.g. <span style="color:#ff00ff">foo</span>
) If enabled, it will use custom syntax instead of the span
tag. (e.g. {color:# ff00ff}test{color}
)
Name | Type | Default Value | Description |
---|---|---|---|
preset | Array.<string> | Preset for color palette | |
useCustomSyntax | boolean | false | Whether use custom syntax or not |
// ...
import Editor from '@toast-ui/editor';
import colorSyntax from '@toast-ui/editor-plugin-color-syntax';
const colorSyntaxOptions = {
preset: ['#181818', '#292929', '#393939'],
useCustomSyntax: true
};
const instance = new Editor({
// ...
plugins: [[colorSyntax, colorSyntaxOptions]]
});
FAQs
TOAST UI Editor : Color Syntax Plugin
We found that @toast-ui/editor-plugin-color-syntax demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).