Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@mdream/js

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mdream/js - npm Package Compare versions

Comparing version
1.0.4
to
1.0.5
+26
-3
dist/_chunks/parse.mjs

@@ -152,8 +152,26 @@ import { a as NO_SPACING, c as TABLE_ROW_SPACING, g as TagIdMap, i as LIST_ITEM_SPACING, t as BLOCKQUOTE_SPACING } from "./const.mjs";

[23]: {
enter: ({ node }) => {
if ((node.depthMap[34] || 0) > 0) return `\`\`\`${getLanguageFromClass(node.attributes?.class)}\n`;
enter: ({ node, state }) => {
if ((node.depthMap[34] || 0) > 0) {
const language = getLanguageFromClass(node.attributes?.class);
const liDepth = node.depthMap[25] || 0;
if (liDepth > 0) return `\n\n${" ".repeat(liDepth)}\`\`\`${language}\n`;
return `\`\`\`${language}\n`;
}
if ((node.depthMap[25] || 0) > 0) {
const lastEntry = state.buffer.at(-1);
const lastChar = lastEntry?.charAt(lastEntry.length - 1) || "";
if (lastChar && lastChar !== " " && lastChar !== "\n") return ` \``;
}
return "`";
},
exit: ({ node }) => {
return (node.depthMap[34] || 0) > 0 ? `\n\`\`\`` : "`";
if ((node.depthMap[34] || 0) > 0) {
const liDepth = node.depthMap[25] || 0;
if (liDepth > 0) {
const indent = " ".repeat(liDepth);
return `\n${indent}\`\`\`\n\n${indent}`;
}
return `\n\`\`\``;
}
return "`";
},

@@ -285,2 +303,7 @@ collapsesInnerWhiteSpace: true,

}
if ((node.depthMap[25] || 0) > 0) {
const lastEntry = state.buffer.at(-1);
const lastChar = lastEntry?.charAt(lastEntry.length - 1) || "";
if (lastChar && lastChar !== " " && lastChar !== "\n") return " ";
}
} },

@@ -287,0 +310,0 @@ [36]: {},

@@ -122,2 +122,8 @@ import { a as NO_SPACING, n as DEFAULT_BLOCK_SPACING } from "./const.mjs";

if (shouldAddSpacingBeforeText(lastChar, lastNode, textNode)) textNode.value = ` ${textNode.value}`;
if ((state.depthMap[34] || 0) > 0 && (state.depthMap[25] || 0) > 0) {
const indent = " ".repeat(state.depthMap[25]);
let value = textNode.value.replace(/\n(?=[^ \t\n])/g, `\n${indent}`);
if (lastChar === "\n" && value[0] && value[0] !== " " && value[0] !== " " && value[0] !== "\n") value = indent + value;
textNode.value = value;
}
state.buffer.push(textNode.value);

@@ -124,0 +130,0 @@ state.lastContentCache = textNode.value;

+1
-1

@@ -278,3 +278,3 @@ import "./const.mjs";

const parseState = {
depthMap: new Uint8Array(1024),
depthMap: processor.state.depthMap,
depth: 0,

@@ -281,0 +281,0 @@ resolvedPlugins,

{
"name": "@mdream/js",
"type": "module",
"version": "1.0.4",
"version": "1.0.5",
"description": "JavaScript HTML-to-Markdown engine for mdream. Escape hatch for hooks and edge runtimes.",

@@ -6,0 +6,0 @@ "author": {