Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@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 370,121 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.