Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tiptap/extension-hard-break

Package Overview
Dependencies
Maintainers
5
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-hard-break

hard break extension for tiptap

  • 2.9.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1M
increased by0.59%
Maintainers
5
Weekly downloads
 
Created

What is @tiptap/extension-hard-break?

@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.

What are @tiptap/extension-hard-break's main functionalities?

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(),
      },
    }),
  ],
});

Other packages similar to @tiptap/extension-hard-break

Keywords

FAQs

Package last updated on 23 Oct 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc