import { describe, expect, it } from 'vitest' import { renderMarkdownContent } from './vite-plugin-content.js' describe('markdown content rendering', () => { it('removes only an initial level-one heading', () => { const html = renderMarkdownContent('# Duplicate title\n\nIntro\n\n## Section') expect(html).not.toContain('

Duplicate title

') expect(html).toContain('

Intro

') expect(html).toContain('

Section

') }) it('keeps content when no initial level-one heading exists', () => { const html = renderMarkdownContent('Intro\n\n# Deliberate heading') expect(html).toContain('

Intro

') expect(html).toContain('

Deliberate heading

') }) })