// 회의 내보내기 마크다운 렌더러(core) 회귀 테스트. // 예전 정규식 변환은 이스케이프가 없어 `List`·`` 가 PDF에서 사라졌고, // 한 줄짜리 줄들이 한 문단으로 붙었으며, 표가 파이프 그대로 찍혔다. import { describe, expect, it } from 'vitest' import { Paragraph, Table } from 'docx' import { escapeHtml, markdownToSimpleHtml, parseMarkdownBlocks, renderMeetingPdfHtml, } from '../src/utils/meeting-markdown' import { blocksToDocxElements, markdownToDocx } from '../src/utils/markdown-to-docx' describe('parseMarkdownBlocks', () => { it('제목·불릿·체크박스(두 상태)·표·문단·구분선을 나눈다', () => { const md = [ '## 결정', '- 타입을 List 으로 변경', '- [ ] 문서화', '- [x] 배포', '', '담당: ', '줄1', '---', '| 시간 | 내용 |', '|---|---|', '| 00:01 | 시작 |', ].join('\n') expect(parseMarkdownBlocks(md)).toEqual([ { type: 'heading', level: 2, text: '결정' }, { type: 'bullet', text: '타입을 List 으로 변경' }, { type: 'checkbox', checked: false, text: '문서화' }, { type: 'checkbox', checked: true, text: '배포' }, { type: 'paragraph', lines: ['담당: ', '줄1'] }, { type: 'rule' }, { type: 'table', header: ['시간', '내용'], rows: [['00:01', '시작']] }, ]) }) it('빈 입력은 빈 목록', () => { expect(parseMarkdownBlocks('')).toEqual([]) expect(parseMarkdownBlocks(null)).toEqual([]) }) }) describe('markdownToSimpleHtml', () => { it('꺾쇠·앰퍼샌드·따옴표를 이스케이프해 PDF 에서 사라지지 않게 한다', () => { const html = markdownToSimpleHtml('- List & "q" ') expect(html).toContain('List<String> & "q" <script>') expect(html).not.toContain('