You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@tiptap/extension-code-block

Package Overview
Dependencies
Maintainers
5
Versions
320
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version
3.6.7
to
3.7.0
+26
-0
dist/index.cjs

@@ -97,2 +97,28 @@ "use strict";

},
markdownTokenName: "code",
parseMarkdown: (token, helpers) => {
var _a;
if (((_a = token.raw) == null ? void 0 : _a.startsWith("```")) === false && token.codeBlockStyle !== "indented") {
return [];
}
return helpers.createNode(
"codeBlock",
{ language: token.lang || null },
token.text ? [helpers.createTextNode(token.text)] : []
);
},
renderMarkdown: (node, h) => {
var _a;
let output = "";
const language = ((_a = node.attrs) == null ? void 0 : _a.language) || "";
if (!node.content) {
output = `\`\`\`${language}
\`\`\``;
} else {
const lines = [`\`\`\`${language}`, h.renderChildren(node.content), "```"];
output = lines.join("\n");
}
return output;
},
addCommands() {

@@ -99,0 +125,0 @@ return {

@@ -68,2 +68,28 @@ // src/code-block.ts

},
markdownTokenName: "code",
parseMarkdown: (token, helpers) => {
var _a;
if (((_a = token.raw) == null ? void 0 : _a.startsWith("```")) === false && token.codeBlockStyle !== "indented") {
return [];
}
return helpers.createNode(
"codeBlock",
{ language: token.lang || null },
token.text ? [helpers.createTextNode(token.text)] : []
);
},
renderMarkdown: (node, h) => {
var _a;
let output = "";
const language = ((_a = node.attrs) == null ? void 0 : _a.language) || "";
if (!node.content) {
output = `\`\`\`${language}
\`\`\``;
} else {
const lines = [`\`\`\`${language}`, h.renderChildren(node.content), "```"];
output = lines.join("\n");
}
return output;
},
addCommands() {

@@ -70,0 +96,0 @@ return {

+5
-5
{
"name": "@tiptap/extension-code-block",
"description": "code block extension for tiptap",
"version": "3.6.7",
"version": "3.7.0",
"homepage": "https://tiptap.dev",

@@ -34,8 +34,8 @@ "keywords": [

"devDependencies": {
"@tiptap/core": "^3.6.7",
"@tiptap/pm": "^3.6.7"
"@tiptap/core": "^3.7.0",
"@tiptap/pm": "^3.7.0"
},
"peerDependencies": {
"@tiptap/core": "^3.6.7",
"@tiptap/pm": "^3.6.7"
"@tiptap/core": "^3.7.0",
"@tiptap/pm": "^3.7.0"
},

@@ -42,0 +42,0 @@ "repository": {

@@ -155,2 +155,30 @@ import { mergeAttributes, Node, textblockTypeInputRule } from '@tiptap/core'

markdownTokenName: 'code',
parseMarkdown: (token, helpers) => {
if (token.raw?.startsWith('```') === false && token.codeBlockStyle !== 'indented') {
return []
}
return helpers.createNode(
'codeBlock',
{ language: token.lang || null },
token.text ? [helpers.createTextNode(token.text)] : [],
)
},
renderMarkdown: (node, h) => {
let output = ''
const language = node.attrs?.language || ''
if (!node.content) {
output = `\`\`\`${language}\n\n\`\`\``
} else {
const lines = [`\`\`\`${language}`, h.renderChildren(node.content), '```']
output = lines.join('\n')
}
return output
},
addCommands() {

@@ -157,0 +185,0 @@ return {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet