Socket
Socket
Sign inDemoInstall

@tiptap/extension-code-block-lowlight

Package Overview
Dependencies
Maintainers
2
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/extension-code-block-lowlight - npm Package Compare versions

Comparing version 2.0.0-beta.3 to 2.0.0-beta.6

19

CHANGELOG.md

@@ -6,2 +6,21 @@ # Change Log

# [2.0.0-beta.6](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-code-block-lowlight@2.0.0-beta.4...@tiptap/extension-code-block-lowlight@2.0.0-beta.6) (2021-04-14)
**Note:** Version bump only for package @tiptap/extension-code-block-lowlight
# [2.0.0-beta.4](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-code-block-lowlight@2.0.0-beta.3...@tiptap/extension-code-block-lowlight@2.0.0-beta.4) (2021-04-14)
### Bug Fixes
* fix lowlight decorations for vue 3 ([daa5dc0](https://github.com/ueberdosis/tiptap-next/commit/daa5dc0fb1ec2db6889565fc9c091f3dbdbbda6d))
# [2.0.0-beta.3](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-code-block-lowlight@2.0.0-beta.2...@tiptap/extension-code-block-lowlight@2.0.0-beta.3) (2021-04-12)

@@ -8,0 +27,0 @@

6

dist/packages/extension-code-block-lowlight/src/code-block-lowlight.d.ts

@@ -1,1 +0,5 @@

export declare const CodeBlockLowlight: import("@tiptap/core").Node<import("@tiptap/extension-code-block").CodeBlockOptions>;
import { CodeBlockOptions } from '@tiptap/extension-code-block';
export interface CodeBlockLowlightOptions extends CodeBlockOptions {
lowlight: any;
}
export declare const CodeBlockLowlight: import("@tiptap/core").Node<CodeBlockLowlightOptions>;

3

dist/packages/extension-code-block-lowlight/src/lowlight-plugin.d.ts
import { Plugin } from 'prosemirror-state';
export declare function LowlightPlugin({ name }: {
export declare function LowlightPlugin({ name, lowlight }: {
name: string;
lowlight: any;
}): Plugin<any, any>;
{
"name": "@tiptap/extension-code-block-lowlight",
"description": "code block extension for tiptap",
"version": "2.0.0-beta.3",
"version": "2.0.0-beta.6",
"homepage": "https://tiptap.dev",

@@ -35,3 +35,3 @@ "keywords": [

},
"gitHead": "28d30a10341cb5cd10626b1b8c884c20787b5d72"
"gitHead": "6e8970566b356a5cfaa225fea621d50c419d73f7"
}

@@ -1,11 +0,25 @@

import CodeBlock from '@tiptap/extension-code-block'
import lowlight from 'lowlight/lib/core'
import CodeBlock, { CodeBlockOptions } from '@tiptap/extension-code-block'
import { LowlightPlugin } from './lowlight-plugin'
export const CodeBlockLowlight = CodeBlock.extend({
export interface CodeBlockLowlightOptions extends CodeBlockOptions {
lowlight: any,
}
export const CodeBlockLowlight = CodeBlock.extend<CodeBlockLowlightOptions>({
defaultOptions: {
...CodeBlock.config.defaultOptions,
lowlight,
},
addProseMirrorPlugins() {
return [
...this.parentConfig.addProseMirrorPlugins?.() || [],
LowlightPlugin({ name: 'codeBlock' }),
// disable for now, see: https://github.com/ueberdosis/tiptap-next/issues/259#issuecomment-817954835
// ...this.parentConfig.addProseMirrorPlugins?.() || [],
LowlightPlugin({
name: 'codeBlock',
lowlight: this.options.lowlight,
}),
]
},
})

@@ -5,3 +5,2 @@ import { Plugin, PluginKey } from 'prosemirror-state'

import { findChildren } from '@tiptap/core'
import lowlight from 'lowlight/lib/core'

@@ -30,3 +29,3 @@ function parseNodes(nodes: any[], className: string[] = []): { text: string, classes: string[] }[] {

function getDecorations({ doc, name }: { doc: ProsemirrorNode, name: string}) {
function getDecorations({ doc, name, lowlight }: { doc: ProsemirrorNode, name: string, lowlight: any }) {
const decorations: Decoration[] = []

@@ -63,3 +62,3 @@

export function LowlightPlugin({ name }: { name: string }) {
export function LowlightPlugin({ name, lowlight }: { name: string, lowlight: any }) {
return new Plugin({

@@ -69,3 +68,3 @@ key: new PluginKey('lowlight'),

state: {
init: (_, { doc }) => getDecorations({ doc, name }),
init: (_, { doc }) => getDecorations({ doc, name, lowlight }),
apply: (transaction, decorationSet, oldState, newState) => {

@@ -102,3 +101,3 @@ const oldNodeName = oldState.selection.$head.parent.type.name

) {
return getDecorations({ doc: transaction.doc, name })
return getDecorations({ doc: transaction.doc, name, lowlight })
}

@@ -105,0 +104,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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