Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
@tiptap/extension-underline
Advanced tools
@tiptap/extension-underline is an extension for the Tiptap editor that allows you to add underline formatting to your text. It integrates seamlessly with Tiptap's modular architecture, enabling you to easily add underline functionality to your rich text editor.
Add Underline Extension
This code demonstrates how to add the Underline extension to a Tiptap editor instance. The Underline extension is imported and included in the editor's extensions array.
import Underline from '@tiptap/extension-underline';
import { Editor } from '@tiptap/core';
const editor = new Editor({
extensions: [
Underline,
],
content: '<p>Hello World!</p>',
});
Toggle Underline
This code shows how to programmatically toggle the underline formatting on the selected text in the editor. The `toggleUnderline` method is chained with other editor commands.
editor.chain().focus().toggleUnderline().run();
Check Underline State
This code snippet checks if the current selection in the editor is underlined. The `isActive` method returns a boolean indicating the underline state.
const isUnderlined = editor.isActive('underline');
The `prosemirror-schema-basic` package provides a basic schema for ProseMirror, including underline functionality. It is more low-level compared to Tiptap and requires more manual setup.
Draft.js is a rich text editor framework for React. It includes built-in support for underline formatting, but it is more complex to integrate compared to Tiptap's modular approach.
Quill is a powerful, free, open-source WYSIWYG editor with built-in support for underline formatting. It offers a more comprehensive out-of-the-box experience but is less modular than Tiptap.
Tiptap is a headless wrapper around ProseMirror – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as New York Times, The Guardian or Atlassian.
Documentation can be found on the Tiptap website.
Tiptap is open sourced software licensed under the MIT license.
FAQs
underline extension for tiptap
The npm package @tiptap/extension-underline receives a total of 347,518 weekly downloads. As such, @tiptap/extension-underline popularity was classified as popular.
We found that @tiptap/extension-underline demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.