import { describe, it, expect } from 'vitest' import { renderMarkdownToSafeHtml, markdownToPlainText, } from '@/lib/markdown' describe('renderMarkdownToSafeHtml', () => { it('헤딩/리스트/굵은 글씨를 HTML로 변환한다', () => { const html = renderMarkdownToSafeHtml(`# 제목 - 항목1 - **중요** 항목2`) expect(html).toContain('
로 감싼다', () => {
const html = renderMarkdownToSafeHtml('```\nconst x = 1\n```')
expect(html).toContain('')
expect(html).toContain('')
})
it('인라인 HTML 스크립트는 살균되어 제거된다', () => {
const html = renderMarkdownToSafeHtml(
'안녕 세계',
)
expect(html).not.toContain('