import test from 'node:test' import assert from 'node:assert/strict' import { renderMarkdown } from '../src/lib/markdown.ts' test('renders the reported Chinese bold text without showing formatting markers', () => { const source = '**昵称:会变成美少女 小红书号:49575364531**(IP 广东;13 关注 / 1.4 万粉丝 / 29.6 万获赞与收藏,标签“潮流博主”)。' const html = renderMarkdown(source) assert.match(html, /昵称:会变成美少女 小红书号:49575364531<\/strong>(IP 广东/) assert(!html.includes('**')) }) test('renders lists, headings, quotes, code, tables and line breaks', () => { const html = renderMarkdown('# 方案\n\n1. **确认预算**\n2. 使用 `app_id`\n\n> 等待确认\n\n```js\nconst value = "\n\n\n[危险](javascript:alert(1)) [文件](file:///C:/secret) [数据](data:text/html,test)') assert(!/ { const html = renderMarkdown('[参考](https://example.com/?x=1&y=2 "说明")\n\n![截图](https://example.com/image.png)') assert.equal((html.match(/target="_blank"/g) || []).length, 2) assert.equal((html.match(/rel="noopener noreferrer"/g) || []).length, 2) assert(!html.includes('