@sciexpr/markdown 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +142 -0
- package/dist/index.d.cts +44 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +117 -0
- package/package.json +66 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
formulaPlugin: () => formulaPlugin
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
function formulaPlugin(md, options = {}) {
|
|
27
|
+
const {
|
|
28
|
+
enableChemistry = false,
|
|
29
|
+
enableNumbering = false,
|
|
30
|
+
inlineDelimiter = "$",
|
|
31
|
+
blockDelimiter = "$$"
|
|
32
|
+
} = options;
|
|
33
|
+
let formulaCounter = 0;
|
|
34
|
+
md.block.ruler.before("fence", "formula_block", (state, startLine, endLine, silent) => {
|
|
35
|
+
const pos = state.bMarks[startLine];
|
|
36
|
+
const max = state.eMarks[startLine];
|
|
37
|
+
const lineText = state.src.slice(pos, max);
|
|
38
|
+
if (!lineText.startsWith(blockDelimiter)) return false;
|
|
39
|
+
let nextLine = startLine;
|
|
40
|
+
let formula = lineText.slice(blockDelimiter.length);
|
|
41
|
+
const closingIdx = formula.lastIndexOf(blockDelimiter);
|
|
42
|
+
if (closingIdx !== -1) {
|
|
43
|
+
formula = formula.slice(0, closingIdx);
|
|
44
|
+
} else {
|
|
45
|
+
for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
|
|
46
|
+
const nextPos = state.bMarks[nextLine];
|
|
47
|
+
const nextMax = state.eMarks[nextLine];
|
|
48
|
+
const nextText = state.src.slice(nextPos, nextMax);
|
|
49
|
+
if (nextText.includes(blockDelimiter)) {
|
|
50
|
+
const beforeClose = nextText.slice(0, nextText.lastIndexOf(blockDelimiter));
|
|
51
|
+
formula += "\n" + beforeClose;
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
formula += "\n" + nextText;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
formula = formula.replace(/^\n+|\n+$/g, "").trim();
|
|
58
|
+
if (silent) return true;
|
|
59
|
+
const token = state.push("formula_block", "div", 0);
|
|
60
|
+
token.attrSet("class", "sciexpr-formula sciexpr-block");
|
|
61
|
+
token.content = formula;
|
|
62
|
+
token.block = true;
|
|
63
|
+
if (enableNumbering) {
|
|
64
|
+
formulaCounter++;
|
|
65
|
+
token.attrSet("data-formula-id", `formula-${formulaCounter}`);
|
|
66
|
+
}
|
|
67
|
+
state.line = nextLine + 1;
|
|
68
|
+
return true;
|
|
69
|
+
});
|
|
70
|
+
md.inline.ruler.before("escape", "formula_inline", (state, silent) => {
|
|
71
|
+
const pos = state.pos;
|
|
72
|
+
const src = state.src;
|
|
73
|
+
if (src.slice(pos, pos + inlineDelimiter.length) !== inlineDelimiter) return false;
|
|
74
|
+
if (src.slice(pos, pos + 2) === "$$") return false;
|
|
75
|
+
const start = pos + inlineDelimiter.length;
|
|
76
|
+
let end = src.indexOf(inlineDelimiter, start);
|
|
77
|
+
if (end === -1) return false;
|
|
78
|
+
const formula = src.slice(start, end).trim();
|
|
79
|
+
if (!formula) return false;
|
|
80
|
+
if (!silent) {
|
|
81
|
+
const token = state.push("formula_inline", "span", 0);
|
|
82
|
+
token.attrSet("class", "sciexpr-formula sciexpr-inline");
|
|
83
|
+
token.content = formula;
|
|
84
|
+
}
|
|
85
|
+
state.pos = end + inlineDelimiter.length;
|
|
86
|
+
return true;
|
|
87
|
+
});
|
|
88
|
+
if (enableChemistry) {
|
|
89
|
+
md.inline.ruler.before("formula_inline", "chemistry_inline", (state, silent) => {
|
|
90
|
+
const pos = state.pos;
|
|
91
|
+
const src = state.src;
|
|
92
|
+
if (src.slice(pos, pos + 4) !== "\\ce{") return false;
|
|
93
|
+
let depth = 1;
|
|
94
|
+
let end = pos + 4;
|
|
95
|
+
while (end < src.length && depth > 0) {
|
|
96
|
+
if (src[end] === "{") depth++;
|
|
97
|
+
else if (src[end] === "}") depth--;
|
|
98
|
+
end++;
|
|
99
|
+
}
|
|
100
|
+
if (depth !== 0) return false;
|
|
101
|
+
const formula = src.slice(pos + 4, end - 1).trim();
|
|
102
|
+
if (!formula) return false;
|
|
103
|
+
if (!silent) {
|
|
104
|
+
const token = state.push("chemistry_inline", "span", 0);
|
|
105
|
+
token.attrSet("class", "sciexpr-formula sciexpr-chemistry");
|
|
106
|
+
token.content = `\\ce{${formula}}`;
|
|
107
|
+
}
|
|
108
|
+
state.pos = end;
|
|
109
|
+
return true;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
md.renderer.rules.formula_block = (tokens, idx) => {
|
|
113
|
+
const token = tokens[idx];
|
|
114
|
+
const formula = token.content.replace(/\n/g, " ").trim();
|
|
115
|
+
const formulaId = token.attrGet("data-formula-id");
|
|
116
|
+
const latex = options.katexRenderer ? "" : `<code class="sciexpr-latex-source">${escapeHtml(formula)}</code>`;
|
|
117
|
+
const numberHtml = formulaId ? `<span class="sciexpr-formula-number">(${formulaId.replace("formula-", "")})</span>` : "";
|
|
118
|
+
return `<div class="sciexpr-formula sciexpr-block" data-formula="${escapeAttr(formula)}"${formulaId ? ` data-formula-id="${escapeAttr(formulaId)}"` : ""}>${numberHtml}${latex}</div>`;
|
|
119
|
+
};
|
|
120
|
+
md.renderer.rules.formula_inline = (tokens, idx) => {
|
|
121
|
+
const token = tokens[idx];
|
|
122
|
+
const formula = token.content.replace(/\n/g, " ").trim();
|
|
123
|
+
return `<span class="sciexpr-formula sciexpr-inline" data-formula="${escapeAttr(formula)}">${escapeHtml(formula)}</span>`;
|
|
124
|
+
};
|
|
125
|
+
if (enableChemistry) {
|
|
126
|
+
md.renderer.rules.chemistry_inline = (tokens, idx) => {
|
|
127
|
+
const token = tokens[idx];
|
|
128
|
+
const formula = token.content.replace(/\n/g, " ").trim();
|
|
129
|
+
return `<span class="sciexpr-formula sciexpr-chemistry" data-formula="${escapeAttr(formula)}">${escapeHtml(formula)}</span>`;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function escapeHtml(text) {
|
|
134
|
+
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
135
|
+
}
|
|
136
|
+
function escapeAttr(text) {
|
|
137
|
+
return text.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
138
|
+
}
|
|
139
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
140
|
+
0 && (module.exports = {
|
|
141
|
+
formulaPlugin
|
|
142
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import MarkdownIt from 'markdown-it';
|
|
2
|
+
import { KatexRenderer, RenderOptions } from '@sciexpr/renderer';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* markdown-it 插件配置
|
|
6
|
+
*/
|
|
7
|
+
interface MarkdownFormulaOptions {
|
|
8
|
+
/** KaTeX 渲染器实例 */
|
|
9
|
+
katexRenderer?: KatexRenderer;
|
|
10
|
+
/** 渲染选项 */
|
|
11
|
+
renderOptions?: RenderOptions;
|
|
12
|
+
/** 是否启用化学式自动识别 */
|
|
13
|
+
enableChemistry?: boolean;
|
|
14
|
+
/** 是否启用公式编号 */
|
|
15
|
+
enableNumbering?: boolean;
|
|
16
|
+
/** 自定义行内公式分隔符(默认 $) */
|
|
17
|
+
inlineDelimiter?: string;
|
|
18
|
+
/** 自定义块级公式分隔符(默认 $$) */
|
|
19
|
+
blockDelimiter?: string;
|
|
20
|
+
/** 是否提取公式元数据到 token.meta */
|
|
21
|
+
extractMeta?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 科学公式 markdown-it 插件
|
|
25
|
+
*
|
|
26
|
+
* 支持:
|
|
27
|
+
* - 行内公式 $...$ → KaTeX HTML
|
|
28
|
+
* - 块级公式 $$...$$ → KaTeX HTML(display mode)
|
|
29
|
+
* - 可选的化学式自动识别(\ce{...})
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* import MarkdownIt from 'markdown-it';
|
|
34
|
+
* import { formulaPlugin } from '@sciexpr/markdown';
|
|
35
|
+
*
|
|
36
|
+
* const md = new MarkdownIt();
|
|
37
|
+
* md.use(formulaPlugin, { renderOptions: { displayMode: false } });
|
|
38
|
+
*
|
|
39
|
+
* const html = md.render('E = $mc^2$');
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function formulaPlugin(md: MarkdownIt, options?: MarkdownFormulaOptions): void;
|
|
43
|
+
|
|
44
|
+
export { type MarkdownFormulaOptions, formulaPlugin };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import MarkdownIt from 'markdown-it';
|
|
2
|
+
import { KatexRenderer, RenderOptions } from '@sciexpr/renderer';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* markdown-it 插件配置
|
|
6
|
+
*/
|
|
7
|
+
interface MarkdownFormulaOptions {
|
|
8
|
+
/** KaTeX 渲染器实例 */
|
|
9
|
+
katexRenderer?: KatexRenderer;
|
|
10
|
+
/** 渲染选项 */
|
|
11
|
+
renderOptions?: RenderOptions;
|
|
12
|
+
/** 是否启用化学式自动识别 */
|
|
13
|
+
enableChemistry?: boolean;
|
|
14
|
+
/** 是否启用公式编号 */
|
|
15
|
+
enableNumbering?: boolean;
|
|
16
|
+
/** 自定义行内公式分隔符(默认 $) */
|
|
17
|
+
inlineDelimiter?: string;
|
|
18
|
+
/** 自定义块级公式分隔符(默认 $$) */
|
|
19
|
+
blockDelimiter?: string;
|
|
20
|
+
/** 是否提取公式元数据到 token.meta */
|
|
21
|
+
extractMeta?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 科学公式 markdown-it 插件
|
|
25
|
+
*
|
|
26
|
+
* 支持:
|
|
27
|
+
* - 行内公式 $...$ → KaTeX HTML
|
|
28
|
+
* - 块级公式 $$...$$ → KaTeX HTML(display mode)
|
|
29
|
+
* - 可选的化学式自动识别(\ce{...})
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* import MarkdownIt from 'markdown-it';
|
|
34
|
+
* import { formulaPlugin } from '@sciexpr/markdown';
|
|
35
|
+
*
|
|
36
|
+
* const md = new MarkdownIt();
|
|
37
|
+
* md.use(formulaPlugin, { renderOptions: { displayMode: false } });
|
|
38
|
+
*
|
|
39
|
+
* const html = md.render('E = $mc^2$');
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function formulaPlugin(md: MarkdownIt, options?: MarkdownFormulaOptions): void;
|
|
43
|
+
|
|
44
|
+
export { type MarkdownFormulaOptions, formulaPlugin };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
function formulaPlugin(md, options = {}) {
|
|
3
|
+
const {
|
|
4
|
+
enableChemistry = false,
|
|
5
|
+
enableNumbering = false,
|
|
6
|
+
inlineDelimiter = "$",
|
|
7
|
+
blockDelimiter = "$$"
|
|
8
|
+
} = options;
|
|
9
|
+
let formulaCounter = 0;
|
|
10
|
+
md.block.ruler.before("fence", "formula_block", (state, startLine, endLine, silent) => {
|
|
11
|
+
const pos = state.bMarks[startLine];
|
|
12
|
+
const max = state.eMarks[startLine];
|
|
13
|
+
const lineText = state.src.slice(pos, max);
|
|
14
|
+
if (!lineText.startsWith(blockDelimiter)) return false;
|
|
15
|
+
let nextLine = startLine;
|
|
16
|
+
let formula = lineText.slice(blockDelimiter.length);
|
|
17
|
+
const closingIdx = formula.lastIndexOf(blockDelimiter);
|
|
18
|
+
if (closingIdx !== -1) {
|
|
19
|
+
formula = formula.slice(0, closingIdx);
|
|
20
|
+
} else {
|
|
21
|
+
for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
|
|
22
|
+
const nextPos = state.bMarks[nextLine];
|
|
23
|
+
const nextMax = state.eMarks[nextLine];
|
|
24
|
+
const nextText = state.src.slice(nextPos, nextMax);
|
|
25
|
+
if (nextText.includes(blockDelimiter)) {
|
|
26
|
+
const beforeClose = nextText.slice(0, nextText.lastIndexOf(blockDelimiter));
|
|
27
|
+
formula += "\n" + beforeClose;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
formula += "\n" + nextText;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
formula = formula.replace(/^\n+|\n+$/g, "").trim();
|
|
34
|
+
if (silent) return true;
|
|
35
|
+
const token = state.push("formula_block", "div", 0);
|
|
36
|
+
token.attrSet("class", "sciexpr-formula sciexpr-block");
|
|
37
|
+
token.content = formula;
|
|
38
|
+
token.block = true;
|
|
39
|
+
if (enableNumbering) {
|
|
40
|
+
formulaCounter++;
|
|
41
|
+
token.attrSet("data-formula-id", `formula-${formulaCounter}`);
|
|
42
|
+
}
|
|
43
|
+
state.line = nextLine + 1;
|
|
44
|
+
return true;
|
|
45
|
+
});
|
|
46
|
+
md.inline.ruler.before("escape", "formula_inline", (state, silent) => {
|
|
47
|
+
const pos = state.pos;
|
|
48
|
+
const src = state.src;
|
|
49
|
+
if (src.slice(pos, pos + inlineDelimiter.length) !== inlineDelimiter) return false;
|
|
50
|
+
if (src.slice(pos, pos + 2) === "$$") return false;
|
|
51
|
+
const start = pos + inlineDelimiter.length;
|
|
52
|
+
let end = src.indexOf(inlineDelimiter, start);
|
|
53
|
+
if (end === -1) return false;
|
|
54
|
+
const formula = src.slice(start, end).trim();
|
|
55
|
+
if (!formula) return false;
|
|
56
|
+
if (!silent) {
|
|
57
|
+
const token = state.push("formula_inline", "span", 0);
|
|
58
|
+
token.attrSet("class", "sciexpr-formula sciexpr-inline");
|
|
59
|
+
token.content = formula;
|
|
60
|
+
}
|
|
61
|
+
state.pos = end + inlineDelimiter.length;
|
|
62
|
+
return true;
|
|
63
|
+
});
|
|
64
|
+
if (enableChemistry) {
|
|
65
|
+
md.inline.ruler.before("formula_inline", "chemistry_inline", (state, silent) => {
|
|
66
|
+
const pos = state.pos;
|
|
67
|
+
const src = state.src;
|
|
68
|
+
if (src.slice(pos, pos + 4) !== "\\ce{") return false;
|
|
69
|
+
let depth = 1;
|
|
70
|
+
let end = pos + 4;
|
|
71
|
+
while (end < src.length && depth > 0) {
|
|
72
|
+
if (src[end] === "{") depth++;
|
|
73
|
+
else if (src[end] === "}") depth--;
|
|
74
|
+
end++;
|
|
75
|
+
}
|
|
76
|
+
if (depth !== 0) return false;
|
|
77
|
+
const formula = src.slice(pos + 4, end - 1).trim();
|
|
78
|
+
if (!formula) return false;
|
|
79
|
+
if (!silent) {
|
|
80
|
+
const token = state.push("chemistry_inline", "span", 0);
|
|
81
|
+
token.attrSet("class", "sciexpr-formula sciexpr-chemistry");
|
|
82
|
+
token.content = `\\ce{${formula}}`;
|
|
83
|
+
}
|
|
84
|
+
state.pos = end;
|
|
85
|
+
return true;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
md.renderer.rules.formula_block = (tokens, idx) => {
|
|
89
|
+
const token = tokens[idx];
|
|
90
|
+
const formula = token.content.replace(/\n/g, " ").trim();
|
|
91
|
+
const formulaId = token.attrGet("data-formula-id");
|
|
92
|
+
const latex = options.katexRenderer ? "" : `<code class="sciexpr-latex-source">${escapeHtml(formula)}</code>`;
|
|
93
|
+
const numberHtml = formulaId ? `<span class="sciexpr-formula-number">(${formulaId.replace("formula-", "")})</span>` : "";
|
|
94
|
+
return `<div class="sciexpr-formula sciexpr-block" data-formula="${escapeAttr(formula)}"${formulaId ? ` data-formula-id="${escapeAttr(formulaId)}"` : ""}>${numberHtml}${latex}</div>`;
|
|
95
|
+
};
|
|
96
|
+
md.renderer.rules.formula_inline = (tokens, idx) => {
|
|
97
|
+
const token = tokens[idx];
|
|
98
|
+
const formula = token.content.replace(/\n/g, " ").trim();
|
|
99
|
+
return `<span class="sciexpr-formula sciexpr-inline" data-formula="${escapeAttr(formula)}">${escapeHtml(formula)}</span>`;
|
|
100
|
+
};
|
|
101
|
+
if (enableChemistry) {
|
|
102
|
+
md.renderer.rules.chemistry_inline = (tokens, idx) => {
|
|
103
|
+
const token = tokens[idx];
|
|
104
|
+
const formula = token.content.replace(/\n/g, " ").trim();
|
|
105
|
+
return `<span class="sciexpr-formula sciexpr-chemistry" data-formula="${escapeAttr(formula)}">${escapeHtml(formula)}</span>`;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function escapeHtml(text) {
|
|
110
|
+
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
111
|
+
}
|
|
112
|
+
function escapeAttr(text) {
|
|
113
|
+
return text.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
114
|
+
}
|
|
115
|
+
export {
|
|
116
|
+
formulaPlugin
|
|
117
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sciexpr/markdown",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Scientific Expression Engine - markdown-it plugin for formula rendering",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [
|
|
22
|
+
"scientific",
|
|
23
|
+
"expression",
|
|
24
|
+
"markdown",
|
|
25
|
+
"markdown-it",
|
|
26
|
+
"katex"
|
|
27
|
+
],
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"author": {
|
|
30
|
+
"name": "haoguodong09-svg",
|
|
31
|
+
"email": "haoguodong09@gmail.com"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/haoguodong09-svg/scientific-expression-engine#readme",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/haoguodong09-svg/scientific-expression-engine/issues"
|
|
36
|
+
},
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/haoguodong09-svg/scientific-expression-engine",
|
|
40
|
+
"directory": "packages/markdown"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@sciexpr/renderer": "0.1.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"markdown-it": "^14.0.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"markdown-it": "^14.0.0",
|
|
53
|
+
"@types/markdown-it": "^14.0.0",
|
|
54
|
+
"tsup": "^8.0.0",
|
|
55
|
+
"typescript": "^5.5.0",
|
|
56
|
+
"vitest": "^2.0.0",
|
|
57
|
+
"rimraf": "^5.0.0"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsup",
|
|
61
|
+
"dev": "tsup --watch",
|
|
62
|
+
"lint": "tsc --noEmit",
|
|
63
|
+
"clean": "rimraf dist",
|
|
64
|
+
"test": "vitest run"
|
|
65
|
+
}
|
|
66
|
+
}
|