Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@tiptap/extension-bold
Advanced tools
@tiptap/extension-bold is an extension for the Tiptap editor that allows you to add bold formatting to your text. It provides a simple way to toggle bold styling on and off within the Tiptap rich-text editor.
Add Bold Formatting
This code demonstrates how to add the Bold extension to a Tiptap editor instance. The Bold extension is imported and included in the editor's extensions array, enabling bold formatting in the editor.
import { Bold } from '@tiptap/extension-bold';
import { Editor } from '@tiptap/core';
const editor = new Editor({
extensions: [
Bold,
],
content: '<p>Hello World!</p>',
});
Toggle Bold Formatting
This code shows how to programmatically toggle bold formatting on the selected text in the Tiptap editor. The `toggleBold` command is chained with `focus` to ensure the editor is focused before applying the bold formatting.
editor.chain().focus().toggleBold().run();
The `prosemirror-example-setup` package provides a set of example configurations for ProseMirror, including bold formatting. It is more general-purpose and requires more setup compared to @tiptap/extension-bold, which is specifically designed for Tiptap.
Draft.js is a rich text editor framework for React that includes built-in support for bold formatting. It offers a more comprehensive solution for building rich text editors but may require more configuration and customization compared to the straightforward @tiptap/extension-bold.
Quill is a powerful, open-source WYSIWYG editor that supports bold formatting out of the box. It provides a more feature-rich editor experience but is a standalone editor, unlike @tiptap/extension-bold, which is an extension for the Tiptap editor.
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
bold extension for tiptap
The npm package @tiptap/extension-bold receives a total of 652,593 weekly downloads. As such, @tiptap/extension-bold popularity was classified as popular.
We found that @tiptap/extension-bold 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.