pd-markdown 1.1.0 → 2.0.1
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/README.md +52 -170
- package/package.json +12 -11
- package/packages/parser/README.md +120 -0
- package/packages/utils/README.md +130 -0
- package/packages/web/README.md +110 -0
- package/packages/parser/dist/index.cjs +0 -191
- package/packages/parser/dist/index.cjs.map +0 -1
- package/packages/parser/dist/index.d.ts +0 -4
- package/packages/parser/dist/index.d.ts.map +0 -1
- package/packages/parser/dist/index.mjs +0 -185
- package/packages/parser/dist/index.mjs.map +0 -1
- package/packages/parser/dist/plugins/index.d.ts +0 -4
- package/packages/parser/dist/plugins/index.d.ts.map +0 -1
- package/packages/parser/dist/plugins/transform/heading.d.ts +0 -6
- package/packages/parser/dist/plugins/transform/heading.d.ts.map +0 -1
- package/packages/parser/dist/plugins/transform/list.d.ts +0 -14
- package/packages/parser/dist/plugins/transform/list.d.ts.map +0 -1
- package/packages/parser/dist/plugins/transform/table.d.ts +0 -27
- package/packages/parser/dist/plugins/transform/table.d.ts.map +0 -1
- package/packages/parser/dist/processor.d.ts +0 -22
- package/packages/parser/dist/processor.d.ts.map +0 -1
- package/packages/parser/dist/types/index.d.ts +0 -55
- package/packages/parser/dist/types/index.d.ts.map +0 -1
- package/packages/utils/dist/ast/query.d.ts +0 -36
- package/packages/utils/dist/ast/query.d.ts.map +0 -1
- package/packages/utils/dist/ast/traverse.d.ts +0 -22
- package/packages/utils/dist/ast/traverse.d.ts.map +0 -1
- package/packages/utils/dist/index.cjs +0 -358
- package/packages/utils/dist/index.cjs.map +0 -1
- package/packages/utils/dist/index.d.ts +0 -7
- package/packages/utils/dist/index.d.ts.map +0 -1
- package/packages/utils/dist/index.mjs +0 -343
- package/packages/utils/dist/index.mjs.map +0 -1
- package/packages/utils/dist/string/sanitize.d.ts +0 -22
- package/packages/utils/dist/string/sanitize.d.ts.map +0 -1
- package/packages/utils/dist/string/slugify.d.ts +0 -16
- package/packages/utils/dist/string/slugify.d.ts.map +0 -1
- package/packages/utils/dist/types/index.d.ts +0 -49
- package/packages/utils/dist/types/index.d.ts.map +0 -1
- package/packages/web/dist/components/MarkdownRenderer.d.ts +0 -27
- package/packages/web/dist/components/MarkdownRenderer.d.ts.map +0 -1
- package/packages/web/dist/components/NodeRenderer.d.ts +0 -10
- package/packages/web/dist/components/NodeRenderer.d.ts.map +0 -1
- package/packages/web/dist/components/context.d.ts +0 -17
- package/packages/web/dist/components/context.d.ts.map +0 -1
- package/packages/web/dist/components/defaults/Blockquote.d.ts +0 -8
- package/packages/web/dist/components/defaults/Blockquote.d.ts.map +0 -1
- package/packages/web/dist/components/defaults/Code.d.ts +0 -13
- package/packages/web/dist/components/defaults/Code.d.ts.map +0 -1
- package/packages/web/dist/components/defaults/Heading.d.ts +0 -8
- package/packages/web/dist/components/defaults/Heading.d.ts.map +0 -1
- package/packages/web/dist/components/defaults/Image.d.ts +0 -7
- package/packages/web/dist/components/defaults/Image.d.ts.map +0 -1
- package/packages/web/dist/components/defaults/Link.d.ts +0 -8
- package/packages/web/dist/components/defaults/Link.d.ts.map +0 -1
- package/packages/web/dist/components/defaults/List.d.ts +0 -13
- package/packages/web/dist/components/defaults/List.d.ts.map +0 -1
- package/packages/web/dist/components/defaults/Paragraph.d.ts +0 -8
- package/packages/web/dist/components/defaults/Paragraph.d.ts.map +0 -1
- package/packages/web/dist/components/defaults/Table.d.ts +0 -19
- package/packages/web/dist/components/defaults/Table.d.ts.map +0 -1
- package/packages/web/dist/components/defaults/index.d.ts +0 -34
- package/packages/web/dist/components/defaults/index.d.ts.map +0 -1
- package/packages/web/dist/hooks/useMarkdown.d.ts +0 -11
- package/packages/web/dist/hooks/useMarkdown.d.ts.map +0 -1
- package/packages/web/dist/index.cjs +0 -306
- package/packages/web/dist/index.cjs.map +0 -1
- package/packages/web/dist/index.d.ts +0 -6
- package/packages/web/dist/index.d.ts.map +0 -1
- package/packages/web/dist/index.mjs +0 -287
- package/packages/web/dist/index.mjs.map +0 -1
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type guard to check if node is a parent node
|
|
3
|
-
*/
|
|
4
|
-
function isParent(node) {
|
|
5
|
-
return 'children' in node && Array.isArray(node.children);
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Type guard to check if node is a literal node
|
|
9
|
-
*/
|
|
10
|
-
function isLiteral(node) {
|
|
11
|
-
return 'value' in node && typeof node.value === 'string';
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Type guard to check if node has specific type
|
|
15
|
-
*/
|
|
16
|
-
function isNodeType(node, type) {
|
|
17
|
-
return node.type === type;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Traverse AST in depth-first order
|
|
22
|
-
*
|
|
23
|
-
* @param node - Root node to start traversal
|
|
24
|
-
* @param visitor - Visitor function called for each node
|
|
25
|
-
* Return `false` to skip children of current node
|
|
26
|
-
* Return `true` or `undefined` to continue
|
|
27
|
-
*/
|
|
28
|
-
function traverseAst(node, visitor) {
|
|
29
|
-
function visit(current, index, parent) {
|
|
30
|
-
const result = visitor(current, index, parent);
|
|
31
|
-
// Skip children if visitor returns false
|
|
32
|
-
if (result === false) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (isParent(current)) {
|
|
36
|
-
const children = current.children;
|
|
37
|
-
for (let i = 0; i < children.length; i++) {
|
|
38
|
-
visit(children[i], i, current);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
visit(node, undefined, undefined);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Traverse AST with enter and leave callbacks
|
|
46
|
-
*
|
|
47
|
-
* @param node - Root node to start traversal
|
|
48
|
-
* @param callbacks - Object with optional enter and leave functions
|
|
49
|
-
*/
|
|
50
|
-
function traverseAstWithCallbacks(node, callbacks) {
|
|
51
|
-
const { enter, leave } = callbacks;
|
|
52
|
-
function visit(current, index, parent) {
|
|
53
|
-
const shouldSkipChildren = enter?.(current, index, parent) === false;
|
|
54
|
-
if (!shouldSkipChildren && isParent(current)) {
|
|
55
|
-
const children = current.children;
|
|
56
|
-
for (let i = 0; i < children.length; i++) {
|
|
57
|
-
visit(children[i], i, current);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
leave?.(current, index, parent);
|
|
61
|
-
}
|
|
62
|
-
visit(node, undefined, undefined);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Find all nodes of a specific type in the AST
|
|
67
|
-
*
|
|
68
|
-
* @param node - Root node to search from
|
|
69
|
-
* @param type - Node type to find
|
|
70
|
-
* @returns Array of matching nodes
|
|
71
|
-
*/
|
|
72
|
-
function findNodes(node, type) {
|
|
73
|
-
const results = [];
|
|
74
|
-
function visit(current) {
|
|
75
|
-
if (current.type === type) {
|
|
76
|
-
results.push(current);
|
|
77
|
-
}
|
|
78
|
-
if (isParent(current)) {
|
|
79
|
-
for (const child of current.children) {
|
|
80
|
-
visit(child);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
visit(node);
|
|
85
|
-
return results;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Find the first node of a specific type in the AST
|
|
89
|
-
*
|
|
90
|
-
* @param node - Root node to search from
|
|
91
|
-
* @param type - Node type to find
|
|
92
|
-
* @returns The first matching node or undefined
|
|
93
|
-
*/
|
|
94
|
-
function findNode(node, type) {
|
|
95
|
-
let result;
|
|
96
|
-
function visit(current) {
|
|
97
|
-
if (current.type === type) {
|
|
98
|
-
result = current;
|
|
99
|
-
return true; // Found, stop searching
|
|
100
|
-
}
|
|
101
|
-
if (isParent(current)) {
|
|
102
|
-
for (const child of current.children) {
|
|
103
|
-
if (visit(child)) {
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
visit(node);
|
|
111
|
-
return result;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Find all nodes matching a predicate
|
|
115
|
-
*
|
|
116
|
-
* @param node - Root node to search from
|
|
117
|
-
* @param predicate - Function to test each node
|
|
118
|
-
* @returns Array of matching nodes
|
|
119
|
-
*/
|
|
120
|
-
function findNodesBy(node, predicate) {
|
|
121
|
-
const results = [];
|
|
122
|
-
function visit(current) {
|
|
123
|
-
if (predicate(current)) {
|
|
124
|
-
results.push(current);
|
|
125
|
-
}
|
|
126
|
-
if (isParent(current)) {
|
|
127
|
-
for (const child of current.children) {
|
|
128
|
-
visit(child);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
visit(node);
|
|
133
|
-
return results;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Get the parent of a node in the AST
|
|
137
|
-
* Note: This requires traversing from root, use sparingly
|
|
138
|
-
*
|
|
139
|
-
* @param root - Root node of the AST
|
|
140
|
-
* @param target - Node to find parent of
|
|
141
|
-
* @returns Parent node or undefined if not found or is root
|
|
142
|
-
*/
|
|
143
|
-
function findParent(root, target) {
|
|
144
|
-
let result;
|
|
145
|
-
function visit(current, parent) {
|
|
146
|
-
if (current === target) {
|
|
147
|
-
result = parent;
|
|
148
|
-
return true;
|
|
149
|
-
}
|
|
150
|
-
if (isParent(current)) {
|
|
151
|
-
for (const child of current.children) {
|
|
152
|
-
if (visit(child, current)) {
|
|
153
|
-
return true;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
visit(root, undefined);
|
|
160
|
-
return result;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Convert text to URL-safe slug
|
|
165
|
-
*
|
|
166
|
-
* @param text - Text to slugify
|
|
167
|
-
* @returns URL-safe slug
|
|
168
|
-
*/
|
|
169
|
-
function slugify(text) {
|
|
170
|
-
return (text
|
|
171
|
-
// Convert to lowercase
|
|
172
|
-
.toLowerCase()
|
|
173
|
-
// Replace Chinese characters with pinyin-like representation (keep as-is for simplicity)
|
|
174
|
-
// Replace spaces and special chars with hyphens
|
|
175
|
-
.replace(/[\s_]+/g, '-')
|
|
176
|
-
// Remove characters that aren't alphanumeric, hyphens, or common CJK
|
|
177
|
-
.replace(/[^\w\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff-]/g, '')
|
|
178
|
-
// Replace multiple consecutive hyphens with single hyphen
|
|
179
|
-
.replace(/-+/g, '-')
|
|
180
|
-
// Remove leading/trailing hyphens
|
|
181
|
-
.replace(/^-+|-+$/g, ''));
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Generate unique slug with counter suffix for duplicates
|
|
185
|
-
*
|
|
186
|
-
* @param text - Text to slugify
|
|
187
|
-
* @param existingSlugs - Set of existing slugs to check against
|
|
188
|
-
* @returns Unique slug
|
|
189
|
-
*/
|
|
190
|
-
function uniqueSlugify(text, existingSlugs) {
|
|
191
|
-
const baseSlug = slugify(text);
|
|
192
|
-
let slug = baseSlug;
|
|
193
|
-
let counter = 1;
|
|
194
|
-
while (existingSlugs.has(slug)) {
|
|
195
|
-
slug = `${baseSlug}-${counter}`;
|
|
196
|
-
counter++;
|
|
197
|
-
}
|
|
198
|
-
existingSlugs.add(slug);
|
|
199
|
-
return slug;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* HTML entities that need escaping
|
|
204
|
-
*/
|
|
205
|
-
const HTML_ESCAPE_MAP = {
|
|
206
|
-
'&': '&',
|
|
207
|
-
'<': '<',
|
|
208
|
-
'>': '>',
|
|
209
|
-
'"': '"',
|
|
210
|
-
"'": ''',
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* Escape HTML special characters
|
|
214
|
-
*
|
|
215
|
-
* @param text - Text to escape
|
|
216
|
-
* @returns Escaped text safe for HTML insertion
|
|
217
|
-
*/
|
|
218
|
-
function escapeHtml(text) {
|
|
219
|
-
return text.replace(/[&<>"']/g, (char) => HTML_ESCAPE_MAP[char] || char);
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Allowed HTML tags for sanitization
|
|
223
|
-
*/
|
|
224
|
-
const ALLOWED_TAGS = new Set([
|
|
225
|
-
'a',
|
|
226
|
-
'abbr',
|
|
227
|
-
'b',
|
|
228
|
-
'blockquote',
|
|
229
|
-
'br',
|
|
230
|
-
'code',
|
|
231
|
-
'dd',
|
|
232
|
-
'del',
|
|
233
|
-
'div',
|
|
234
|
-
'dl',
|
|
235
|
-
'dt',
|
|
236
|
-
'em',
|
|
237
|
-
'h1',
|
|
238
|
-
'h2',
|
|
239
|
-
'h3',
|
|
240
|
-
'h4',
|
|
241
|
-
'h5',
|
|
242
|
-
'h6',
|
|
243
|
-
'hr',
|
|
244
|
-
'i',
|
|
245
|
-
'img',
|
|
246
|
-
'ins',
|
|
247
|
-
'kbd',
|
|
248
|
-
'li',
|
|
249
|
-
'ol',
|
|
250
|
-
'p',
|
|
251
|
-
'pre',
|
|
252
|
-
'q',
|
|
253
|
-
's',
|
|
254
|
-
'samp',
|
|
255
|
-
'small',
|
|
256
|
-
'span',
|
|
257
|
-
'strong',
|
|
258
|
-
'sub',
|
|
259
|
-
'sup',
|
|
260
|
-
'table',
|
|
261
|
-
'tbody',
|
|
262
|
-
'td',
|
|
263
|
-
'tfoot',
|
|
264
|
-
'th',
|
|
265
|
-
'thead',
|
|
266
|
-
'tr',
|
|
267
|
-
'u',
|
|
268
|
-
'ul',
|
|
269
|
-
]);
|
|
270
|
-
/**
|
|
271
|
-
* Allowed attributes for sanitization
|
|
272
|
-
*/
|
|
273
|
-
const ALLOWED_ATTRS = new Set([
|
|
274
|
-
'href',
|
|
275
|
-
'src',
|
|
276
|
-
'alt',
|
|
277
|
-
'title',
|
|
278
|
-
'class',
|
|
279
|
-
'id',
|
|
280
|
-
'name',
|
|
281
|
-
'target',
|
|
282
|
-
'rel',
|
|
283
|
-
'width',
|
|
284
|
-
'height',
|
|
285
|
-
'align',
|
|
286
|
-
'colspan',
|
|
287
|
-
'rowspan',
|
|
288
|
-
]);
|
|
289
|
-
/**
|
|
290
|
-
* Sanitize HTML string by removing dangerous content
|
|
291
|
-
*
|
|
292
|
-
* @param html - HTML string to sanitize
|
|
293
|
-
* @returns Sanitized HTML string
|
|
294
|
-
*/
|
|
295
|
-
function sanitizeHtml(html) {
|
|
296
|
-
let result = html;
|
|
297
|
-
// Remove script tags first
|
|
298
|
-
result = result.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
|
|
299
|
-
// Remove event handlers
|
|
300
|
-
result = result.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/gi, '');
|
|
301
|
-
// Remove disallowed tags (keep content) and sanitize attributes
|
|
302
|
-
result = result.replace(/<\/?(\w+)([^>]*)>/g, (match, tagName, attrs) => {
|
|
303
|
-
const tag = tagName.toLowerCase();
|
|
304
|
-
if (!ALLOWED_TAGS.has(tag)) {
|
|
305
|
-
return '';
|
|
306
|
-
}
|
|
307
|
-
// For closing tags, just return them
|
|
308
|
-
if (match.startsWith('</')) {
|
|
309
|
-
return `</${tag}>`;
|
|
310
|
-
}
|
|
311
|
-
// Sanitize attributes
|
|
312
|
-
const sanitizedAttrs = [];
|
|
313
|
-
const attrRegex = /\s+([\w-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\S+))/g;
|
|
314
|
-
let attrMatch;
|
|
315
|
-
while ((attrMatch = attrRegex.exec(attrs)) !== null) {
|
|
316
|
-
const [, attrName, v1, v2, v3] = attrMatch;
|
|
317
|
-
const attr = attrName.toLowerCase();
|
|
318
|
-
if (ALLOWED_ATTRS.has(attr)) {
|
|
319
|
-
let value = v1 ?? v2 ?? v3 ?? '';
|
|
320
|
-
// Check for dangerous URLs in href/src
|
|
321
|
-
if ((attr === 'href' || attr === 'src') && /^\s*javascript\s*:/i.test(value)) {
|
|
322
|
-
value = '';
|
|
323
|
-
}
|
|
324
|
-
sanitizedAttrs.push(`${attr}="${value}"`);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
const attrStr = sanitizedAttrs.length > 0 ? ' ' + sanitizedAttrs.join(' ') : '';
|
|
328
|
-
return `<${tag}${attrStr}>`;
|
|
329
|
-
});
|
|
330
|
-
return result;
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Strip all HTML tags from a string
|
|
334
|
-
*
|
|
335
|
-
* @param html - HTML string to strip
|
|
336
|
-
* @returns Plain text without HTML tags
|
|
337
|
-
*/
|
|
338
|
-
function stripHtml(html) {
|
|
339
|
-
return html.replace(/<[^>]*>/g, '');
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
export { escapeHtml, findNode, findNodes, findNodesBy, findParent, isLiteral, isNodeType, isParent, sanitizeHtml, slugify, stripHtml, traverseAst, traverseAstWithCallbacks, uniqueSlugify };
|
|
343
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/types/index.ts","../src/ast/traverse.ts","../src/ast/query.ts","../src/string/slugify.ts","../src/string/sanitize.ts"],"sourcesContent":[null,null,null,null,null],"names":[],"mappings":"AAiDA;;AAEG;AACG,SAAU,QAAQ,CAAC,IAAe,EAAA;AACtC,IAAA,OAAO,UAAU,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAE,IAAe,CAAC,QAAQ,CAAC;AACvE;AAEA;;AAEG;AACG,SAAU,SAAS,CAAC,IAAe,EAAA;IACvC,OAAO,OAAO,IAAI,IAAI,IAAI,OAAQ,IAAgB,CAAC,KAAK,KAAK,QAAQ;AACvE;AAEA;;AAEG;AACG,SAAU,UAAU,CACxB,IAAe,EACf,IAAe,EAAA;AAEf,IAAA,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI;AAC3B;;ACnEA;;;;;;;AAOG;AACG,SAAU,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EAAE;gBAC3B,IAAI,KAAK,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;;AAGhC,gBAAA,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,KAAK,KAAK,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;oBAC5E,KAAK,GAAG,EAAE;gBACZ;gBAEA,cAAc,CAAC,IAAI,CAAC,CAAA,EAAG,IAAI,CAAA,EAAA,EAAK,KAAK,CAAA,CAAA,CAAG,CAAC;YAC3C;QACF;QAEA,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,GAAG,CAAC,GAAG,GAAG,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;AAC/E,QAAA,OAAO,CAAA,CAAA,EAAI,GAAG,CAAA,EAAG,OAAO,GAAG;AAC7B,IAAA,CAAC,CAAC;AAEF,IAAA,OAAO,MAAM;AACf;AAEA;;;;;AAKG;AACG,SAAU,SAAS,CAAC,IAAY,EAAA;IACpC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;AACrC;;;;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Escape HTML special characters
|
|
3
|
-
*
|
|
4
|
-
* @param text - Text to escape
|
|
5
|
-
* @returns Escaped text safe for HTML insertion
|
|
6
|
-
*/
|
|
7
|
-
export declare function escapeHtml(text: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Sanitize HTML string by removing dangerous content
|
|
10
|
-
*
|
|
11
|
-
* @param html - HTML string to sanitize
|
|
12
|
-
* @returns Sanitized HTML string
|
|
13
|
-
*/
|
|
14
|
-
export declare function sanitizeHtml(html: string): string;
|
|
15
|
-
/**
|
|
16
|
-
* Strip all HTML tags from a string
|
|
17
|
-
*
|
|
18
|
-
* @param html - HTML string to strip
|
|
19
|
-
* @returns Plain text without HTML tags
|
|
20
|
-
*/
|
|
21
|
-
export declare function stripHtml(html: string): string;
|
|
22
|
-
//# sourceMappingURL=sanitize.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/string/sanitize.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAwED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA+CjD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert text to URL-safe slug
|
|
3
|
-
*
|
|
4
|
-
* @param text - Text to slugify
|
|
5
|
-
* @returns URL-safe slug
|
|
6
|
-
*/
|
|
7
|
-
export declare function slugify(text: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Generate unique slug with counter suffix for duplicates
|
|
10
|
-
*
|
|
11
|
-
* @param text - Text to slugify
|
|
12
|
-
* @param existingSlugs - Set of existing slugs to check against
|
|
13
|
-
* @returns Unique slug
|
|
14
|
-
*/
|
|
15
|
-
export declare function uniqueSlugify(text: string, existingSlugs: Set<string>): string;
|
|
16
|
-
//# sourceMappingURL=slugify.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slugify.d.ts","sourceRoot":"","sources":["../../src/string/slugify.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAe5C;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAY9E"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { Root, Content, Parent, Literal } from 'mdast';
|
|
2
|
-
import type { Node as UnistNode } from 'unist';
|
|
3
|
-
export type { Root, Content, Parent, Literal };
|
|
4
|
-
/**
|
|
5
|
-
* All possible markdown node types
|
|
6
|
-
*/
|
|
7
|
-
export type MdNode = Root | Content;
|
|
8
|
-
/**
|
|
9
|
-
* Root node of markdown AST
|
|
10
|
-
*/
|
|
11
|
-
export type MdRoot = Root;
|
|
12
|
-
/**
|
|
13
|
-
* Visitor function for AST traversal
|
|
14
|
-
*/
|
|
15
|
-
export type Visitor<T extends UnistNode = MdNode> = (node: T, index: number | undefined, parent: Parent | undefined) => void | boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Plugin options base interface
|
|
18
|
-
*/
|
|
19
|
-
export interface PluginOptions {
|
|
20
|
-
[key: string]: unknown;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Position information in source
|
|
24
|
-
*/
|
|
25
|
-
export interface Position {
|
|
26
|
-
line: number;
|
|
27
|
-
column: number;
|
|
28
|
-
offset?: number;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Location in source
|
|
32
|
-
*/
|
|
33
|
-
export interface Location {
|
|
34
|
-
start: Position;
|
|
35
|
-
end: Position;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Type guard to check if node is a parent node
|
|
39
|
-
*/
|
|
40
|
-
export declare function isParent(node: UnistNode): node is Parent;
|
|
41
|
-
/**
|
|
42
|
-
* Type guard to check if node is a literal node
|
|
43
|
-
*/
|
|
44
|
-
export declare function isLiteral(node: UnistNode): node is Literal;
|
|
45
|
-
/**
|
|
46
|
-
* Type guard to check if node has specific type
|
|
47
|
-
*/
|
|
48
|
-
export declare function isNodeType<T extends MdNode>(node: UnistNode, type: T['type']): node is T;
|
|
49
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,E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SProperties } from 'react';
|
|
2
|
-
import type { Root } from 'mdast';
|
|
3
|
-
import { type ParserOptions } from '@pd-markdown/parser';
|
|
4
|
-
import type { ComponentMap } from './defaults';
|
|
5
|
-
export interface MarkdownRendererProps {
|
|
6
|
-
/** Markdown source string (will be parsed) */
|
|
7
|
-
source?: string;
|
|
8
|
-
/** Pre-parsed AST (skip parsing, useful for SSR) */
|
|
9
|
-
ast?: Root;
|
|
10
|
-
/** Custom component overrides */
|
|
11
|
-
components?: Partial<ComponentMap>;
|
|
12
|
-
/** CSS class name for wrapper */
|
|
13
|
-
className?: string;
|
|
14
|
-
/** Inline styles for wrapper */
|
|
15
|
-
style?: CSSProperties;
|
|
16
|
-
/** Parser options (only used when source is provided) */
|
|
17
|
-
parserOptions?: ParserOptions;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Main markdown renderer component
|
|
21
|
-
*
|
|
22
|
-
* Supports both client-side and server-side rendering:
|
|
23
|
-
* - Pass `source` for automatic parsing
|
|
24
|
-
* - Pass `ast` for pre-parsed content (SSR optimization)
|
|
25
|
-
*/
|
|
26
|
-
export declare const MarkdownRenderer: FC<MarkdownRendererProps>;
|
|
27
|
-
//# sourceMappingURL=MarkdownRenderer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../src/components/MarkdownRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,WAAW,qBAAqB;IACpC,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oDAAoD;IACpD,GAAG,CAAC,EAAE,IAAI,CAAA;IACV,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;IAClC,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gCAAgC;IAChC,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,yDAAyD;IACzD,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAeD;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA2BtD,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
import type { Content, Root } from 'mdast';
|
|
3
|
-
export interface NodeRendererProps {
|
|
4
|
-
node: Content | Root;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Recursive node renderer that renders AST nodes to React elements
|
|
8
|
-
*/
|
|
9
|
-
export declare const NodeRenderer: FC<NodeRendererProps>;
|
|
10
|
-
//# sourceMappingURL=NodeRenderer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRenderer.d.ts","sourceRoot":"","sources":["../../src/components/NodeRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAA2B,MAAM,OAAO,CAAA;AAInE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAgM9C,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ComponentMap } from './defaults';
|
|
2
|
-
/**
|
|
3
|
-
* Context value for markdown renderer
|
|
4
|
-
*/
|
|
5
|
-
export interface MarkdownContextValue {
|
|
6
|
-
/** Custom component overrides */
|
|
7
|
-
components: Partial<ComponentMap>;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Context for passing configuration down the component tree
|
|
11
|
-
*/
|
|
12
|
-
export declare const MarkdownContext: import("react").Context<MarkdownContextValue>;
|
|
13
|
-
/**
|
|
14
|
-
* Hook to access markdown context
|
|
15
|
-
*/
|
|
16
|
-
export declare function useMarkdownContext(): MarkdownContextValue;
|
|
17
|
-
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/components/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,iCAAiC;IACjC,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;CAClC;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,+CAE1B,CAAA;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,oBAAoB,CAEzD"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { FC, ReactNode } from 'react';
|
|
2
|
-
import type { Blockquote as BlockquoteNode } from 'mdast';
|
|
3
|
-
export interface BlockquoteProps {
|
|
4
|
-
node: BlockquoteNode;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const Blockquote: FC<BlockquoteProps>;
|
|
8
|
-
//# sourceMappingURL=Blockquote.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Blockquote.d.ts","sourceRoot":"","sources":["../../../src/components/defaults/Blockquote.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,OAAO,CAAA;AAEzD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,cAAc,CAAA;IACpB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAE1C,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { FC, ReactNode } from 'react';
|
|
2
|
-
import type { Code as CodeNode, InlineCode } from 'mdast';
|
|
3
|
-
export interface CodeProps {
|
|
4
|
-
node: CodeNode;
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const Code: FC<CodeProps>;
|
|
8
|
-
export interface InlineCodeProps {
|
|
9
|
-
node: InlineCode;
|
|
10
|
-
children?: ReactNode;
|
|
11
|
-
}
|
|
12
|
-
export declare const InlineCodeComponent: FC<InlineCodeProps>;
|
|
13
|
-
//# sourceMappingURL=Code.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../../src/components/defaults/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAQ9B,CAAA;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,UAAU,CAAA;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,eAAe,CAEnD,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { FC, ReactNode } from 'react';
|
|
2
|
-
import type { Heading as HeadingNode } from 'mdast';
|
|
3
|
-
export interface HeadingProps {
|
|
4
|
-
node: HeadingNode;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const Heading: FC<HeadingProps>;
|
|
8
|
-
//# sourceMappingURL=Heading.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../src/components/defaults/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,OAAO,CAAA;AAEnD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,WAAW,CAAA;IACjB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAKpC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../src/components/defaults/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,OAAO,CAAA;AAE/C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAA;CAChB;AAED,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAEhC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/defaults/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE7C,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAS9B,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { FC, ReactNode } from 'react';
|
|
2
|
-
import type { List as ListNode, ListItem as ListItemNode } from 'mdast';
|
|
3
|
-
export interface ListProps {
|
|
4
|
-
node: ListNode;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const List: FC<ListProps>;
|
|
8
|
-
export interface ListItemProps {
|
|
9
|
-
node: ListItemNode;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
}
|
|
12
|
-
export declare const ListItem: FC<ListItemProps>;
|
|
13
|
-
//# sourceMappingURL=List.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/components/defaults/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,OAAO,CAAA;AAEvE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CAK9B,CAAA;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAYtC,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { FC, ReactNode } from 'react';
|
|
2
|
-
import type { Paragraph as ParagraphNode } from 'mdast';
|
|
3
|
-
export interface ParagraphProps {
|
|
4
|
-
node: ParagraphNode;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const Paragraph: FC<ParagraphProps>;
|
|
8
|
-
//# sourceMappingURL=Paragraph.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Paragraph.d.ts","sourceRoot":"","sources":["../../../src/components/defaults/Paragraph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,OAAO,CAAA;AAEvD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,aAAa,CAAA;IACnB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAExC,CAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { FC, ReactNode } from 'react';
|
|
2
|
-
import type { Table as TableNode, TableRow as TableRowNode, TableCell as TableCellNode } from 'mdast';
|
|
3
|
-
export interface TableProps {
|
|
4
|
-
node: TableNode;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare const Table: FC<TableProps>;
|
|
8
|
-
export interface TableRowProps {
|
|
9
|
-
node: TableRowNode;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
isHeader?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare const TableRow: FC<TableRowProps>;
|
|
14
|
-
export interface TableCellProps {
|
|
15
|
-
node: TableCellNode;
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
}
|
|
18
|
-
export declare const TableCell: FC<TableCellProps>;
|
|
19
|
-
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/defaults/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EACV,KAAK,IAAI,SAAS,EAClB,QAAQ,IAAI,YAAY,EACxB,SAAS,IAAI,aAAa,EAC3B,MAAM,OAAO,CAAA;AAEd,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAA;IACf,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,KAAK,EAAE,EAAE,CAAC,UAAU,CAMhC,CAAA;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAStC,CAAA;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,aAAa,CAAA;IACnB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAOxC,CAAA"}
|