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-hard-break
Advanced tools
@tiptap/extension-hard-break is an extension for the Tiptap editor that allows users to insert hard line breaks (similar to pressing Shift+Enter in a traditional text editor). This is useful for creating new lines within a paragraph without starting a new paragraph.
Insert Hard Break
This feature allows users to insert a hard break into the text. The code sample demonstrates how to import the HardBreak extension and use the setHardBreak command to insert a hard break at the current cursor position.
import { HardBreak } from '@tiptap/extension-hard-break';
const editor = new Editor({
extensions: [
HardBreak,
],
});
// Use the command to insert a hard break
editor.commands.setHardBreak();
Custom Key Bindings
This feature allows users to configure custom key bindings for inserting hard breaks. The code sample shows how to configure the HardBreak extension to insert a hard break when the user presses 'Mod-Enter' (Cmd-Enter on Mac or Ctrl-Enter on Windows).
import { HardBreak } from '@tiptap/extension-hard-break';
const editor = new Editor({
extensions: [
HardBreak.configure({
keymap: {
'Mod-Enter': () => editor.commands.setHardBreak(),
},
}),
],
});
The prosemirror-schema-basic package provides a basic schema for ProseMirror, including support for hard breaks. It is more general-purpose compared to @tiptap/extension-hard-break, which is specifically designed for Tiptap.
Draft.js is a rich text editor framework for React that includes support for hard breaks. While it offers similar functionality, it is a more comprehensive solution for building rich text editors and is not specifically tailored 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
hard break extension for tiptap
The npm package @tiptap/extension-hard-break receives a total of 368,739 weekly downloads. As such, @tiptap/extension-hard-break popularity was classified as popular.
We found that @tiptap/extension-hard-break 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.