Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@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
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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.