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

@tiptap/extension-code

Package Overview
Dependencies
Maintainers
5
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-code

code extension for tiptap

  • 2.6.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
930K
increased by1.43%
Maintainers
5
Weekly downloads
 
Created

What is @tiptap/extension-code?

@tiptap/extension-code is an extension for the Tiptap editor that allows you to add and manage inline code snippets within your rich text editor. It provides functionality to format text as code, making it useful for documentation, technical writing, and any other use case where inline code representation is needed.

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

Add Inline Code

This feature allows you to add inline code snippets within your text. The code sample demonstrates how to initialize the Tiptap editor with the Code extension and include inline code in the content.

import { Code } from '@tiptap/extension-code';
import { Editor } from '@tiptap/core';

const editor = new Editor({
  extensions: [
    Code,
  ],
  content: '<p>This is <code>inline code</code> in a paragraph.</p>',
});

Toggle Code Formatting

This feature allows you to toggle code formatting for the selected text. The code sample shows how to initialize the Tiptap editor with the Code extension and toggle code formatting using the chainable command API.

import { Code } from '@tiptap/extension-code';
import { Editor } from '@tiptap/core';

const editor = new Editor({
  extensions: [
    Code,
  ],
});

// Toggle code formatting for the selected text
editor.chain().focus().toggleCode().run();

Other packages similar to @tiptap/extension-code

Keywords

FAQs

Package last updated on 13 Aug 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