import { MarkdownService } from '../../src/common'; describe('MarkdownService', () => { let service: MarkdownService; beforeEach(() => { service = new MarkdownService(); }); it('embeds, extracts and strips markdown source marker', () => { const markdown = '# 标题\n\n正文'; const html = service.embedSourceHtml('
正文
'); (service as any).sanitizeHtmlProcessorPromise = Promise.resolve({ process, }); const html = await service.sanitizeHtml( '正文
', ); expect(process).toHaveBeenCalledWith( '正文
', ); expect(html).toContain('正文
'); expect(html).not.toContain('onclick'); expect(html).not.toContain('