Socket
Socket
Sign inDemoInstall

@tiptap/extension-code

Package Overview
Dependencies
Maintainers
4
Versions
158
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


Version published
Weekly downloads
917K
increased by5.29%
Maintainers
4
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 11 Oct 2023

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