chore: CRM-NEW baseline

This commit is contained in:
wangliang
2026-10-23 10:35:28 +08:00
commit aa499f6dbf
111 changed files with 15126 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
'use strict';
const test = require('node:test');
const assert = require('node:assert/strict');
const { markdownToHtml } = require('../src/markdown');
test('markdown: bold + link + list', () => {
const html = markdownToHtml('这里有一些 **戒指**:\n- [Rings](https://www.yehwang.com/jewelry/rings)\n- Plain\n\n谢谢');
assert.match(html, /<strong>戒指<\/strong>/);
assert.match(html, /<a href="https:\/\/www\.yehwang\.com\/jewelry\/rings"[^>]*>Rings<\/a>/);
assert.match(html, /<ul><li>/);
assert.match(html, /<p>谢谢<\/p>/);
assert.doesNotMatch(html, /\[Rings\]/);
});
test('markdown: escapes html and autolinks bare urls', () => {
const html = markdownToHtml('<script>x</script> https://a.test/x');
assert.match(html, /&lt;script&gt;/);
assert.match(html, /<a href="https:\/\/a\.test\/x"/);
});