You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

extension-code-block-prism

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

extension-code-block-prism

code block extension for tiptap

0.0.2
unpublished
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

:bookmark:CodeBlockPrism extension for TIPTAP Editor

This extension is based on CodeBlockLowlight. Most of the code in this repository is taken from there.

:cat: What for? Why not CodeBlockLowlight?

Unfortunately CodeBlockLowlight is based on LowLight and Highlight.js, Highlight.js supports many languages ​​but doesn't support many useful syntax. For example: JSX, TSX, MDX.

The list of supported Prism.js languages ​​can be found here: https://prismjs.com/#supported-languages

✍️ How to use it?

const editor = useEditor({
   extensions: [
       Document,
       Paragraph,
       Text,
       CodeBlock,
       CodeBlockPrism.configure({
           defaultLanguage: 'jsx',
       }),
   ],
   content: ``,
});

:hammer_and_wrench: How to style classes generated by PrismJS?

You can define styles via CSS. There are already ready-made themes, for example: OneDark

Keywords

tiptap

FAQs

Package last updated on 03 Jan 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