Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
@tiptap/extension-heading
Advanced tools
@tiptap/extension-heading is an extension for the Tiptap text editor that allows you to add and manage heading elements in your rich text content. It provides a straightforward way to include headings of various levels (e.g., H1, H2, H3) in your editor, making it easier to structure and format your text.
Add Heading
This feature allows you to add heading elements to your Tiptap editor. You can configure which heading levels are available (e.g., H1, H2, H3).
const editor = new Editor({
extensions: [
Heading.configure({
levels: [1, 2, 3],
}),
],
})
Set Heading Level
This feature allows you to set the heading level for a selected text. In this example, the selected text is set to a level 2 heading (H2).
editor.chain().focus().toggleHeading({ level: 2 }).run()
Check Heading Level
This feature allows you to check if the current selection is a heading of a specific level. In this example, it checks if the selection is an H1 heading.
const isHeading = editor.isActive('heading', { level: 1 })
prosemirror-schema-basic provides a basic schema for ProseMirror, including heading nodes. It is more low-level compared to @tiptap/extension-heading and requires more manual setup.
draft-js is a rich text editor framework for React. It includes support for headings, but the API and configuration are different from Tiptap. It is more integrated with React and offers a different set of features.
quill is a modern WYSIWYG editor built for compatibility and extensibility. It supports headings out of the box and offers a different user experience and API compared to 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
heading extension for tiptap
The npm package @tiptap/extension-heading receives a total of 767,945 weekly downloads. As such, @tiptap/extension-heading popularity was classified as popular.
We found that @tiptap/extension-heading 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
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.