feature: vor und nachteile

This commit is contained in:
Hikyu
2026-05-31 13:54:31 +02:00
parent 552a947a1c
commit e3dad17446
23270 changed files with 3024794 additions and 200 deletions
+60
View File
@@ -0,0 +1,60 @@
import { describe, expect, it } from 'vitest'
import { createMarkdown } from '../src/core/markdown'
import { resolveOptions } from '../src/core/options'
describe('excerpt', () => {
it('rendered excerpt', async () => {
const options = resolveOptions({
excerpt: true,
frontmatterOptions: {
grayMatterOptions: {
excerpt: true,
excerpt_separator: '<!-- more -->',
},
},
})
const markdownToVue = createMarkdown(options)
const md = `---
title: Hey
---
This is an excerpt which has been rendered to **HTML**.
<!-- more -->
# Hello
- A
- B
- C`
expect((await markdownToVue('', md)).code).toMatchSnapshot()
})
it('raw excerpt', async () => {
const options = resolveOptions({
excerpt: true,
frontmatterOptions: {
renderExcerpt: false,
grayMatterOptions: {
excerpt: true,
excerpt_separator: '<!-- more -->',
},
},
})
const markdownToVue = createMarkdown(options)
const md = `---
title: Hey
---
This is an excerpt which is kept as **raw Markdown**.
<!-- more -->
# Hello
- A
- B
- C`
expect((await markdownToVue('', md)).code).toMatchSnapshot()
})
})