Files
2026-07-10 17:59:59 +08:00

26 lines
597 B
JavaScript
Executable File

const { marked } = require('marked');
marked.setOptions({
gfm: true,
breaks: true,
tables: true
});
const testContent = `## 测试表格
| 分组 | 成员数 | 特征 |
|:---|:---|:---|
| Group I | 1个 | — |
| Group II | 5个 | 含ANK结构域 |
**加粗测试**
`;
const html = marked.parse(testContent);
console.log('=== 渲染结果 ===');
console.log(html);
console.log('=== 是否包含 table 标签 ===');
console.log('包含 <table>:', html.includes('<table'));
console.log('包含 <thead>:', html.includes('<thead'));
console.log('包含 <tbody>:', html.includes('<tbody'));