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-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 929,010 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
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.