Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
@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 451,883 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
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.