- Add Vite as alternative build (vite.config.ts, scripts/vite-plugin-*)
- Add dab04af7 RSS fix (distRoot, ripgrep path, post-build)
- Pull in packages/builtin-tools/ (+354 files)
- Pull in packages/agent-tools/, mcp-client/, acp-link/, weixin/
- Copy defines.ts from upstream for Vite compatibility
- Update package.json with Vite scripts and deps
35 lines
967 B
TypeScript
35 lines
967 B
TypeScript
import { describe, expect, test } from 'bun:test'
|
|
import { markdownToPlainText } from '../send.js'
|
|
|
|
describe('markdownToPlainText', () => {
|
|
test('removes bold markers', () => {
|
|
expect(markdownToPlainText('**bold**')).toBe('bold')
|
|
})
|
|
|
|
test('removes italic markers', () => {
|
|
expect(markdownToPlainText('*italic*')).toBe('italic')
|
|
})
|
|
|
|
test('removes inline code backticks', () => {
|
|
expect(markdownToPlainText('`code`')).toBe('code')
|
|
})
|
|
|
|
test('removes code block fences', () => {
|
|
expect(markdownToPlainText("```js\nconsole.log('hi');\n```")).toBe(
|
|
"console.log('hi');",
|
|
)
|
|
})
|
|
|
|
test('converts links to text with URL', () => {
|
|
expect(markdownToPlainText('[click](https://example.com)')).toBe(
|
|
'click (https://example.com)',
|
|
)
|
|
})
|
|
|
|
test('handles mixed markdown', () => {
|
|
expect(
|
|
markdownToPlainText('# Hello\n\n**bold** and *italic* with `code`'),
|
|
).toBe('Hello\n\nbold and italic with code')
|
|
})
|
|
})
|