Skip to content

Commit cfa7538

Browse files
authored
Merge branch 'main' into fix/2088
2 parents 4e59efb + cb0ac1b commit cfa7538

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

docs/custom/config-unocss.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
By default, Slidev enables the following presets out-of-box:
88

9-
- [@unocss/preset-uno](https://unocss.dev/presets/uno) - Tailwind / Windi CSS compatible utilities
9+
- [@unocss/preset-wind3](https://unocss.dev/presets/wind3) - Tailwind / Windi CSS compatible utilities
1010
- [@unocss/preset-attributify](https://unocss.dev/presets/attributify) - Attributify mode
1111
- [@unocss/preset-icons](https://unocss.dev/presets/icons) - Use any icons as class
1212
- [@unocss/preset-web-fonts](https://unocss.dev/presets/web-fonts) - Use web fonts at ease

packages/parser/src/core.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ export async function parse(
148148
const newContent = await e.transformSlide(slide.content, slide.frontmatter)
149149
if (newContent !== undefined)
150150
slide.content = newContent
151+
if (typeof slide.frontmatter.title === 'string') {
152+
slide.title = slide.frontmatter.title
153+
}
154+
if (typeof slide.frontmatter.level === 'number') {
155+
slide.level = slide.frontmatter.level
156+
}
151157
}
152158
}
153159
}

test/utils.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe('utils', () => {
109109
}
110110

111111
const slide1 = createFakeSource(``)
112-
updateFrontmatterPatch(slide1, { dragPos })
112+
updateFrontmatterPatch(slide1.source, { dragPos })
113113
expectFrontmatter(slide1).toMatchInlineSnapshot(`
114114
"dragPos:
115115
foo: 1,2,3,4
@@ -122,7 +122,7 @@ describe('utils', () => {
122122
dragPos:
123123
bar: 5,6,7,8
124124
`)
125-
updateFrontmatterPatch(slide2, { dragPos })
125+
updateFrontmatterPatch(slide2.source, { dragPos })
126126
expectFrontmatter(slide2).toMatchInlineSnapshot(`
127127
"# comment
128128
title: Hello # another comment
@@ -138,7 +138,7 @@ describe('utils', () => {
138138
dragPos:
139139
bar: 5,6,7,8
140140
`)
141-
updateFrontmatterPatch(slide3, { title: null })
141+
updateFrontmatterPatch(slide3.source, { title: null })
142142
expectFrontmatter(slide3).toMatchInlineSnapshot(`
143143
"dragPos:
144144
bar: 5,6,7,8

0 commit comments

Comments
 (0)